junioryy Posted May 22, 2007 Share Posted May 22, 2007 Hi all experts, is there possible to pass in an object as parameter to jasper?. Actually what i need is only display the xml data into jasper report instead of the whole XML included the tag<>. the xml is in string, so i convert it to object and hope can just display the xml data and not the whole xml. I have tried the following way but get an error ERROR: Caused by: java.lang.NoClassDefFoundError: net/sourceforge/barbecue/Barcode10:37:39,587 ERROR [sTDERR] at auditLog5_1179801424719_5174.evaluate(auditLog5_1179801424719_5174:306) my code is as below: String xmlLog = null; Object object = getAuditTrailDao().convertXMLStringToObject(xmlLog); parameters.put("XML_LOG", object); fyi, classType of XML_LOG is java.lang.object, and textfield expression is java.lang .string Any help would be highly appreciated!! Thanks in advance..Post edited by: junioryy, at: 2007/05/22 02:36 Link to comment Share on other sites More sharing options...
junioryy Posted May 22, 2007 Author Share Posted May 22, 2007 Post edited by: junioryy, at: 2007/05/22 02:37 Link to comment Share on other sites More sharing options...
andreas.daab Posted May 22, 2007 Share Posted May 22, 2007 Objects can be passed as parameters, e.g. I pass HashMap objects to reports and subreports. You have to change the class for the parameter to the right class, e.g. org.w3c.dom.Document. But I would not recommed to pass XML documents as parameter. Integrate them as datasource in your report. You can navigate to your XML elements and attributes via XPath expressions in your fields. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now