1

Ok here is my setup.

Main report containing a subreport. Subreport is a crosstab report. One of the fields in the crosstab has the possibility of being very long, but this needs to be this way. When the long field isn't long, the report renders fine. If it contains a lot of text, jasper bombs out complaining about infinite loop over 3 pages.

I feel like this is a bug, but am wondering if I should be going at this report in a different manner to avoid this issue. Is there perhaps another control I can use to display dynamic columns like a crosstab, with support for longer text as well?

Thanks, if any other info about my reports would help, feel free to ask and I'll give ya what I can.

The error message is:

ERROR JRFillSubreport - Fill 1: exception net.sf.jasperreports.engine.JRRuntimeException: Crosstab has not printed anything on 3 consecutive pages, likely infinite loop

John Helfert
  • 182
  • 2
  • 12

2 Answers2

0

I had the same issue when I was using crosstab repors as some of my cells were 1.5K+ characters... I outlined the way I did it here.

Basically I used a sub dataset rather then a sub report. Also the most important thing for me was the height and width values I set on the "crosstabCell" and "reportElement" elements.

I found I had to hack the XML a bit to get it going but in the end it's all working.

Hope it helps :)

Community
  • 1
  • 1
travega
  • 8,284
  • 16
  • 63
  • 91
  • Hmm, what part of your solution addresses the issue of the large text infinite loop? I am using a standard jdbc datasource not an xml file, so I don't think I need everything that is in that explanation. – John Helfert Mar 05 '12 at 14:45
  • Things that effect infinite looping: 1 - supreport overflow beyond master width where relative postition is incorrectly configured with overflow. 2 - cell widths. The words "most important thing for me was the height and width values I set on the "crosstabCell" and "reportElement" elements" hints at this one ;) I found harmony in a width of "100" for each cell. At 70: infinite looping... At 200: infinite looping... At 100: no infinite looping. Why I don't know, possibly a bug. As for sub reports for crosstabs I've always run into issues with that so I stick to subdatasets. – travega Mar 06 '12 at 03:18
  • Thanks! I'll see if I can tweak it to work without limiting text input. :P – John Helfert Mar 06 '12 at 14:49
  • You won't need to limit text input just the width of the cell. Your data will wrap. It just means your cell will be tall and skinny ;) – travega Mar 06 '12 at 20:14
  • Well right now that is what is causing the infinite loop, the single row extends beyond a single page vertically. Even when the row starts on a new page. – John Helfert Mar 07 '12 at 23:08
0

I have had this 'Infinite Loop' problem on production systems, when using Jasper reports - Crosstab. I couldn't know the exact reason why it was happening, as there was no error/exception logged. The only hint was that, it was happening only for a couple of cases, where the crosstab column data was long and had to overflow to the next page. I realized that elements with "stretch with overflow" can confuse the Jasper Engine and get into "Infinite Loop". It is understandable that Crosstab can't do everything that you ask for, as some "stretching" functionality is not reasonable. As for my report design, I had customized a bit of crosstab, by having additional elements (occupying extra space) and having some elements with "Stretch with overflow" functionality.

After this problem was reported, I created a simple report with crosstab, without any customization or stretch functionality and tested it with all kinds of test cases....and it worked. It's been a while and this 'Infinite Loop' problem wasn't reported after this change.

bchetty
  • 2,231
  • 1
  • 19
  • 26