Hello
I am new to Pentaho, so there's a lot of things i don't understand.
I'm trying to use a where clause to make a openflash bar chart, but the resulset is always empty (and this is not true)
Can openflashchartcomponent acept parameters in a where clause like this?
if i remove the quotes form "{PREPARE: DEPARTMENT}"... i get an error, and if i don't remove it i get an empty result set.Code:SELECT Tienda, Meta, TotalVenta FROM ventas.v_basic where Tienda = "{PREPARE:DEPARTMENT}" Limit 5
Can any one help me please?
here is the full xaction file:
Code:<?xml version="1.0" encoding="UTF-8"?> <action-sequence> <name>JFreeReport_Chart_ChartTypes.xaction</name> <title>%title</title> <version>1</version> <logging-level>DEBUG</logging-level> <documentation> <author>Gretchen Moran / Nicholas Goodman / Jake Cornelius</author> <description>%description</description> <icon>BarChart.png</icon> <help>Help</help> <result-type>\</result-type> </documentation> <inputs> <chart_type type="string"> <default-value><![CDATA[bar]]></default-value> <sources> <request>chart_type</request> </sources> </chart_type> <DEPARTMENT type="string"> <default-value/> <sources> <request>DEPARTMENT</request> </sources> </DEPARTMENT> <chart_type_FILTER type="property-map-list"> <default-value type="property-map-list"> <property-map> <entry key="Display">Bar 3D</entry> <entry key="chart_type">barchart_3d</entry> </property-map> <property-map> <entry key="Display">Bar Glass</entry> <entry key="chart_type">barchart_glass</entry> </property-map> </default-value> </chart_type_FILTER> <chart_width type="string"> <sources> <request>chart_width</request> </sources> <default-value><![CDATA[100%]]></default-value> </chart_width> <chart_height type="string"> <sources> <request>chart_height</request> </sources> <default-value><![CDATA[100%]]></default-value> </chart_height> </inputs> <outputs> <html_fragment type="string"> <destinations> <response>content</response> </destinations> </html_fragment> </outputs> <resources> <!-- use this section to identify any files that the component needs to execute the report --> <pageTemplate> <solution-file> <location>flash_parameter_template.html</location> <mime-type>text/plain</mime-type> </solution-file> </pageTemplate> <barchart_3d> <solution-file> <location>flash_barchart_3d.xml</location> <mime-type>text/xml</mime-type> </solution-file> </barchart_3d> <barchart_glass> <solution-file> <location>flash_barchart_glass.xml</location> <mime-type>text/xml</mime-type> </solution-file> </barchart_glass> </resources> <actions> <action-definition> <component-name>SecureFilterComponent</component-name> <action-type>Select the Chart Type</action-type> <action-inputs> <DEPARTMENT type="string"/> <chart_type type="string"/> <chart_type_FILTER type="property-map-list"/> </action-inputs> <action-resources> <pageTemplate type="resource"/> </action-resources> <action-outputs/> <component-definition> <handle-all-prompts>true</handle-all-prompts> <selections> <!-- for now ignore the column names --> <DEPARTMENT style="text-box"> <title>Select a DEPARTMENT</title> <filter>DEPARTMENT_VALUES</filter> </DEPARTMENT> <chart_type style="select"> <filter value-col-name="chart_type" display-col-name="Display">chart_type_FILTER</filter> <title>Select the Chart Type</title> </chart_type> </selections> <xsl><![CDATA[pageTemplate]]></xsl> </component-definition> </action-definition> <action-definition> <component-name>SQLLookupRule</component-name> <action-type>Chart Data Query</action-type> <action-outputs> <query-result type="result-set" mapping="query_result"/> </action-outputs> <component-definition> <jndi>ventas</jndi> <!-- *******************--> <!-- where clause does not work --> <!-- *******************--> <query><![CDATA[SELECT Tienda, Meta, TotalVenta FROM ventas.v_basic where Tienda = "{PREPARE:DEPARTMENT}" Limit 5]]></query> <live>true</live> </component-definition> </action-definition> <actions> <condition><![CDATA[chart_type == 'barchart_3d']]></condition> <action-definition> <component-name>OpenFlashChartComponent</component-name> <action-type>Open Flash Chart</action-type> <action-inputs> <chart-data type="string" mapping="query_result"/> <height type="string" mapping="chart_height"/> <width type="string" mapping="chart_width"/> </action-inputs> <action-resources> <chart-attributes type="resource" mapping="barchart_3d"/> </action-resources> <action-outputs> <html_fragment type="string"/> <content_url type="string"/> </action-outputs> <component-definition/> </action-definition> </actions> <actions> <condition><![CDATA[chart_type == 'barchart_glass']]></condition> <action-definition> <component-name>OpenFlashChartComponent</component-name> <action-type>Open Flash Chart</action-type> <action-inputs> <chart-data type="string" mapping="query_result"/> <height type="string" mapping="chart_height"/> <width type="string" mapping="chart_width"/> </action-inputs> <action-resources> <chart-attributes type="resource" mapping="barchart_glass"/> </action-resources> <action-outputs> <html_fragment type="string"/> <content_url type="string"/> </action-outputs> <component-definition/> </action-definition> </actions> </actions> </action-sequence>


Reply With Quote
