PDF Generation error

By: Chuck Deal - cdeal
PDF Generation error
2003-01-22 12:37
I have a report defintion that works just fine as far as i can tell. I have been able to view my reports, use different criteria, etc. By all accounts it seems fine.

I was even able to generate PDFs from the report, BEFORE. I don't know what happened, perhaps it is related to subreports, but I can't generate PDFs anymore (using JasperRunManager.runReportToPdf) I have successfully used this method before so I don't believe that it is the problem. I can also view the report with data via the JasperViewer. As you can see in the following stack trace, the error is being thown by iText (i am using v0.96). Could this have something to do with subreports? If so, there must be a specific case, because I was able to generate PDFs from this report (that contains subreports) yesterday with no problems and the report definition has barely changed (typos ans such).

java.lang.RuntimeException: No valid column line found.
at com.lowagie.text.pdf.ColumnText.convertColumn(Unknown Source)
at com.lowagie.text.pdf.ColumnText.setColumns(Unknown Source)
at com.lowagie.text.pdf.ColumnText.setSimpleColumn(Unknown Source)
at com.lowagie.text.pdf.ColumnText.setSimpleColumn(Unknown Source)
at dori.jasper.engine.export.JRPdfExporter.exportText(JRPdfExporter.java:975)
at dori.jasper.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:316)
at dori.jasper.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:270)
at dori.jasper.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:214)
at dori.jasper.engine.JasperExportManager.exportReportToPdf(JasperExportManager.java:182)
at dori.jasper.engine.JasperRunManager.runReportToPdf(JasperRunManager.java:166)
at com.csc.aims.reports.JasperController.getPDF(JasperController.java:61)
at CodeSnippet_16.run(CodeSnippet_16.java:14)
at org.eclipse.jdt.internal.debug.ui.snippeteditor.ScrapbookMain1.eval(ScrapbookMain1.java:14)
at java.lang.reflect.Method.invoke(Native Method)
at org.eclipse.jdt.internal.debug.ui.snippeteditor.ScrapbookMain.evalLoop(ScrapbookMain.java:48)
at org.eclipse.jdt.internal.debug.ui.snippeteditor.ScrapbookMain.main(ScrapbookMain.java:29)


Any ideas?





By: Chuck Deal - cdeal
FOLLOWUP: PDF Generation error
2003-01-23 07:01
Ok, I have found the source of my problem, but I don't know why it is a problem.

Here is my textField:

<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="Float" x="0" y="15" width="710" height="0"/>
<textElement textAlignment="Center">
<font reportFont="CourierNew" size="12"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[((com.csc.aims.reports.jasperreports.TESTStepsByStatusScriptlet)$P{REPORT_SCRIPTLET}).getFilterDescription($P{TestInfoType}, $P{TestInfoFilter})]]></textFieldExpression>
</textField>


I am using a Scriplet and the method that is being called will either return a String or null. I wanted it to return 'null' so that I could use the isBlankWhenNull attribute of the textField. However, when I have this attribute set to true, I can view it with the JasperViewer, but I can't generate a PDF. If I take that attribute off (set to false), I can generate the PDF just fine.

What I want to do:

I only want this textField to take up space when it "has something to say" therefore, I have set its height to 0 and isStretchWithOverflow="true" to accomodate this.

Can you tell me a better way to accomplish this? Perhaps tell me if there is a bug with the way JasperReports is creating the PDF in this case or maybe iText is where the problem lies?

For now, I will just suffer with the blank line, but I would prefer not to do it that way.

Thanks!




By: Teodor Danciu - teodord
RE: FOLLOWUP: PDF Generation error
2003-01-23 07:24

Hi,

I know what the problem is.
Fortunately, you have posted the text field definition.

Make the text field height="1".

This is a bug that I already fixed for the 0.4.5
version to be released soon.

Thank you,
Teodor
2002 JI Open Discussion's picture
Joined: Aug 10 2006 - 3:28am
Last seen: 17 years 1 month ago

0 Answers:

No answers yet
Feedback
randomness