04-25-2023 04:14 PM
Hi,
I start another post here as I hit another issue.
Just wondering if there is a way to export a plot or plots in "VIEW" directly to a powerpoint file?
Basically I have got some plots that I'd like to export to a powerpoint file like below.
I'd only like to export "1-page" to the powerpoint. I have tried to transfer the plot to "REPORT" and used the export function to the powerpoint (FYI, I run a script to do this). But the lines in plots were not appeared in the powerpoint like below.
Does anyone know how to get around this issue? Many thanks.
Regards,
Kane
Solved! Go to Solution.
04-27-2023 02:30 AM
Hi Kane_Lok,
you can export only a report as powerpoint file.
You can either transfer your view to the report section or directly create a report according to your requirements.
In the report section you can define which sheets should be printed. Default behaviour is to print all sheets to one powerpoint file.
In my test every curve which was shown in the report sheet is also shown in the exported powerpoint file.
The Method: ExportToPowerPoint for Sheets should be used.
04-27-2023 01:44 PM
Hi ColinF,
This is the codes I used, but as I said it is not working.
View.Sheets("1-pager").activate
Call View.Refresh()
Call Report.Sheets.RemoveAll
Call ScriptStart("C:\PROGRAM FILES\NATIONAL INSTRUMENTS\DIADEM 2021\Resource\VwLayTrans", "VWTransViewRep", False)
Call Report.Refresh()
Dim DatFileName: DatFileName = Data.Root.ChannelGroups(1).Channels("pack_total_current").Properties("sourcedatafilename").Value
Report.Sheets("VIEW-REPORT").Name = DatFileName
Report.Sheets("Sheet 1").UseForPrinting = FALSE
Call Report.Sheets.ExportToPowerPointAppend("F:\APP_Batt_Test_Results\PPTA#83_50v_Bridge_PoC_P&T_Validation_SVolt\ReportOut_Trial.pptx")
Could you share your codes if possible? Many thanks.
Regards,
Kane
04-28-2023 08:18 AM
Hi Kane_Lok
I used the script below. I used DIAdem 2023, so you have to make a few changes.
Option Explicit 'Forces the explicit declaration of all the variables in a script.
Dim MyFolders()
'-------------------------------------------------------------------------------
Sub InitMyFolders
ReDim MyFolders(1)
MyFolders(0) = "C:\Users\NI\Desktop\" 'Please change to your path
End Sub
Call InitMyFolders
'-------------------------------------------------------------------------------
Data.Root.Clear
Call DataFileLoad("C:\Users\Public\Documents\National Instruments\DIAdem 2023\Data\Example.tdm")
Call View.LoadLayout(MyFolders(0)&"VIEW.tdv")
Call View.Refresh
Call ScriptStart("C:\PROGRAM FILES\NATIONAL INSTRUMENTS\DIADEM 2023\Resource\VwLayTrans", "VWTransViewRep", False)
Report.Sheets("Sheet 1").UseForPrinting = FALSE
Call Report.Sheets.ExportToPowerPoint(MyFolders(0)&"Forum.pptx")
04-28-2023 12:34 PM
Hi ColinF,
I have found out the root-cause; it is due to the scaling of the 2D plots transferred from "VIEW". When the plots are transferred from "VIEW" the scaling of X & Y axis are set manual. So my script runs to transfer the plots for the second time. The scalings in "REPORT" stay the same as the plots in the first transfer. So just wondering if you know how to set scaling of X & Y axis from a script? I think it would solve the issue.
Regards,
Kane
05-03-2023 03:17 AM
Hi,
Just managed to find the solution in another post.
https://forums.ni.com/t5/DIAdem/Changing-the-scaling-of-2D-Axis-in-REPORT/td-p/4301935
Thanks All.