Hitachi Vantara Pentaho Community Forums
Results 1 to 10 of 10

Thread: modifyng report for automatic nightly runs

  1. #1

    Default modifyng report for automatic nightly runs

    I have a report relating to equipment usage that has a parameter for the date which defaults to =NOW()

    This all works great, except I'd like to schedule the report to run each night. Actually early morning, say 2AM so we have a full data set for the previous day.

    I understand how to configure the bi server to schedule and email reports, but here is my issue:

    I think that the date parameter is going to be static once I schedule the report - so today I schedule it and the report will run for April 13 every day. I could make the parameter hidden and default to =NOW(), but I need to be able to set that parameter for ad hoc reporting. So, I'm thinking I need another parameter that specifies if the report is being run once or scheduled, and run as it currently does if this is being run now, or ignore the date parameter input and set the value to something like =NOW() - 1day (not sure how that formula would look yet) if the report is being configured for the nightly schedule. How could I implement this?

    Thanks

  2. #2
    Join Date
    Nov 2011
    Posts
    3

    Default

    could you not save the current working version under a different name (i.e. 'dataReport'AdHoc), then implement your idea for running it =NOW() and save that to a similar name (i.e. 'dataReport'Current. then just run the current version every night and set your adhoc reporting link to the adhoc version?

  3. #3

    Default

    Yeah I could and that will be what I do if I can't find another solution before my deadline. I'd just prefer to not have to maintain the separate reports.

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

    Default

    I think if you define a boolean parameter named "subscribe", you should get a "true" or "false" value whether you are in subscribe-mode right now. You can make that parameter hidden, the bi-server will fill it in for you when it is defined. You can then base another hidden parameter on that "subscribe" parameter in the form of a formula:

    =IF([subscribe]; NOW(); [my-user-defined-parameter])

    http://wiki.pentaho.com/display/Repo...+Documentation
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  5. #5

    Default

    Thanks. Do you know of a way to hide a parameter depending on another parameter value? It looks to me like I want to use the renderMode parameter rather than subscribe -- if the renderMode is currently SUBSCRIBE I would like to hide the date parameter and set its value to a function that always returns the previous day. When not in SUBSCRIBE render mode the date parameter should be displayed to the user for a date to be chosen (the way it works now)

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

    Default

    Parameter cannot be hidden at the moment - we simply have not had the bandwidth to implement that sort of feature.

    So you would have to educate your users and then ignore the parameter via the hidden parameter trick.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  7. #7

    Default

    OK thanks. I created a parameter called renderMode and set it to type String and added it to my report to see the value, but nothing appears. Do you know what I'm doing wrong?

  8. #8

    Default

    So I just made another report with the date param hidden. Scheduled the report on 4/17 and it ran on the server at 1 am on 4/18. Value formula is set to =YESTERDAY(). The report ran for 4/16. So is it again just taking the value of the date parameter set when I scheduled the report and running it for that date? I need it to always be the day before the current date.

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

    Default

    There must be something else going on. Try to publish a report with just a hidden parameter with the formula =NOW() and just print that value in the report header. Now is a timestamp parameter, so you can actually see the seconds tick by - and the value printed should match the time of the schedule.

    If even that does not work, please file me a JIRA case with a sample report attached. No need for it to have any actual data, but please keep your parameters all defined as on your local system as we want to see what's needed to make parameters work correctly.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  10. #10

    Default

    I think I got it working. Not sure exactly how, and I don't have time to really research it at the moment but I changed a couple things
    1) formula from YESTERDAY() to DATEVALUE(NOW() - 1)
    2) placed formula in "Default Value Formula" AND "Post Processing Formula"

    One of those 2 things seems to have taken care of it.

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.