I recently ran across an issue with running a report on some custom inventory http://www.itninja.com/question/report-on-custom-inventory. I'm not much of an XML person although JVerbosk did an excellent job explaining.
This lead to a few Google searches where I came across this article. http://www.kace.com/support/resources/kb/article/Customizing-a-Report-Layout-With-Jasper-iReport I was able to get this working with a few "tweaks" to this article.
Changes I made:
- I did download version 4.6.0 (2012-05-21) from http://sourceforge.net/projects/ireport/files/iReport/.
- I did not set compatibility mode. I'll explain later. There is a known bug that we'll fix with Notepad ++. http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=98267
I first created my report using "Classic Reports". It gave me the following layout.
Using iReport I was able fully customize this layout.
One important tool that helped me for this particular report was "Stretch with Overflow". Since the custom inventory was the result of a recursive lookup I never really knew how large the field would need to be.
For the most part the above link will explain how to configure everything. One thing I did notice it after copying the xml from iReport to Kace I received this error
Exception while running report. org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'uuid' is not allowed to appear in element 'jasperReport'. |
This was solved using Notepad++.(http://filehippo.com/download_notepad/).
- Paste the xml from iReport to Notepad++.
- Then select search>replace (Ctrl+H). In the find field enter ' uuid=.+?"' (w/o the singe quotes. make sure to leave the space in the beginning). Leave "Replace With" blank.
- Select "Regular Expression" in the bottom left on this same window. This will remove all the uuid=" ".
- The copy from Notepad++ into "XML Report Layout" in KACE. (Classic Reports Only).
The next error I recieved was
Error Running Report
Exception while running report. com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for
This can be solved by removing the duplicate SQL query in the xml (towards the top). This is discussed more in http://www.kace.com/support/resources/kb/article/Customizing-a-Report-Layout-With-Jasper-iReport.
I was able to change the entire layout using this tool.
Comments