# Saving my report as a PDF with in the name : reportename + date hour now

**URL:** <https://forum.inductiveautomation.com/t/saving-my-report-as-a-pdf-with-in-the-name-reportename-date-hour-now/74367>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [May 31, 2023, 3:08pm UTC](https://forum.inductiveautomation.com/t/saving-my-report-as-a-pdf-with-in-the-name-reportename-date-hour-now/74367 "2023-05-31T15:08:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon\_Margat](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@Simon\_Margat](https://forum.inductiveautomation.com/u/Simon_Margat)\
**Post date:** [May 31, 2023, 3:08pm UTC](https://forum.inductiveautomation.com/t/saving-my-report-as-a-pdf-with-in-the-name-reportename-date-hour-now/74367/1 "2023-05-31T15:08:20Z")

</div>

Hi everybody,

I am actually want to add to my report PDF name, the date to be like "reportname\_20230531\_1107AM" (name\_date\_hour) if it's in an other format it's okay too !

I used a script on a TAG to trigger the function system.report.executeAndDistribute()

Actually this is my code :

if currentValue.value and system.tag.getTagValue("[Beadmill]rptType.value") == 0 :  
settings = {"path":"C:\Reports", "fileName" : "test" , "format":"pdf"}  
system.report.executeAndDistribute(path="SIP\_SEAL", project="BeadMill\_PVMC", action="save", actionSettings=settings)

and its working, by returning me my PDF file : "test"

i found on an other topic that if i change "fileName" by "filename" the name of the pdf file is "5-31-23 10AM"

I also tried this code but it doesnt work :  
timestamp = system.date.format(system.date.now(), "ddMMMyy\_HH:mm:ss")  
fileName = "Beadmill\_report\_PH\_Mill\_" + timestamp + ".pdf"  
settings = {"path":"C:\Reports", "fileName": fileName, "format":"pdf"}  
system.report.executeAndDistribute(path="PH\_Mill", project="BeadMill\_PVMC", action="save", actionSettings=settings)

It seem like in a script with "system.report.executeAndDistribute" you cant call a variable ..

Does anyone have an idea of how to do it ?

Thank you for your help 😃

---

<div class="post-metadata">

**Author:** ![kyler.kamyszek](https://avatars.discourse-cdn.com/v4/letter/k/a4c791/32.png) [@kyler.kamyszek](https://forum.inductiveautomation.com/u/kyler.kamyszek)\
**Post date:** [May 31, 2023, 3:18pm UTC](https://forum.inductiveautomation.com/t/saving-my-report-as-a-pdf-with-in-the-name-reportename-date-hour-now/74367/2 "2023-05-31T15:18:58Z")

</div>

Try removing the colons ':' from the date.format function.

`system.date.format(system.date.now(), "ddMMMyy_HHmmss")`

---

<div class="post-metadata">

**Author:** ![Simon\_Margat](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@Simon\_Margat](https://forum.inductiveautomation.com/u/Simon_Margat)\
**Post date:** [May 31, 2023, 3:38pm UTC](https://forum.inductiveautomation.com/t/saving-my-report-as-a-pdf-with-in-the-name-reportename-date-hour-now/74367/3 "2023-05-31T15:38:21Z")

</div>

Thank you Kyler ! It works 🙂

---

<div class="post-metadata">

**Author:** ![ryanr](https://avatars.discourse-cdn.com/v4/letter/r/e8c25b/32.png) [@ryanr](https://forum.inductiveautomation.com/u/ryanr)\
**Post date:** [July 21, 2025, 7:20pm UTC](https://forum.inductiveautomation.com/t/saving-my-report-as-a-pdf-with-in-the-name-reportename-date-hour-now/74367/4 "2025-07-21T19:20:11Z")

</div>

I am Attempting this same Task. However, Using Email. I have attempted my code using the same structure above and i have also attempted by Moving my File name to the action settings.  
Any Tips?

---

<div class="post-metadata">

**Author:** ![ryanr](https://avatars.discourse-cdn.com/v4/letter/r/e8c25b/32.png) [@ryanr](https://forum.inductiveautomation.com/u/ryanr)\
**Post date:** [July 21, 2025, 8:51pm UTC](https://forum.inductiveautomation.com/t/saving-my-report-as-a-pdf-with-in-the-name-reportename-date-hour-now/74367/5 "2025-07-21T20:51:38Z")

</div>

I got it, Changes "fileName" to "AttachmentName"
