Jump to content
Changes to the Jaspersoft community edition download ×

Print to text file


Recommended Posts

By: Romy Yuliawan - snricek

Print to text file

2002-03-17 21:47

Hi,

I want to generates 1 Jasper file to 2 output, to PDF as web content and to text file as archives.

Is possible to print Jasper Reports to text file ?

 

thank's

 

 

 

By: Teodor Danciu - teodord

RE: Print to text file

2002-03-25 06:13

 

Hi,

 

The output of JasperReports is too rich

to store in a simple text file.

It is possible to create such a generator,

but it will be almost useless since you

cannot represent exactly the same documents.

 

Using JasperManager you can supply

an OutputStream object to the PDF generating

routines.

You can implement you own OutputStream object

that sends the content simultaneously to the

browser and to a file on disk.

 

Thanks,

Teodor

 

 

 

By: Romy Yuliawan - snricek

RE: Print to text file (I got ascii code)

2002-03-28 01:53

Hi Teodor,

This is a part of my jsp code, no error, but the "outStream.txt" contains only ASCII code, not text formatted.

--------------------------------------------------

String fout=application.getRealPath("/JasperReports/outStream.txt");

JasperManager.fillReportToFile(reportFile.getPath(),fout,parameters,conn);

--------------------------------------------------

 

any suggestion ? if possible, please share me an example.

 

Thanks for your help

 

 

 

By: Teodor Danciu - teodord

RE2: Print to text file

2002-04-07 03:21

 

Hi,

 

The "fillReportToFile" method that you used only

lets you to specify the name of the file that

will be generated.

But even if you name you file ".txt" does not

mean that it will contain readable text.

In fact it still represents a .jrprint file,

so it contains a serialized JasperPrint object

and not simple text.

 

In order to generate simple text documents,

we have to include in JasperReports a special

JRPrinter that would know how to arrange text

in order to keep the generated document general

aspect.

 

Alex Parfenov did a good job in this direction

by creating such a printer class and I think

we will use his code in the future versions.

 

For the moment, generating simple text documents

is not possible.

 

Thanks!

Teodor

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...