Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Sending result set to an xaction ...

  1. #1
    Join Date
    Aug 2006
    Posts
    10

    Default Sending result set to an xaction ...

    We're developing a Web program with Oracle database and we're looking for a way to pass at least 100 results to an xaction in order to display a jasper report.
    So what we want to do is write the SQL query in our application (with a home made query builder) and then send the result set to an xaction that will use Jasper reports to format the result in various file types (pdf, csv etc etc)
    We can't write sql queries in Jasper reports.
    Do you have any solution to this kind of problem ?

  2. #2
    Join Date
    Nov 1999
    Posts
    579

    Default Re:Sending result set to an xaction ...

    Have you looked at our demo application? In the test solution is several examples of running a query within the platform, and having Jasper Reports execute results based on that query.

    Unless I'm missing something, this is already built-in and ready to go.

    Take care,

    Marc

  3. #3
    Join Date
    Nov 1999
    Posts
    579

    Default Re:Sending result set to an xaction ...

    Let me clarify/correct my answer from above.

    In the platform, you can pass queries as inputs to an action sequence (xaction). The JasperReportsComponent will use the connection information supplied in the action sequence (or passed in as a parameter) to get the connection and query gets passed into Jasper Reports.

    If you're saying that you need to pass in a resultset (that is, passing in the query to use is insufficient), then the JasperReportComponent currently doesn't support that. Relatively simple changes to that component would allow that functionality.

    Sorry for misreading the question.

  4. #4
    Join Date
    Aug 2006
    Posts
    10

    Default Re:Sending result set to an xaction ...

    Thx for your answer.

    I'm trying your first solution. My query is provided by an oracle procedure in XML format.

    I already saw your sample "XQ_Datasource.xaction". I used the "Xquery" action to recover my query from the oracle procedure.

    But I don't know how to pass the query as a parameter to my Jasperreport.

    Is there a way to transform the "Xquery" result to a parameter for jasperreport ?

    My xml content :
    <?xml version="1.0" encoding="windows-1252" standalone="yes"?>
    <query>
    <value>
    SELECT TO_CHAR(SYSDATE,'DD fmMONTH YYYY') cur_date FROM dual
    </value>
    </query>
    My xaction content :
    <?xml version="1.0" encoding="UTF-8"?>
    <action-sequence>
    <inputs/>

    <outputs>
    <rule-result>
    <type>list</type>
    </rule-result>
    </outputs>

    <resources>
    <document>
    <url>
    <location>http://127.0.0.1/acti/pck_gestion.testxml</location>
    <mime-type>text/xml</mime-type>
    </url>
    </document>
    </resources>

    <actions>
    <action-definition>
    <component-name>XQueryLookupRule</component-name>
    <action-type>XQuery</action-type>
    <action-resources>
    <document type="resource"/>
    </action-resources>
    <action-outputs>
    <rule-result type="list"/>
    </action-outputs>
    <component-definition>
    <query><![CDATA[/query/value]]></query>
    </component-definition>
    </action-definition>

    <action-definition>
    <component-name>JasperReportsComponent</component-name>
    <action-type>Jasper Report</action-type>
    <component-definition>
    <output-type>html</output-type>
    </component-definition>
    </action-definition>

    </actions>
    </action-sequence>

  5. #5
    jdixon Guest

    Default Re:Sending result set to an xaction ...

    I think you will find it easier to do this using JFreeReport as you can pass the query, or the data to the JFreeReportComponent. This is not possible with the JasperReportComponent.

    James

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.