[#11876] - Styled text: parsing error should abort fill process

Category:
Enhancement request
Priority:
High
Status:
Assigned
Project: Severity:
Critical
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:

JRStyledTextParser.getStyledText(): line 249

When a styled text contains unescaped characters (e.g. '&', '<'...), the DOMParser will throw a SAXException, but the JRStyledText will catch this exception and continue with the text as unstyled text.
There's just a log entry in the "Error parsing styled text".

With this fallback-behaviour it can happen that we send wrong information to our customer without knowing it.
We woul like to have a setting that allows us to abort the fill process if the styled text can't be parsed.

v6.1.1
JasperReports
Neobye's picture
31
Joined: May 6 2013 - 6:01am
Last seen: 2 months 1 week ago

5 Comments:

#1
  • Status:New» Feedback Requested
  • Assigned:nobody» teodord

Hi,

Would this be required for any type of markup (HTML, RTF), or just for styled text?

Thanks,
Teodor

#2

It makes sense to have this option on any of the markups.
A general setting would make sense. Optionally it could be a setting per markup.

To make an example what could happen with the current implemntation:
A textfield with markup html would receive a text like "investment strategy: bonds <10%".
The printed text on the pdf would be only "investment strategy: bonds ", because the "<10%" (if you got no spaces between < and 10%) is interpreted as opening tag, but is not known. It's just eliminated.

#3
  • Status:Feedback Requested» Assigned
#4
  • Assigned:nobody»

This issue is causing stuck thread.
Ideally there should be error/exception thrown in application instead of long running threads after some point of time.
It shows error in log with endless loop.

When this issue will get resolved?

#5
  • Assigned:nobody» teodord

@Jas_dev_007

I dont think styled text processing error is the cause of your infinite loop.
There must be an inconsistency in your report template design, probably related to the isPrintWhenDetailOverflows flag of some elements, which cause a new page break every time they need to reappear on the new page.

I hope this helps.
Teodor

Feedback