06-18-2024 08:04 AM
Hello all,
I have a problem when generate PDF report. If I run my script, in Report Tab all works fine, but when my script generate PDF, page is empty. Could you please help me?
Code of script who make the calculation:
dim oTable, oCol1, oCol2, oCol3, oCol4, oCol5, oCol6, oCol7
'Objects
Set oTable = report.Sheets(1).Objects.Add(eReportObject2DTable,"") 'Creare tabel ''(3)'' arata pagina din raport pe care o sa fie introdus tabelul
Set oCol1 = oTable.Columns.Add(e2DTableColumnChannel) 'Adaugare coloana
Set oCol2 = oTable.Columns.Add(e2DTableColumnChannel) 'Adaugare coloana
Set oCol3 = oTable.Columns.Add(e2DTableColumnChannel) 'Adaugare coloana
oCol1.Channel.Reference = Data.Root.ChannelGroups("Test Results").Channels("Valve_Name").GetReference(eRefTypeIndexIndex) 'Asignare canal coloanei
oCol2.Channel.Reference = Data.Root.ChannelGroups("Test Results").Channels("Pressure Difference").GetReference(eRefTypeIndexIndex) 'Asignare canal coloanei
oCol3.Channel.Reference = Data.Root.ChannelGroups("Test Results").Channels("Status").GetReference(eRefTypeIndexIndex)
oTable.Columns(3).Settings.OnDrawingCell = "MyOnDrawingCell" 'Adaugare "criteriu" colorare rosu/verde -> Definit in->Script left tab -> Setting->Extension->UserCommand->UserCommandExamples.vbs->
oTable.Columns(1).Settings.OnDrawingCell = "TextBold"
oTable.Position.ByBorder.Top = 1.356
oTable.Position.ByBorder.Bottom = 4.069
oTable.Position.ByBorder.Left = 1.654
oTable.Position.ByBorder.Right = 1.6
oTable.Settings.UseXDoubleLine = False
oTable.Settings.UseYDoubleLine = False
oTable.Settings.Header.Font.Bold = True
oTable.Settings.IndexSettings.IndexMode = e2DTableIndexModeAutomaticMaximum
oTable.Settings.GridHorizontal.Visible = True
report.Refresh
Code from script who generate report (included in first script with Call scriptinclude)
Call WNDSHOW("REPORT", "Maximize") ' necessary due to stability reason at the beginning
Call GENERAL_LoadReportFile(sReportFileName)
Call PRINTMAXSCALE()
PRINTLEFTMARG=0
PRINTTOPMARG=0
PRINTORIENT="portrait"
PrintRangeType="AllPages"
dim sPDFName : sPDFName = autoactname&sDIA_FILE_ADD_TEXT
Call GENERAL_DateCounter
Call PicPdfExport(autoactpath&sPDFName ) 'PDF Name wie der Reportname
Call FileCloseAll()
Call FileCopy(autoactpath&sPDFName&".PDF", "D:\Results_PDF\"&sDIA_DATE&"_#"&sDIA_FILE_COUNTER&"_"&sPDFName&" "&fDIA_Temperature&" "&fDIA_Voltage&".PDF")
'Call PicPdfExport("D:\Testplans\TEMP\_PDF\_All_Reports.PDF", true)
First picture: Diadem Report Menu
Second picture: Page prom PDF generated (empty)
Third picture: Channels which should be shown