Hitachi Vantara Pentaho Community Forums

View Poll Results: How do you find this thread ?

Voters
7. You may not vote on this poll
  • Excellent

    3 42.86%
  • Good

    3 42.86%
  • Ok

    1 14.29%
Results 1 to 28 of 28

Thread: how to schedule prpt report for mail sending ?

  1. #1
    wvaibhav Guest

    Default how to schedule prpt report for mail sending ?

    Hi,

    Earlier in pentaho 3.0 we could schedule a report for mail sending using developer studio, but now in 3.5 we get a .prpt file which can't be opened using developer studio, what is the way out for mail sending and scheduling ?

    Can any body guide me ?

    Thanks
    Vaibhav

  2. #2
    Join Date
    May 2009
    Posts
    17

    Default

    yah im are also looking forward for the answer regarding this concern. I hope you could guide us on how we could schedule a report and send them through email.

  3. #3
    Join Date
    Dec 2005
    Posts
    531

    Default

    From what I understand you can not mail a prpt directly, in this cas you will have to use an Action Sequence, that executes the prpt with the new simple report component and then use the mail component to send the email. The Action Sequence can be scheduled as before.

    This JIRA case has some additional information since the feature was buggy: http://jira.pentaho.com/browse/BISERVER-3615

  4. #4
    Join Date
    Aug 2008
    Posts
    563

    Default

    Hi,
    I am trying to do the same now. I cannot find the "simple report component" in the design studio. I guess I have to use "Pentaho Report", or? (There is another one called "Pentaho Report (Legacy)")
    In my PRPT, can I leave everything as if I would publish it to the web, meaning that I should have set up the parameters in the PRPT as well and not only reference them within the query of the report?
    I have finished two steps so far:
    - Javascript input
    - Pentaho Report
    I just tested if I could output my report online and I get the error "Error: RuntimeContext.ERROR_0021 - Invalid output parameter "outputstream" requested during execution of cross_tab_active_users_daily_sendout.xaction (org.pentaho.platform.engine.services.runtime.RuntimeContext)"

    What did I do wrong?
    Thanks,
    Diddy


  5. #5
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    Yes, Pentaho-Report is the one for handling PRPT files, and "Pentaho Report (Legacy)" is what was known as JFreeReportComponent (to handle the 3.0-style reports).

    When you're inside an XAction, you have to add parameter-prompting the XAction-way (ie via secure-filter-component) and for passing values from the XAction system to the report, the Pentaho-Report component has to have action-inputs for all the parameters the report expects. (This is due to the fact that the XAction-Runtime does not allow the reporting-component to see data that is not explicitly declared as input.)
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  6. #6
    Join Date
    Apr 2008
    Posts
    123

    Default

    So my confusion is in the fact that instead of calling an xaction to generate the report, now biserver is calling a prpt and that cannot be edited in design studio to add a simple email action. Creating xactions from scratch is not something I am well versed in and am hoping that at the very least you can create an xaction to work with from the Report Writer, but I do not see the way to do this either..............

  7. #7
    Join Date
    Aug 2008
    Posts
    563

    Default

    Thanks for your reply! I don't really want to use a prompt/secure filter, because my aim is to send out an email. Basically, in my xaction I have a JavaScript that gives me the current date (variable called my_date), this date I want to pass on to the report.
    I also defined "my_date" now as input (request).
    In Pentaho Report I pass "my_date" as a parameter. my_date has the same format as in the prpt, which is currently String.
    But I get still the same error

    @ "roco": Yes, you don't need xactions now to call a report on the BI Server. I am sure there is a way to send the prpt output as an email, but I first have to figure out how to use prpt within an xaction properly and then I have a look at sending it as an email.

    Best regards,
    Diddy

  8. #8
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    Well, to put it straight:

    The PRPT mode is a extra simplification to allow you to have parametrized reports without having to write a XAction. It therefore simplifies the most common reporting case and improves the maintenance costs of the major part of any real-world reporting solution.

    For Bursting, you still have to use XActions exactly as you had to do in the previous versions. So we did not make it more complicated, we just left it in exactly the state as it was before.

    The JIRA case that has been posted earlier in this thread has XActions attached that should have been able to send you up and running already.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  9. #9
    Join Date
    Apr 2008
    Posts
    123

    Default

    i am looking forward to hearing how to do this, as the responses I have got from my original post have all given me the same Email Component errors you are getting diddy.

  10. #10
    Join Date
    Apr 2008
    Posts
    123

    Default

    Quote Originally Posted by Taqua View Post
    Well, to put it straight:

    The PRPT mode is a extra simplification to allow you to have parametrized reports without having to write a XAction. It therefore simplifies the most common reporting case and improves the maintenance costs of the major part of any real-world reporting solution.

    For Bursting, you still have to use XActions exactly as you had to do in the previous versions. So we did not make it more complicated, we just left it in exactly the state as it was before.

    The JIRA case that has been posted earlier in this thread has XActions attached that should have been able to send you up and running already.


    Which xaction in that jira bug has the correct format for attaching a report to an email. There are three of them?

  11. #11
    Join Date
    Oct 2005
    Posts
    94

    Default

    Below is a sample .xaction found in /bi-developers/reporting/unified-file-format/email_incomestatement_external.xaction

    This should help.

    Also, you will need to create a new output destination called "contentrepo" in Design Studio... preferences... action sequence editor... (see attached image)

    <?xml version="1.0" encoding="UTF-8"?>
    <action-sequence>
    <title>E-mail Income Statement</title>
    <version>1</version>
    <logging-level>ERROR</logging-level>
    <documentation>
    <author>Kurtis Cruzada</author>
    <description>Test send email.</description>
    <help/>
    <result-type>report</result-type>
    <icon>JFree-quadrant-budget-hsql.png</icon>
    </documentation>

    <inputs>
    <outputType type="string">
    <default-value><![CDATA[application/pdf]]></default-value>
    <sources>
    <request>outputType</request>
    </sources>
    </outputType>
    <outputTypeList type="property-map-list">
    <sources>
    <runtime>outputTypeList</runtime>
    </sources>
    <default-value type="property-map-list">
    <property-map>
    <entry key="report-output-desc">PDF</entry>
    <entry key="report-output-type-id">application/pdf</entry>
    </property-map>
    <property-map>
    <entry key="report-output-desc">Excel</entry>
    <entry key="report-output-type-id">application/vnd.ms-excel</entry>
    </property-map>
    </default-value>
    </outputTypeList>
    <sendto type="string">
    <sources>
    <request>sendto</request>
    </sources>
    <default-value><![CDATA[joe@pentaho.com]]></default-value>
    </sendto>
    </inputs>

    <outputs>
    <reportOutput type="content">
    <destinations>
    <contentrepo>reportOutput</contentrepo>
    </destinations>
    </reportOutput>
    </outputs>

    <resources>
    <report-definition>
    <solution-file>
    <location>incomestatement_external.prpt</location>
    <mime-type>application/zip</mime-type>
    </solution-file>
    </report-definition>
    </resources>

    <actions>
    <action-definition>
    <component-name>SecureFilterComponent</component-name>
    <action-type>Prompt for Report Format</action-type>
    <action-inputs>
    <outputTypeList type="property-map-list"/>
    <outputType type="string"/>
    <sendto type="string"/>
    </action-inputs>
    <component-definition>
    <selections>
    <outputType style="radio">
    <title>Select Report Format</title>
    <filter value-col-name="report-output-type-id" display-col-name="report-output-desc">outputTypeList</filter>
    </outputType>
    <sendto filter="none" style="text-box">
    <title>Email To</title>
    </sendto>
    </selections>
    </component-definition>
    </action-definition>

    <action-definition>
    <component-name>SQLLookupRule</component-name>
    <action-type>SQL Query For Report Data</action-type>
    <action-outputs>
    <query-result type="result-set" mapping="queryData"/>
    </action-outputs>
    <component-definition>
    <jndi>SampleData</jndi>
    <live>true</live>
    <query><![CDATA[SELECT * FROM TRIAL_BALANCE]]></query>
    </component-definition>
    </action-definition>

    <action-definition>
    <component-name>SimpleReportingComponent</component-name>
    <action-type>Pentaho Report</action-type>
    <action-inputs>
    <queryData type="result-set"/>
    <outputType type="string"/>
    </action-inputs>
    <action-resources>
    <report-definition type="resource"/>
    </action-resources>
    <action-outputs>
    <outputstream type="content" mapping="reportOutput"/>
    </action-outputs>
    <component-definition>
    <useContentRepository><![CDATA[true]]></useContentRepository>
    </component-definition>
    </action-definition>

    <actions>
    <condition><![CDATA[outputType=="application/pdf"
    ]]></condition>
    <action-definition>
    <component-name>EmailComponent</component-name>
    <action-type>E-Mail PDF</action-type>
    <action-inputs>
    <to type="string" mapping="sendto"/>
    <reportOutput type="content"/>
    </action-inputs>
    <component-definition>
    <message-plain><![CDATA[Please see the report attached.]]></message-plain>
    <attachment-ref name-param="attach_name_1" input-param="reportOutput"/>
    <attach_name_1><![CDATA[incomestatement.pdf]]></attach_name_1>
    <subject><![CDATA[Income Statement PDF]]></subject>
    </component-definition>
    </action-definition>

    </actions>

    <actions>
    <condition><![CDATA[outputType=="application/vnd.ms-excel"]]></condition>
    <action-definition>
    <component-name>EmailComponent</component-name>
    <action-type>E-Mail XLS</action-type>
    <action-inputs>
    <to type="string" mapping="sendto"/>
    <reportOutput type="content"/>
    </action-inputs>
    <component-definition>
    <subject><![CDATA[Income Statement XLS]]></subject>
    <message-plain><![CDATA[Please see attached excel file.]]></message-plain>
    <attachment-ref name-param="attach_name_1" input-param="reportOutput"/>
    <attach_name_1><![CDATA[incomestatement.xls]]></attach_name_1>
    </component-definition>
    </action-definition>

    </actions>

    </actions>
    </action-sequence>
    Attached Images Attached Images  

  12. #12

    Default

    Hi folks,

    I'm trying to create the suitable elements to schedule a pdf report.

    I've created an xaction similar to Kurtis one. But by now I'm getting error:

    Code:
    [es_161] Error: RuntimeContext.ERROR_0021 - [es_9] Invalid output parameter outputstream requested during execution of email_stats5.xaction (org.pentaho.platform.engine.services.runtime.RuntimeContext)[es_116] Debug: [es_21] Starting execute of adstatsv1//email_stats5.xaction (org.pentaho.platform.engine.services.solution.SolutionEngine)
    [es_116] Debug: [es_30] Getting runtime context and data (org.pentaho.platform.engine.services.solution.SolutionEngine)
    [es_116] Debug: [es_33] Loading action sequence definition file (org.pentaho.platform.engine.services.solution.SolutionEngine)
    [es_116] Debug: [es_34] audit: instanceId=1cf4807b-bd5c-11de-9c79-4d7fb28574fd, objectId=org.pentaho.platform.engine.services.runtime.RuntimeContext, messageType=action_sequence_start (org.pentaho.platform.engine.services.runtime.RuntimeContext)
    [es_161] Error: RuntimeContext.ERROR_0021 - [es_9] Invalid output parameter outputstream requested during execution of email_stats5.xaction (org.pentaho.platform.engine.services.runtime.RuntimeContext)
    [es_161] Error: Base.ERROR_0002 - Ejecución fallida del Componente (org.pentaho.platform.engine.services.solution.PojoComponent)
    [es_161] Error: RuntimeContext.ERROR_0012 - [es_33] ActionDefinition for SimpleReportingComponent did not execute successfully (org.pentaho.platform.engine.services.runtime.RuntimeContext)
    [es_161] Error: SolutionEngine.ERROR_0007 - [es_27] Action sequence execution failed (org.pentaho.platform.engine.services.solution.SolutionEngine)
    
      Server Version: Pentaho Platform Engine Core 3.5.0.RC2.39259
    Here is my xaction:
    http://pastebin.com/m369daf27

    I bet my problem is about the report parameter configuration, named 'lagencia'.

    Taking the example from Bi-developers folder I'm pretty sure the parameter must be 'external', but at PRD 3.5 I can't make that setting. I always get the message "A query must be selected", but, how can it be done? I want the parameter to be sent from the xaction.
    Otherwise maybe I'm copletely wrong or I'm not working on the proper approach.

    I'm not posting the email config files, but basically I'm renamed and set the gmail (the one I'll use) config file and deleted the other.

    Any help would be welcome

  13. #13
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    You are using RC2. In RC2 there was a error in the Pojo-Component handling related to Outputstreams. Upgrade to GA and your error may go away. (After all, why stick with a known-to-be-buggy version when a better release of the same codeline is out?)
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  14. #14

    Default

    Thanks for the quick reply.

    When you say GA you mean this?
    http://sourceforge.net/projects/pent...e.zip/download

    Excuse me but despite it might be quite easy to find the acronym meaning, i haven't found it.

    I'm running PRD 3.5.0-RC2.10067, should I upgrade this too to ..?
    http://sourceforge.net/projects/pent...e.zip/download

    Thanks in advance

  15. #15
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    Yes, and Yes. GA and stable is the same - GA is more business speech (and that was how Pentaho named its releases until .. well ... now.)
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  16. #16

    Default

    Hi,

    I edited the message coz I've learned somet things and now I think I've found the problem.
    It's more about the PRD3.5GA, which basically does not allow you to get external parameters. I've posted a new one on same thread.
    Last edited by hberges; 10-21-2009 at 03:30 PM. Reason: New Beginning

  17. #17
    dmoran Guest

    Default

    Yes - that is the correct one. Instead of using the term GA "General Availability" for the open source stuff, we have gone to stable - it's more descriptive, less cryptic and since open source software is always generally available, more accurate. But - old habits die hard.

    Doug

  18. #18

    Question

    Quote Originally Posted by dmoran View Post
    Yes - that is the correct one. Instead of using the term GA "General Availability" for the open source stuff, we have gone to stable - it's more descriptive, less cryptic and since open source software is always generally available, more accurate. But - old habits die hard.

    Doug
    Yeah Doug, after having been looking for that acronym meaning all over the pentaho forum I finally found it out by doing a quite simple search on google, that's life

    Now you are over here, and you are obviously an experienced guy, do you have a clue about the thread issue?
    I've noticed at least 2 other people which have the same problem as me, but not a lot of people knows how to do it right. In moreless 2 hours the thread/post has got like 50 views, but only your answer, which in fact is a comment over an overcome problem. If you could take a look at it it would be great!

    Thanks in advance

  19. #19

    Question New Beginning

    Hi again,

    After having worked with possible solutions to my problem I've decided to post it, maybe someone has the answer I need.

    I'll write down an example: suppose you have a huge cube with all the info, and you have a dimension called 'client'.
    And you want to send your clients the info from the cube WHERE client=idclient (I made it on MDX in fact).
    So you may create an xaction which, for example, could fetch the idclient's and loop the report creator and sender, passing a parameter which will be the current idClient. So all the idClients affected by the query will receive their reports. (I'm pretty sure it can be done). In a future the idea would to schedule that xaction...

    But none of this can be made by now on PRD3.5 coz when you create that external parameter you have to choose a query (if u put the param name, as somebody said, there happens what is shown at the attached picture, whether the type is TableModel or not) and you can NOT 'save' that parameter, so bye bye parameter.
    To avoid this problem I tried to copy/paste parameters from sample reports to mine, but no success.
    The last thing I've tried is editing manually the .prpt in order to force the report to have the suitable parameter, no success again. It throws parse errors.

    Picture:



    I don't really know what else I can do.
    Last edited by hberges; 10-22-2009 at 05:12 AM. Reason: typo

  20. #20
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    The query you select should be a query that returns the possible values for your prompt. It is very hard to show values for a drop-down selector, if you do not tell us where the values shall come from.

    So create a query that returns two columns, the client-id and a more user-friendly client-name. For example (Using SQL, but the same is possible with MDX too, by creating a banded-mdx datasource with query that has the various clients on the y-axis):

    SELECT DISTINCT Clients.ID, Clients.NAME FROM Cients

    And then give ID and NAME column as Value and Display-Name fields for the parameter.


    If you do not want to provide a query because you want your users to enter the ID freely, then use a text parameter.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  21. #21
    Join Date
    Apr 2007
    Posts
    2,010

    Default

    Ok, how are you supposed to email the content, AND send it back to the browser?

    Copying the example from kurtis above, you can email, but when you do that contentrepo stuff, you just get this back in the browser

    Action Successfulcontent=content, /content//6dae9399-bee1-11de-962d-c5e9ef2ba08e, application/pdf


    and this error:

    2009-10-22 08:03:53,772 WARN [org.pentaho.platform.engine.services.runtime.RuntimeContext] 6dae9399-bee1-11de-962d-c5e9ef2ba08e:RUNTIME:context-2108863468-1256198628477:COM-Rep-009.xaction Scope contentrepo is not recognized for parameter content.
    2009-10-22 08:03:53,772 WARN [org.pentaho.platform.engine.services.runtime.RuntimeContext] 6dae9399-bee1-11de-962d-c5e9ef2ba08e:RUNTIME:context-2108863468-1256198628477:COM-Rep-009.xaction Scope contentrepo is not recognized for parameter content.

  22. #22

    Default

    The query you select should be a query that returns the possible values for your prompt. It is very hard to show values for a drop-down selector, if you do not tell us where the values shall come from.
    The fact is that I do not really want to prompt anything. I want to pass the parameter from the xaction, so when I execute that file, automatically pass the proper string parameter, which should be the result from a query, but I guess that query should come from the xaction: that's the only approach I could follow taking in account my ultimate goal is to schedule that xaction, so I can schedule the email sending.

    If you do not want to provide a query because you want your users to enter the ID freely, then use a text parameter.
    Same as before. I don't really to enter nothing, I want to automate that job.

    - So, anyone know which approach should I follow?

    - Is it true that the parameters (as understood at PRD3.5) can only apply to a kind of "choose one from below" way? So I cannot set an external parameter whose depends on a previous xaction query execution..?

    Thanx for answering

    Edit: I attach the xaction I'd use in case I could set external parameters to PRD3.5.
    Attached Files Attached Files
    Last edited by hberges; 10-22-2009 at 05:15 AM.

  23. #23
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    @Codek: This is a question that should be asked in the BI-Server forum, as it is deep inside the guts of the XAction-processor.

    @hberges: If you do not want the reporting engine to do the prompting, then dont define your parameter as drop-down. Stick with the text-field parameter-type that requires no query. Then define your Secure-Filter-Component as usual and declare the xaction-inputs for the Simple-reporting component that match your parameters so that the XAction-processor knows that there are parameter-values expected by the reporting-component.

    A XAction for scheduled runs is no different from an XAction that is executed in interactive mode. The only difference is that the parameters are filled in at schedule time instead of being provided by the user at runtime.

    Is it true that the parameters (as understood at PRD3.5) can only apply to a kind of "choose one from below" way? So I cannot set an external parameter whose depends on a previous xaction query execution..?
    No. Use a text-parameter. If you tell the engine (via the parameter-editor) that you want a parameter type that is driven by a datasource, then you get a parameter that is driven by a datasource. The "Text Box" type is what you seek.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  24. #24
    Join Date
    Oct 2005
    Posts
    94

    Default

    See the following post for Burst examples.

    http://forums.pentaho.org/showpost.p...3&postcount=27

  25. #25
    wvaibhav Guest

    Default PRPT Mail sending instructions

    Hi,

    Thanks to all for support, now let us have a very quick instructions for mail sending for prpt in BI 3.5.
    • publish your prpt report on the server
    • copy and paste existing pentaho-solutions\bi-developers\reporting\unified-file-format\email_incomestatement_external.xaction file to your folder and open it in Pentaho Studio
    • Change following in input category
      • inputs --> sendTo --> to your mail ID,
      • resources --> report-definition --> brows to your prpt
    • Change following in process action category
      • SQL Query For Report Data --> copy and paste your query from PRD
    • Keep rest of the things as it is, save, refresh the solution repository and execute your xaction and check your mail, you should receive the mail with an attachment.
    • If mail delivery fails, check the smtp settings.
    • If you want to customize, then you can dig it more to have your look and feel.
    Wants more details, just study the existing .xaction file

    Thanks
    Vaibhav Kumar

    Sorry these are out of the way instructions for getting job done quickly.

  26. #26
    wvaibhav Guest

    Default scheduling email bursting

    Hi

    Anybody had a success in scheduled email bursting in BIserver CE ? Please let me know the procedure/way 2 do it.

    Thanks
    vaibhav kumar

  27. #27
    wvaibhav Guest

    Default scheduling email-bursting

    Hi All,

    Following is the procedure in order to do scheduled mail bursting in BI Server.

    • Publish a report from PRD on BI Server
    • Create a action sequence which sends out mail with attachment as pdf
    • Create a schedule from Pentaho Admin for mail bursting at specific interval
    • From BI Server associate created schedule to respective action sequence to send mail
    • Save the schedule and monitor for mail bursting

    Hope it helps

    Vaibhav Kumar



  28. #28

    Default

    2nd step... How to create that action sequence??
    Do u have any example for that??

    --Vishwesh


    Quote Originally Posted by wvaibhav View Post
    Hi All,

    Following is the procedure in order to do scheduled mail bursting in BI Server.

    • Publish a report from PRD on BI Server
    • Create a action sequence which sends out mail with attachment as pdf
    • Create a schedule from Pentaho Admin for mail bursting at specific interval
    • From BI Server associate created schedule to respective action sequence to send mail
    • Save the schedule and monitor for mail bursting

    Hope it helps

    Vaibhav Kumar



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.