Question
· Apr 5, 2019

Is there any built-in error handling features available in Zen report

Greetings,

Is there any default exception handling feature available in Zen report? I am working on a report that comprises of several different composites report (%ZEN.Report.Display.composite). I am incorporating several composites into the main Zen report, If any composite fails or encounters an issue such as issue with the sql statement or class method which i am using to fetch the data, the report (pdf) fails and shows a Zen error. It is very hard to find an exact composite or code that causes the error as Zen report displaying a generic Zen Error without any details.

So, I am adding try-catch block in the class method for each composite and recording errors in the log file (persistence class for storing errors) but I would like to know if there is any better exception handling feature available in Zen reports.

Any thoughts or solution would be really appreciated.

Discussion (3)1
Log in or sign up to continue

The ZEN Reports documentation has a helpful trouble shooting section.

https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...

I have found it helpful to save to <CacheInstall>/mgr/Temp all the intermediate files, the error messages from invoking FOP, the .xsl files, the .fo files, if any, and the PDF files.

The easiest way to do this is to set in the namespace from which the reports are being run, the following global: 

Set ^CacheTemp.ZEN("DebugZen","NoDelete")=1

There are three common sources of ZEN Report errors:

1) The ObjectScript code for invoking the report has errors.  Very often these errors can be found by examining %objlasterror, and if not, standard Object Script debugging techniques will often show the problem.

2) The generated xml or xsl or fo are invalid.  If you have a decent parsing editor such as XMLSpy Professional or Oxygen Editor, you can open each of the generated files in turn, with the appropriate editor.  If these editors find a problem such as an invalid tag or attribute, one can use FindInFiles on the reports searching for the names or attributes that are part of the error the editor detected to find the report in error, and the area in the report that is erroneous.  Since intermediate fo files are not always generated, and since fo files can be invalid in terms of the XSL-FO 1.1 standard, one sometimes needs to generate the fo files using the instructions in the ZEN Reports User Guide.

3) If all the files are valid, then it is still possible that FOP has emitted a Java exception stack for some reason.  These stacks can be seen by lookin at the .txt files generated in <CacheInstall>/mgr/Temp.

I hope this helps.

Jonathan Levinson

Is there a way  I can get the exact error message which we can see from System operation->system logs->Application Error logs?
We can also see this error message through the URL by adding $LOG=1 followed by the Zen report URL.

Actually the goal is to get the system error log information, stored in ^SysLog, related to Zen report and store in the user defined log classes. I believe this error log has well defined error messages that can help tracking the exact  problem area either Zen Composite or Zen page level for Zen reports

Please share your thoughts!!

Thanks in advance