alucard__ Posted February 14, 2008 Share Posted February 14, 2008 Hi all and.. sorry for my english :)I'm new to jasperreports.I am starting with a simple report like this __|C1_|C2_|..|CmR1|V11|V12|..|V1mR2|V21|V22|..|V2m................Rn|Vn1|Vn2|..|Vnm My datasource is a xml file <db> <element> <r></r> <c></c> <v></v> </element></db> I've created a new XML datasource("Use the report xPath expression to fill the report" radioButton selected) looking at this I used /db/element as primary queryI've also made a subdataset with /db/element[$P{POSITION}]POSITION is a java.lang.IntegerI pass $V{REPORT_COUNT} In this subdataset I've defined the r, c and v fields I've put a crosstab in summary (I've also tried to put it in detail)I've used the subdataset with the crosstab, setting r as row group, c as column group and v as detail (function: nothing).In the crosstab property windows, I've added the POSITION parameter. The report compiles without problems.When I try to fill the report (Build->Execute with active connection) the result is a empy page. I also tried to change the "Connection/Data Source Expression" to "Use a data Source" XML_DATA_DOCUMENT and passingthe xml file like in the xmldatasource example Map params = new HashMap();Document document = JRXmlUtils.parse(JRLoader.getLocationInputStream("db.xml"));params.put(JRXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT, document);...JasperFillManager.fillReportToFile(fileName, params); when i fill the report an exception is throwJRXPathQueryExecuterFactory org.w3c.dom.Document document is null?? What's wrong??Can you show me a simple example with xmldatasource and crosstab? Tnx in advance! Link to comment Share on other sites More sharing options...
chriswesdorp Posted March 10, 2008 Share Posted March 10, 2008 In case you are in still in need for an answer, have a look at my post describing a simular problem. The crosstab needs it's own seperate dataset/datasource which can be a copy/reference to the report datasource or a new dataset based on a subset of the reports dataset. You can use Java code in the expression tags. 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