Jump to content
We've recently updated our Privacy Statement, available here ×

alucard__

Members
  • Posts

    2
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Posts posted by alucard__

  1. Hi all!

     

    I have to do a school hours report like this

     

    __|D1______||D2______|...|Dn

    __|H1|H2|H3||H1|H2|H3|...|

    T1|C1|C1|C2||C3|C4|C4|...|

    T2|C4|C3|C1||C1|C1|C2|...|

    ...

    Tn|

     

    I wold like to use a .xml file like this to fill the report

     

    <db>

    <teacher>

    <id></id>

    <lastname></lastname>

    <firstname></firstname>

    </teacher>

    ...

    <class>

    <id></id>

    <year></year>

    <section></section>

    <studies></studies>

    </class>

    ...

    <teaching>

    <teacherid></teacherid>

    <classid></classid>

    <day></day>

    <hour></hour>

    </teaching>

    ...

    </db>

     

    the primary xPath query is /db/teaching teacherid, classid, day and hour fields are defined into the master report

     

    In the crosstab, teacherid field is the row group, day field is the first column group

    hour field is the second column group and classid field is the datail element.

     

    I would like to print teacher's firstname and lastname instead of teacherid and class's year, section and studies instead of classid but I can't use subreport into a crosstab.

     

    Is there a way to do this??

     

    Tnx in advance

  2. Hi all and.. sorry for my english :)

    I'm new to jasperreports.

    I am starting with a simple report like this

     

    __|C1_|C2_|..|Cm

    R1|V11|V12|..|V1m

    R2|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 query

    I've also made a subdataset with /db/element[$P{POSITION}]

    POSITION is a java.lang.Integer

    I 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 passing

    the 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 throw

    JRXPathQueryExecuterFactory org.w3c.dom.Document document is null??

     

    What's wrong??

    Can you show me a simple example with xmldatasource and crosstab?

     

    Tnx in advance!

×
×
  • Create New...