PDF Report

Hello,

Some questions:

1. I would like to know how I put the image of the graph I made(.JPG) into a PDF report?
2. How can I sample data every minute of the process and put them in the PDF report?

Thanks,
Tal
  • Hi Tal,

    The second question is easier, so let me start there. Typically in this situation you would create three Report worksheets, one for the header, one for the data, and one for the closer. On the one for the data, select the checkbox for Disk Append. This will insert into any existing report, rather than creating a new file.


    Now, to add the line every minute, create an event in a scheduler worksheet to run that report every minute. You can use the Clock event, but in this case I would recommend the Change event.


    PDF Reports are final, meaning that you can't edit them after they are generated. This is the reason for the "closer" report. The header and the data reports will be run using the "Disk:" operator, and then when you want to finalize it into a PDF, you would use the "PDF:" operator. Make sure you select the Disk Append there as well.

    You can still use the Data Report as your closer, but just make sure you switch the function being run from Report("Disk:ReportData.rep") to Report("PDF:ReportData.rep")


    Adding an image to a report is relatively easy, since you can paste an image directly into the RTF ReportWriter. However, it sounds as if you want the image to be dynamic. This is trickier. The usual way of inserting a dynamic image is to use the  functionality of HTML reports. The problem with this is that HTML code is not interpreted by PDF readers. So if you use HTML, you should only use the "Disk:" or "Prn:" operators.

    One solution I have seen before is creating a "report screen." Basically you create a screen that appears exactly as you wish your report to look. This way you can insert linked pictures, Grid objects, Trends, etc. Then you can set your default printer to any PDF writer and generate the report using the PrintWindow() function.

    I hope this points you in the right direction.