DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Export the plots in "VIEW" directly to a powerpoint file

Solved!
Go to solution

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.

 

Kane_Lok_0-1682456027014.png

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.

Kane_Lok_1-1682457138401.png

 

Does anyone know how to get around this issue?  Many thanks.

 

Regards,

 

Kane

0 Kudos
Message 1 of 6
(1,388 Views)

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. 

 

 

0 Kudos
Message 2 of 6
(1,342 Views)

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

0 Kudos
Message 3 of 6
(1,324 Views)

Hi Kane_Lok

 

I used the script below. I used DIAdem 2023, so you have to make a few changes. 

 

  • VIEW.tdv is attached 
  • You need to define the correct path for MyFolders
  • Example data folder has to be changed according to your DIAdem 2021 version
  • ScriptStart has to be changed according to your DIAdem 2021 version
  • The result of the pptx export is attached as png file -> Defined curve is shown

 

 

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")

 

 

0 Kudos
Message 4 of 6
(1,300 Views)

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

0 Kudos
Message 5 of 6
(1,288 Views)
Solution
Accepted by topic author Kane_Lok

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.

0 Kudos
Message 6 of 6
(1,241 Views)