PDA

View Full Version : how to pass parameters to report



jerin
01-15-2007, 12:07 PM
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>

jbleuel
01-16-2007, 05:40 AM
You can check the entered time by an if statement (write it in JavaScript and the last line must return a boolean).

jerin
01-17-2007, 03:08 AM
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...

rknaidu
01-17-2007, 08:45 AM
poooooooru.......
sorry.....I don't think someone have that much time to read ur code...
jerry

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

jbleuel
01-18-2007, 06:27 AM
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