KB-26877: Adding date/time to a report’s name.

Question:

How can I add date and time to a report’s name, so that every time a report is loaded and exported, a new PDF file is generated with a different title, thus not overwriting the previous PDF file?

Solution:

To do so, it is possible to go to E3Studio and do the following:

  1. Create a demo tag called CurrentTime and set it up as 3-CurrentTime;
  2. Create a button on screen, and then add the following script at Click event to export the report:

Set Report = Application.LoadReport(“[Report1]”)
time = FormatDateTime(Application.GetObject(“Data.CurrentTime”), 0)
time = Replace(time, “/”, “-“)
time = Replace(time, ” “, “_”)
time = Replace(time, “:”, “-“)
str = “C:\Report_” & time & “.pdf”
Report.Export “PDF”, str

The result, once the script has been executed and the report has been exported, will look like this: “C:\Report_19-12-2008_11-13-30.pdf”.
Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *