Reports: auto-generation,save and send

Hi,
My report currently generates data based on the date and time period the user selects. Is there any way to automate this process such that a report is generated daily? I also require each newly generated report to be saved and then e-mailed to selected users, is this possible?

Thanks in advance.

This is one of those “Yes, its possible, but awkward” things. We have plans for a 2.0 version of the Reporting module that will make this automatic scheduling / emailing / printing much easier, but in the meantime…

  1. Make sure you really need to do this. The data is always in the database, so instead of emailing a report every day, the users could just launch the app and bring up any day’s report.

  2. If you do need to do this, you’ll need to have a client running a special project whose purpose is to automate this process using scripting. Typically this is a project you’ve hidden from the launch page and is always running on the Gateway PC. The general technique goes like this:

2a. Have a timer script monitoring the condition that warrants a new report (new day, tag change, etc)
2b. Open the report window
2c. Wait for the report’s data to fill in
2d. Print the report
2e. Close the window.

This is something that is becoming more and more important at my plant as time goes by and my users/management see the capabilities that Ignition offers… It also doesn’t help that they were used to a competitors product that had this ability built in.

Right now, I have to keep a client window open in order for this to happen but this is a pain and is cumbersome… also, I’ve been asked for 4 or 5 other reports to be automatically printed out at shift change and don’t want to have to keep client windows open somewhere for this to happen. Asking them to manually print out the reports is not an option…

Do you have an example of a script that would do what you are suggesting?

Its only a matter of time before I need this also. any word on when reporting 2.0 will be out?

We are keenly aware of how awkward and widely requested this feature is. Reporting module v2 is top priority after vector drawing tools and template components come out, should be around the end of the year I’m guessing. [EDIT: this may be optimistic. Q1’12?]

I don’t have an example script handy, but I know I’ve helped quite a few people write them, let me see if I can dig something up…

Is this the time line for Reporting V2 or vector drawing tools?

That was for reporting v2. Vector drawing is nearly complete.

[quote=“Carl.Gould”]…

I don’t have an example script handy, but I know I’ve helped quite a few people write them, let me see if I can dig something up…[/quote]

Any luck finding something Carl?

if event.propertyName == "text": if event.newValue != event.oldValue: value = event.newValue lotlength = len(value) numlots = system.tag.getTagValue("[Client]Furn13_numlots") if lotlength > 5: for x in range(numlots): def reportPrint13(report = event.source.parent.getComponent("Report Viewer")): report.print(None, 0) def graphPrint13(chart = event.source.parent.getComponent("Easy Chart")): import system # Get the interior section of the chart innerChart = chart.getComponent(0) job = system.print.createPrintJob(innerChart) job.orientation = system.print.LANDSCAPE job.showPrintDialog = 0 job.print() system.util.invokeLater(reportPrint13, 10000) system.util.invokeLater(graphPrint13, 10000)

I have this set on a text field, when that text field changes this executes. I have both a report viewer report that gets printed and an easy chart. The invoke later bits are to provide a suitable delay to allow all the data to fill in.
Hope this helps :slight_smile:

Thanks Dravik!

Carl,
We are working on a similar thing, but instead of printing [to a printer], we want to print to a pdf automatically. We have everything to bring up the report, and press the Save pdf button…but what we can’t figure out is how to automatically press the Save button on the popup that asks to Save.
Our eventual goal is to have a report generated automatically, then emailed. Could you please post code that would automatically press the Save button on the popup?
Thanks!

I know it wouldn’t be handled within Ignition, but going 3rd party might be your best option right now. As long as you’re logging the data you want to a database, you could use something like SSRS or Jasper to handle automated reports and report delivery.

Off topic: Jasper reports looks like a worthy upgrade from ReportMill.

As a point of trivia - we originally wanted to go with Jasper Reports, but opted for Report Mill largely because of the GUI environment. I'm not sure if iReport existed then or is "compatible" with Ignition. The Ignition designer has come a long ways since then, perhaps it could work natively this time around. Carl or Colby are your best bets to check with.