Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

The following action sequence uses the output from a SQL lookup rule (a Relational data source) as the input for an OpenFlashChartComponent which generates a bar chart.  See the Chart Reference for an explanation of the chart properties.

Code Block
xml
xml
titlesimple_chart.xactionxml
<?xml version="1.0" encoding="UTF-8"?>
<action-sequence>
  <name>Simple Bar Chart Example</name>
  <title>Simple Bar Chart Example</title>
  <version>1</version>
  <logging-level>DEBUG</logging-level>
  <documentation>
    <author>Jake Cornelius</author>
    <description>This demonstrates generating a simple bar chart types using the OpenFlashChartComponent in an action sequence</description>
    <icon/>
    <help/>
    <result-type/>
  </documentation>

  <inputs>
    <chart_width type="string">
      <sources>
        <request>chart_width</request>
      </sources>
      <default-value><![CDATA[650]]></default-value>
    </chart_width>
    <chart_height type="string">
      <sources>
        <request>chart_height</request>
      </sources>
      <default-value><![CDATA[400]]></default-value>
    </chart_height>
  </inputs>

  <outputs>
    <image-tag type="string"/>
  </outputs>

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

  <actions>
    <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><![CDATA[SampleData]]></jndi>
        <live><![CDATA[true]]></live>
        <query><![CDATA[SELECT PRODUCTS.PRODUCTLINE AS LINE,
            SUM(CASE ORDERFACT.YEAR_ID WHEN '2003' THEN (ORDERFACT.TOTALPRICE) ELSE 0 END) AS "2003",
            SUM(CASE ORDERFACT.YEAR_ID WHEN '2004' THEN (ORDERFACT.TOTALPRICE) ELSE 0 END) AS "2004",
            SUM(CASE ORDERFACT.YEAR_ID WHEN '2005' THEN (ORDERFACT.TOTALPRICE) ELSE 0 END) AS "2005"
          FROM
            PRODUCTS INNER JOIN ORDERFACT ON PRODUCTS.PRODUCTCODE = ORDERFACT.PRODUCTCODE
            INNER JOIN CUSTOMER_W_TER ON ORDERFACT.CUSTOMERNUMBER = CUSTOMER_W_TER.CUSTOMERNUMBER GROUP BY
            LINE
          ORDER BY
            2 DESC]]></query>
      </component-definition>
    </action-definition>

    <action-definition>
      <component-name>OpenFlashChartComponent</component-name>
      <action-type>Open Flash Chart</action-type>
      <action-inputs>
        <chart-data type="string" mapping="query_result"/>
        <width type="string" mapping="chart_width"/>
        <height type="string" mapping="chart_height"/>
      </action-inputs>
      <action-resources>
        <chart-attributes type="resource" mapping="bar"/>
      </action-resources>
      <action-outputs>
        <image-tag type="string"/>
      </action-outputs>
      <component-definition/>
    </action-definition>

  </actions>
</action-sequence>

...