Jump to content
Changes to the Jaspersoft community edition download ×

Outputing a txt File


aubrey.offer

Recommended Posts

I can output all files except a txt file. If I set the format to  text preview, I get the following error

 Exporting Text (JasperReports) to file... C:SubversionWMS_ReportstrunkreportsInventory_Transactions_Report.txt! Error exporting print... Character width in pixels or page width in characters must be specified and must be greater than zero.
net.sf.jasperreports.engine.JRException: Character width in pixels or page width in characters must be specified and must be greater than zero. 
    at net.sf.jasperreports.engine.export.JRTextExporter.setReportParameters(JRTextExporter.java:271) 
    at net.sf.jasperreports.engine.export.JRTextExporter.exportReportToWriter(JRTextExporter.java:333) 
    at net.sf.jasperreports.engine.export.JRTextExporter.exportReport(JRTextExporter.java:221) 
    at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:1174) 
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) 
    at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) 

Export running time: 16

This is the other Text(iReports) preview

 Exporting Text (iReport) to file... C:SubversionWMS_ReportstrunkreportsInventory_Transactions_Report.txt! Error exporting print... net.sf.jasperreports.engine.JRPrintText.getTextAlignment()B
java.lang.NoSuchMethodError: net.sf.jasperreports.engine.JRPrintText.getTextAlignment()B 
    at com.jaspersoft.jrx.export.JRTxtExporter.layoutGrid(JRTxtExporter.java:419) 
    at com.jaspersoft.jrx.export.JRTxtExporter.exportPage(JRTxtExporter.java:300) 
    at com.jaspersoft.jrx.export.JRTxtExporter.exportReportToWriter(JRTxtExporter.java:289) 
    at com.jaspersoft.jrx.export.JRTxtExporter.exportReport(JRTxtExporter.java:257) 
    at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:1174) 
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) 
    at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) 

Export running time: 16

Any other format (other than the above formats) are fine.

 

Any assistance will be greatly appriciated.

Regards

Aubrey

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

I have found the solution for this issue. When we use the Text Preview we should set few more parameters to make it work.

Go to Tools-->Options

Select Export Options tab --> Select Text from left pane

Set values for Character Width, Character Height, (The values I have set 7 and 13.9) Page width and Height. 

Now try generating the report and it will work. Try setting different values to make it fit properly.

The only ISSUE i have now is - it inserts BLANK LINES when there are page breaks. TRYING TO AVOID THOSE BLANK LINES.

Hope this helps and if anyone finds the solution for page break blank lines, let me know.

 

Link to comment
Share on other sites

I found the same solution, i have also refined it a bit. For A4 paper landscape, using Courier new (8), I am using the following settings which seem to work (Still to test the actual printing of the file) character Width 0, Character Height 0, Page width 175, page height 29. Hope this helps.
Link to comment
Share on other sites

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...