DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Objects arrangement and .png file on report

Hello,

 

I need to arrange some object in DIADEM report page with script. Firstly, I have to use "arrangement" feature.

 

(Right click on object -> arrangement -> Move to Background)

 

Possible to do this with script? I could not take this script with "record script" or "copy as script"

 

Secondly, when I add some .png file as object, DIADEM takes it as a rectangle. It causes some problems when I export it as .PDF because they overlap each others. Is it possible to take a .png file like really .png?

 

Thank you.

0 Kudos
Message 1 of 5
(2,169 Views)

Hi mmt1357,

 

You can move any object to background from VBScript with MoveToBackground method of ZOrder object.

 

Method: MoveToBackground for ZOrder - DIAdem 2018 Help - National Instruments
http://zone.ni.com/reference/en-XX/help/370858P-01/reportapi/methods/report_method_movetobackground_...

 

If you run the following example, which is also in the help section, you should be able to understand how it works.

 

Dim oMyCircle, oMyFrame
Call Report.NewLayout()
Set oMyCircle = Report.ActiveSheet.Objects.Add(eReportObjectCircle,"MyCircle")
Call oMyCircle.BackgroundColor.SetPredefinedColor(ePredefinedColorBlue)
Set oMyFrame = Report.ActiveSheet.Objects.Add(eReportObjectFrame,"MyFrame")
Call oMyFrame.BackgroundColor.SetPredefinedColor(ePredefinedColorRed)
Call oMyFrame.Position.ZOrder.MoveToBackground()
Call Report.Refresh()

 

As for your question about png file, I don't understand what the problem is.

My understanding is that perhaps when you line up png files with a transparent background, they should not overlap, but they do because the rectangle is no longer transparent in DIAdem. Is my understanding correct?

 

I checked with DIAdem2020, but I'm able to export to PDF without any overlap of pngs as shown in the following figs and attached PDF.

 

DIAdem - [REPORT   NONAMETDR]_2020-7-8_23-21-14_No-00.png

 

Could you check the settings of background color for the image object? 

Or, if you have any files to reproduce, it would help me to understand

 

Thanks,

Yoshiaki

0 Kudos
Message 2 of 5
(2,163 Views)

Hi Yoshiaki,

 

The method you shared with me solved my first problem. Thank you.

 

The second problem is exactly like you understand. However, when I open your .pdf file, I see it like below. Overlaping is continue.


I am using this code.

 

 

Set oMyImage = Report.ActiveSheet.Objects.Add(eReportObjectImage, "MyPngObject")

Set oMyPos = oMyImage.Position.ByCoordinate

oMyImage.UseOriginalRatio = True

oMyPos.X1 = ....

oMyPos.Y1 = ....



Call oMyImage.Position.ZOrder.MoveToForeground   (I updated this line after your feedback)

Call oMyImage.BackgroundColor.SetPredefinedColor(eColorIndexNone)

 

 

As I understand, last line should be updated. Is it possible to make transparent background? Even if the backgorund is seen transparent in DIADEM report page, after exporting to .PDF, it does not stay at like DIADEM report page.

 

mmt1357_1-1594277212183.png

 

Have a nice day.

Mehmet

 

 

 

 

 

0 Kudos
Message 3 of 5
(2,129 Views)

Hi Mehmet,

Thank you for updating your situation.

 

Here's a screenshot of NONAME.pdf opened in google chrome in my environment.

DIAdem-REPORT_ NONAMETDR - Google Chrome_2020-7-9_23-43-48_No-00.png

As you can see, there is no overlap.

 

And I found that they certainly overlap if I just use another PDF viewer, e.g. MS Edge, to open the same NONAME.pdf as follows:

NONAMEpdf ‎- Microsoft Edge_2020-7-9_23-51-25_No-00.png

 

It's interesting 😞

I am not sure, but I wonder if it's a problem with the Amyuni PDF printer that DIAdem is using.

 

By the way, if I use Microsoft PDF printer, not Amyuni, to export PDF file, the overlap is no longer occurring even though the PDF files opens in MS Edge.

 

TestPDF_MSPDFpdf ‎- Microsoft Edge_2020-7-10_1-8-58_No-00.png

 

Variable: PDFUseMicrosoftPrinter - DIAdem 2018 Help - National Instruments
http://zone.ni.com/reference/en-XX/help/370858P-01/varoff/pdfusemicrosoftprinter/

 

Can this be a workaround for you?

 

Best regards,

Yoshiaki

 

 

0 Kudos
Message 4 of 5
(2,103 Views)

Thank you Y. Sato.

 

I could not solve my .PDF problem but I will try some other solutions.

 

Have a good day.

0 Kudos
Message 5 of 5
(2,068 Views)