Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Multiple Attachments

  1. #1
    Join Date
    Oct 2006
    Posts
    8

    Default Multiple Attachments

    I'm trying to attaching multiple reports to an attachment. This is all still very new to me and am very impressed with what we can do. I have searched through this form to see if I could find anything, but didn't see anything.

    First, I created another report using the ReportWizard. It works good and I can see if on the dashboard and execute it that way. Now I'm trying to take the BurstActionSequence and include this report in the sample. I've been unsuccessful and I'm sure it's due to my lack of knowledge (there is a LOT to learn).

    On the "Action Loop On burst-data" I added a jfreeReport (which contains my new report).

    Down in the "Email" I went into the XML tab and added my new report to the "Attachment" area like so:

    <action-definition>
    <component-name>EmailComponent</component-name>
    <action-type>Email</action-type>
    <action-inputs>
    <report-output type="content"/>
    <subject type="string"/>
    <message-html type="string"/>
    <to type="string" mapping="EMAIL"/>
    <attach-name type="string"/>
    </action-inputs>
    <component-definition>
    <attachment-ref name-param="attach-name" input-param="report-output"/>
    <attachment-ref name-param="attach-name" input-param="webbilling"/>
    </component-definition>
    </action-definition>


    However, I do notice when I go back to the define processes tab that the "webbilling" doesn't display.

    When I run the modified BurstSample I get an HTML form that wants three pieces of information:

    Select: output-type (in the box it has xls)
    Select: report-definition (in the box it has a hwole bunch of informaton, which looks like my report)
    Select: data (in the box it is empty)

    Obviously, I'm missing something. Any help would be appreciated.

  2. #2
    Join Date
    Nov 2005
    Posts
    29

    Default Re:Multiple Attachments

    To follow is an action sequence that emails two reports as attachments. If you save this xaction into the "bursting" directory of your pentaho demo you should be able to run it. However, you'll want to change the "To" email address. If you open the xaction in the design studio it's a bit easier to understand what's going on. You mentioned that you edited the XML source manually to add the attachments, keep in mind that in the Define Process tab of the Design Studio you can drag the report from the Process Actions tree into the emails attachments table and the XML will automatically be set up properly.

    <?xml version="1.0" encoding="UTF-8"?>
    <action-sequence>
    <title>Test Action</title>
    <version>1</version>
    <logging-level>ERROR</logging-level>
    <documentation>
    <author>Joe</author>
    <description>Empty blank action sequence document</description>
    <help/>
    <result-type/>
    <icon>BurstActionSequence.png</icon>
    </documentation>

    <inputs/>

    <outputs/>

    <resources>
    <report-definition>
    <solution-file>
    <location>JFreeQuadrantForRegion.xml</location>
    <mime-type>text/plain</mime-type>
    </solution-file>
    </report-definition>
    <report-definition1>
    <solution-file>
    <location>JFreeQuadrantForRegion.xml</location>
    <mime-type>text/plain</mime-type>
    </solution-file>
    </report-definition1>
    </resources>

    <actions>
    <action-definition>
    <component-name>SQLLookupRule</component-name>
    <action-type>Query For Central Data</action-type>
    <action-inputs/>
    <action-outputs>
    <query-result type="result-set" mapping="centralData"/>
    </action-outputs>
    <component-definition>
    <jndi>SampleData</jndi>
    <live>true</live>
    <query><![CDATA[select QUADRANT_ACTUALS.REGION, QUADRANT_ACTUALS.DEPARTMENT, QUADRANT_ACTUALS.POSITIONTITLE, QUADRANT_ACTUALS.ACTUAL, QUADRANT_ACTUALS.BUDGET, QUADRANT_ACTUALS.VARIANCE from QUADRANT_ACTUALS where QUADRANT_ACTUALS.REGION='Central' order by QUADRANT_ACTUALS.REGION, QUADRANT_ACTUALS.DEPARTMENT]]></query>
    </component-definition>
    </action-definition>

    <action-definition>
    <component-name>SQLLookupRule</component-name>
    <action-type>Query For Western Data</action-type>
    <action-inputs/>
    <action-outputs>
    <query-result type="result-set" mapping="westernData"/>
    </action-outputs>
    <component-definition>
    <jndi>SampleData</jndi>
    <live>true</live>
    <query><![CDATA[select QUADRANT_ACTUALS.REGION, QUADRANT_ACTUALS.DEPARTMENT, QUADRANT_ACTUALS.POSITIONTITLE, QUADRANT_ACTUALS.ACTUAL, QUADRANT_ACTUALS.BUDGET, QUADRANT_ACTUALS.VARIANCE from QUADRANT_ACTUALS where QUADRANT_ACTUALS.REGION='Western' order by QUADRANT_ACTUALS.REGION, QUADRANT_ACTUALS.DEPARTMENT]]></query>
    </component-definition>
    </action-definition>

    <action-definition>
    <component-name>JFreeReportComponent</component-name>
    <action-type>Build Central Report</action-type>
    <action-inputs>
    <data type="result-set" mapping="centralData"/>
    </action-inputs>
    <action-resources>
    <report-definition type="resource"/>
    </action-resources>
    <action-outputs>
    <report-output type="content" mapping="centralReport"/>
    </action-outputs>
    <component-definition>
    <output-type>xls</output-type>
    </component-definition>
    </action-definition>

    <action-definition>
    <component-name>JFreeReportComponent</component-name>
    <action-type>Build Western Report</action-type>
    <action-inputs>
    <data type="result-set" mapping="westernData"/>
    </action-inputs>
    <action-resources>
    <report-definition type="resource" mapping="report-definition1"/>
    </action-resources>
    <action-outputs>
    <report-output type="content" mapping="westernReport"/>
    </action-outputs>
    <component-definition>
    <output-type>xls</output-type>
    </component-definition>
    </action-definition>

    <action-definition>
    <component-name>EmailComponent</component-name>
    <action-type>E-Mail</action-type>
    <action-inputs>
    <centralReport type="content"/>
    <westernReport type="content"/>
    </action-inputs>
    <component-definition>
    <attachment-ref name-param="attach_name_1" input-param="centralReport"/>
    <attachment-ref name-param="attach_name_2" input-param="westernReport"/>
    <message-plain><![CDATA[Here are the central and western reports.]]></message-plain>
    <to>joe@pentaho.org</to>
    <subject>Central and Western Reports</subject>
    <attach_name_1>Central Report.xls</attach_name_1>
    <attach_name_2>Western Report.xls</attach_name_2>
    </component-definition>
    </action-definition>

    </actions>
    </action-sequence>

    Post edited by: arodriguez, at: 2006/10/25 12:22

  3. #3
    Join Date
    Oct 2006
    Posts
    8

    Default Re:Multiple Attachments

    What should I call the filename or does it not matter (mytest.xaction)?

  4. #4
    Join Date
    Nov 2005
    Posts
    29

    Default Re:Multiple Attachments

    Doesn't matter as long as it has a .xaction extension

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.