DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Transfer map to REPORT from VIEW problem.

Solved!
Go to solution

Hi,

 

I am trying to transfer 3 maps of the same location but different zoom levels to Diadem REPORT from VIEW. When I use the View button provided (Transfer to Report) they get transferred fine but when I use the following script code they appear stretched.

 

Dim oMySheet 

For Each oMySheet in View.Sheets   

oMySheet.Activate   

Call ScriptStart(resourcedrv &"VwLayTrans","VWTransViewRep",0)

Next

 

To illustrate what I mean I am attaching the result from both operations labelled accordingly.

Has anybody experienced the same thing and if yes is there a way around this problem?

 

Thanks.

Tim

Download All
0 Kudos
Message 1 of 9
(5,297 Views)
Solution
Accepted by tspc

Hi Tim,

 

I asked R&D about this, and they suggested you add the following command to your script before the VIEW==>REPORT transfer command:

 

Call WndShow("VIEW")

 

They said that showing the VIEW panel prior to exporting the map to REPORT makes a difference in the resulting image sent to REPORT.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 2 of 9
(5,231 Views)

Thanks Brad.

Yes that seems to solve the glitch.

0 Kudos
Message 3 of 9
(5,223 Views)

Hi Brad, 

 

I'm having a similar running the script vs. button problem.

 

The following runs fine when Diadem is opened:

 

Option Explicit
Call Data.Root.Clear()
Call DataFileLoad("C:\Data\TDM\E92676_2014_07_23_GL1016_BR.TDM")
Call ScriptStart("C:\Data\VBS\Main.VBS")
Call DataFileSave("C:\Data\TDM\E92676_2014_07_23_GL1016_BR.TDM","TDM")
Call Report.LoadLayout("C:\Data\TDR\ST15.TDR")
Call View.LoadLayout("C:\Data\TDR\NONAME.TDV")
Call WndShow("VIEW")
Call ScriptStart(" C:\PROGRAM FILES (X86)\NATIONAL INSTRUMENTS\DIADEM 2012\Resource\VwLayTrans","VWTransViewRep",0)
Report.Sheets("VIEW-REPORT").Name = "Map"
Call Report.Refresh
Call Report.Sheets.ExportToPDF("C:\Data\PDF\E92676_2014_07_23_GL1016_BR.pdf",False)
Call ProgramExit()

 

But when I call this script using:

 

diadem.exe "/c ScriptStart('C:\Data\VBS\Test_2.vbs')" -embedding  

 

It errors out at the VwLayTrans script and I get the error shown in the attached picture.  Any Ideas?

 

Thanks,

 

Brian

 

Message 4 of 9
(4,221 Views)

Hi Brian,

 

Here's a guess.  I think the problem could be that the REPORT panel has not been officially opened in your automated approach.  Try adding a WndShow command to open up the REPORT panel before opening up the VIEW panel:

 

Call WndShow("REPORT", "OPEN")

Call WndShow("VIEW")

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 5 of 9
(4,182 Views)

Hi Brad,

 

I too have the same issue ("Divide by zero") as mentioned by Brian. The solution that you provided doesn't seem to work if DIAdem is not open and is called from LabVIEW programmatically. This problem occurs only when DIAdem is called programmatically. It can be solved if "show environment" is TRUE in DIAdem open reference vi or if DIAdem is open when the script is run.

 

Is there a way to avoid this error when "show environment" is FALSE? Because I need DIAdem to run in backend and it should not be visible to the user (minimized).

 

One more question I wanted to ask is,

Is there a way to remove all sheets from report? Even If we use Call Report.Sheets.RemoveAll first sheet remains in the report.

 

Regards,

Abinaya

0 Kudos
Message 6 of 9
(3,730 Views)

Hi Abinaya,

 

Are you really saying that you are controlling DIAdem from an outside program using DIAdem's ActiveX server AND you are telling DIAdem to transfer a VIEW layout to a REPORT layout?!  If so, please describe the scenario under which this makes sense.  If not, what is the reason you can't start in REPORT with a TDR file instead of transferring from VIEW?

 

The "Call Report.Sheets.RemoveAll" command does result in all the sheets being removed AND the default layout being loaded.  If you "Call Report.LoadLayout()", the loading layout will replace the sheet(s) from the default layout.  If you append REPORT sheets, then you need to delete the sheet(s) of the default layout afterwards.  There may be a slicker way to do all this, but I don't know it.

 

Brad Turpin

DIAdem Product Support Engineer

National Instuments

0 Kudos
Message 7 of 9
(3,727 Views)

Hi,

 

Is it possible to transfer GPS map view to specific already existing report page at specific location?

 

Thanks in Advance!

0 Kudos
Message 8 of 9
(2,204 Views)

Hi Sovarian,

 

Any GPS map area in VIEW will transfer to REPORT as a picture object, showing the specific frame that was visible in VIEW at the time of the transfer.  You could then manually grab the referenced picture file and use that as the background image of any specific REPORT object that takes one.  That's about all the options you have as of DIAdem 2020.

 

Brad Turpin

Principal Technical Support Engineer

National Instruments

0 Kudos
Message 9 of 9
(2,136 Views)