Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: how to pass parameters to report

  1. #1
    Join Date
    Jan 2007
    Posts
    17

    Default how to pass parameters to report

    i want to pass two parameters to my report(fromdate and todate). in my xaction file fromdates are taken from the database and loaded into a listbox. the user has to select a value from the listbox. but now i want to change it.i want to use text box in place of list box. the user has to enter the value in textbox rather than selecting a value from listbox. how i can do it securefilter . here is the content of my xaction file. please help me if anybody knows it....

    <?xml version="1.0" encoding="UTF-8"?>

    <action-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <name>sales_product_based_second.xaction</name>
    <version>1</version>
    <title>sales_product_based_second</title>
    <documentation>
    <author>Report Design Wizard</author>
    <description>sales_product_based_second</description>
    <icon>PentahoReporting.png</icon>
    <help>This action-sequence was generated by the Report Design Wizard. To edit this action-sequence use the Pentaho Design Studio.</help>
    <result-type>report</result-type>
    </documentation>

    <inputs>
    <fromdate type="string">
    <sources>
    <request>fromdate</request>
    </sources>
    <default-value/>
    </fromdate>

    <todate type="string">
    <sources>
    <request>todate</request>
    </sources>
    <default-value/>
    </todate>


    </inputs>
    <outputs/>

    <resources>
    <!-- use this section to identify any files that the component needs to execute the report -->
    <report-definition>
    <solution-file>
    <location>sales_product_based_second.xml</location>
    <mime-type>text/xml</mime-type>
    </solution-file>
    </report-definition>
    </resources>
    <actions>



    <action-definition>
    <component-name>org.pentaho.component.SQLLookupRule</component-name>
    <action-type>SQL Query</action-type>
    <action-outputs>
    <query-result type="result-set" mapping="SicList"/>
    </action-outputs>
    <component-definition>
    <jndi>mis</jndi>
    <query><![CDATA[select to_char( from_date,'mm/dd/yy') from xtable]]></query>
    <live>true</live>
    </component-definition>
    </action-definition>


    <action-definition>
    <component-name>org.pentaho.component.SQLLookupRule</component-name>
    <action-type>SQL Query</action-type>
    <action-outputs>
    <query-result type="result-set" mapping="SicList1"/>
    </action-outputs>
    <component-definition>
    <jndi>mis</jndi>
    <query><![CDATA[select to_char(from_date,'mm/dd/yy') from xtable]]></query>
    <live>true</live>
    </component-definition>
    </action-definition>

    <action-definition>
    <component-name>org.pentaho.component.SecureFilterComponent</component-name>
    <action-type>Secure Filter</action-type>
    <action-inputs>
    <fromdate type="string"/>
    <todate type="string"/>
    <SicList type="result-set"/>
    <SicList1 type="result-set"/>
    </action-inputs>
    <component-definition>
    <selections>
    <fromdate optional="false" prompt-if-one-value="true">
    <filter>SicList</filter>
    <title> from date </title>
    </fromdate>

    <todate optional="false" >
    <filter>SicList1</filter>
    <title> to date </title>
    </todate>
    </selections>
    </component-definition>
    </action-definition>

    <action-definition>
    <action-outputs>
    <rule-result type="result-set"/>
    </action-outputs>
    <component-name>org.pentaho.component.SQLLookupRule</component-name>
    <action-type>SQL Query</action-type>
    <action-inputs>
    <fromdate type="string"/>
    </action-inputs>

    <component-definition>
    <jndi>mis</jndi>
    <query><![CDATA[ query part

    ]]></query>
    </component-definition>
    </action-definition>

    <action-definition>
    <component-name>org.pentaho.jfree.JFreeReportComponent</component-name>
    <action-type>report</action-type>
    <action-inputs>
    <data type="result-set" mapping="rule-result"/>
    <SicList type="string"/>
    <SicList1 type="string"/>
    </action-inputs>
    <action-resources>
    <report-definition type="resource"/>
    </action-resources>
    <action-outputs/>
    <component-definition>
    <output-type>xls</output-type>
    </component-definition>
    </action-definition>
    </actions>
    </action-sequence>
    Last edited by jerin; 02-22-2007 at 08:48 AM. Reason: updation

  2. #2
    Join Date
    Nov 1999
    Posts
    459

    Default

    You can check the entered time by an if statement (write it in JavaScript and the last line must return a boolean).

  3. #3
    Join Date
    Jan 2007
    Posts
    17

    Default

    thank you. can u just tell me how to call a javascript function that should come into action while pressing 'update' button after entering the inputs...

  4. #4
    Join Date
    Jan 2007
    Posts
    1

    Default ........pulao

    poooooooru.......
    sorry.....I don't think someone have that much time to read ur code...
    jerry

    plz put it in a simple ........

  5. #5
    Join Date
    Nov 1999
    Posts
    459

    Default

    Quote Originally Posted by jerin View Post
    thank you. can u just tell me how to call a javascript function that should come into action while pressing 'update' button after entering the inputs...
    Pentaho Design Studio: Simply add the process action "if statement" in your process.

    Good luck,
    Jens

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.