I created a report that users will always be exporting to PDF. One requirement is having the selected data range printed on the PDF. From this post Show the current time filter on a report I know that I can show the parameter values by putting the parameter [vpInvoiceDt] in the label text property. However it displays in the form “>=08/01/2021 & <=08/04/2021” and I need a very specific format to display (ex: 01 Aug 2021 - 04 Aug 2021). I tried putting label1.labelText = {formatting date script} in the page events (Loading, Ready, Page Ready) but they all throw a “label1 is undefined error”. This script works with dashboards and on dashboard parameter value change events but doesn’t seem to work in reports and I don’t see a change event for the filter when working in a report.
Since I could not get this to work in a page event, I created a button and the click event does change the label correctly when viewing the report but when I go to Share | PDF, the updated label value does not appear in the PDF.
I also tried having the button export the PDF as well using the code from this sample:
https://www.dundas.com/support/developer/script-library/export/create-a-pdf-export
The PDF does get created but the original report page continues to have the spinner and “Working on It” message and eventually errors out with a timeout message, even though the PDF does get created correctly.
So, my questions are:
Is there a way to set a label to a filter value via script in a report that doesn’t have to be triggered by a button?
Is there a way once this label is set via script to make it so it shows up in the PDF export?
When using the Dundas provided script to have a button export a PDF, does anyone know why the screen shows the spinner and times out even though the PDF is created? (and the same exact PDF is created with the Share | PDF option with no timeout).
Thank you for any assistance you can give.
Kelly