DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing the "title" of each PDF export automatically

Solved!
Go to solution

Hey guys!

 

I've received a lot of help directly and indirectly from this forum, so I just want to say thank you first!

 

The question I have is this,

When exporting my results shown in the REPORT panel, can I automatically create a title according to my inputs?

Wording is very confusing, so I'll attach some images to maybe help you understand what I mean.

 

1. Please take a look at the R1, R2 image. Whatever values I input here, I want them to be the title of the exported PDF file.

For this case, something like "0.2-0.8" as the title of the PDF file.

 

 

ChnEventList1 = ChnEventDetectionWindow( , "[1]/vA_Acc_unit", R1, R2, 0, 0)
Call ChnEventCreateStatusChn("[1]/vA_Acc_Sec", ChnEventList1, "[1]/vA_Acc_unit", 0, 1)
Call Report.Sheets.ExportToPDF("C:\Users\tiyang\Desktop\My Files\00. Start Presentation\DIAdem\9. Save here\@@R1@@,@@R2@@", True)

I've tried this code hoping the R1 and R2 would show up as my input, but the result I got is in the "result,png" image

 

Also, for an extension, I would like to do something like & "@@CurrDate@@" & "@@CurrTime"@@ after the R1 and R2 values in the title of the PDF file. Is this possible?

 

Thank you all that helped me before, and thanks to all who are about to help me with this topic.

Please let me know if anything is confusing. Hopefully I can clear it up!

 

Download All
0 Kudos
Message 1 of 5
(3,415 Views)
Solution
Accepted by kmyan9

Hi,

 

I've just saw new post here and found, that it might be some kind of hint.

When I use this export feature, I do it like this:

 

Call Report.Sheets("ChipTemperature_first_5_slots").ExportToImage(graphspath & "\" & "Chip_Temperature_first_5_slots_whole_period" & ".PNG",eImageExportTypePNG)

So, if you want to add some information from variable, you would like to use most probably the & sign, like this:

 

Call Report.Sheets("ChipTemperature_first_5_slots").ExportToImage(graphspath & "\" & variable & ".PNG",eImageExportTypePNG)

I've never used time stamp in the name of the image, but I use it to write information to log file. Then, I have this piece of code:

Call LogfileWrite(Str(CurrDateTimeReal, "#YYYY-mm-DD HH:NN:SS ampm"))

Hope you will find it helpful!

 

Best regards,

Piotr

Message 2 of 5
(3,390 Views)

Hello Piotr!

 

Thanks to you I got half of it to work!

I did get the variable in the titles, but not the date and time yet... but I will keep trying!

Call Report.Sheets.ExportToPDF("C:\Users\tiyang\Desktop\My Files\00. Start Presentation\DIAdem\9. Save here" & "\" & R1 & "~" & R2 & ".pdf", True)
Call LogFileWrite(Str(CurrDateTimeReal, "#YYYY-mm-DD HH:NN:SS ampm"))

This is the code, but the second part doesn't seem to work yet.

 

Again thank you for giving me an idea of how to approach this!

 

Kind regards,

Tim

 

 

0 Kudos
Message 3 of 5
(3,384 Views)

Never mind!

 

I got it.

 

The problem was that I cannot include ":" in a file name, but the time format included a colon.

After changing the colons to a dash, worked like magic!

 

Thank you Piotr!

 

Tim

0 Kudos
Message 4 of 5
(3,379 Views)

Hi Tim,

 

great! I'm glad to hear that!

 

Have a nice day!

Piotr

0 Kudos
Message 5 of 5
(3,370 Views)