Menu

OX 7 Jasper Reports Not Displaying

2022-10-17
2022-10-25
  • Martin Smith

    Martin Smith - 2022-10-17

    Hi,

    Over the weekend I've been updating my inventory application. to version 7 of OX. This has gone well and it's now way easier to work with IntelliJ. Thanks!

    The only issue I have now is that I can't see any Jasper report output. I see the queries being run in the console and there are no errors but the page refreshes at the end and there's no report. I tried changing the open in new window to false and that didn't work either.

    I'm just extending JasperConcatReportBaseAction so not sure why it's not working.

    Martin

     
  • Martin Smith

    Martin Smith - 2022-10-17

    Hmmm. I just tried a different report and that one works. The original one I tried doesn't. I think this might not be an OX issue but I'm not sure how to find the cause.

     
  • Javier Paniza

    Javier Paniza - 2022-10-19

    Hi Martin:

    Maybe the report has no records, so no PDF is generated.

    You mentioned JasperConcatReportBaseAction. If you do a single report at once. Does it work?

    Did you have any trace in the log?


    Help others in this forum as I help you.

     
  • Martin Smith

    Martin Smith - 2022-10-19

    Hi,

    Thanks for the suggestions.

    The table has about 1000 rows so I was expecting to see output. The SQL queries are in the report files so it shouldn't be filtered. I tried it with just one jrxml file and it didn't work. I also just tried restricting the query to a small number of rows and that didn't help.

    There's nothing in the log except a few Jasper deprecation warnings and the end of action timing. I get the same deprecation warnings on the report that works. It's a bit strange.

     
  • Martin Smith

    Martin Smith - 2022-10-20

    Some more info. I tried it in a standalone Tomcat to see if there was anything odd about the embedded config, and I got the same result.

    I just tried a debugger at the start of doGet() in GenerateConcatReportServlet. Interestingly this breakpoint fires when I use the report that works but not when I use the other one. It looks like the browser isn't making the request for the report.

    I'm suspicious of the use of System.currentTimeMillis in the report actions. If that's being used as a key it could change between calls to getForwardURIs() and getFilename(). I think it's a potential race condition. It doesn't seem to be the cause of this issue as I tried a fix for this to get the time when the execute starts and use that in both methods.

    I'm wondering about a timeout somewhere but the default should be 60 seconds for Tomcat. I don't think it's a browser issue as I see it in Edge as well as Chrome.

    I'll do more debugging but currently I haven't found a plausible cause.

     

    Last edit: Martin Smith 2022-10-20
  • Martin Smith

    Martin Smith - 2022-10-20

    OK, more debugging. It seems to be something related to IMultipleForwardAction handling. If I replace JasperMultipleReportBaseAction with a copy that implements IForwardAction instead then the concat report works.

    This is obviously not a proper solution as some multiple reports return more than one URI but I think it might help to narrow it down.

    I currently don't understand why it works for one report but not the other one and I haven't found anything wrong trying to debug the request flows.

     
  • Javier Paniza

    Javier Paniza - 2022-10-21

    Hi Martin:

    Could you create a small project with just one entity, two reports and a print action that reproduce your problem?

    I would like to reproduce it in my computer, so I could figure out what is happening.


    Help others in this forum as I help you.

     
  • Martin Smith

    Martin Smith - 2022-10-21

    I'll try but not sure how reproducible this is going to be.

    One thing I noticed is that with IForwardAction the browser tab opens straight away and you wait for the report to appear. With IMultipleForward the tab opens at the end of the process.

    I realized that ModuleManager / Module handle the single URI case before the multiple one so I have a workround by using my own JasperConcatReportBaseAction.

    Martin

     
  • Martin Smith

    Martin Smith - 2022-10-22

    I've reproduced it on a different computer. Now I need to see if I can create something simple that shows the same problem.

    I have a vague feeling it might be the time taken to generate the report - about 30 seconds for the action to complete. The one that works takes about 8 seconds.

     

    Last edit: Martin Smith 2022-10-22
  • Martin Smith

    Martin Smith - 2022-10-22

    If I take the report that works and stick in a Thread.sleep() for 10 seconds after calling super.execute() it seems to break it in the same way as the other one. I think you might be able to reproduce it by doing something similar.

    I would suspect a race condition or timeout somewhere perhaps.

     
  • Javier Paniza

    Javier Paniza - 2022-10-25

    Hi Martin:

    Try to disable the "Block popup windows" in your browser and try again to generate your report. Does it work?


    Help others in this forum as I help you.

     

Log in to post a comment.