DigiPara Liftdesigner LDX API
Loading...
Searching...
No Matches
Create a report

API method: ILDXDocument5.AddReportLine

Treename: Sheets.Components.API example report.Components.Report.

 ' from Samples/Src/LDXAPIExamples/Example_LDXDocument.vb

    <APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXApp}, "Sheets.Components.API example report.Components.Report.", "LDXDocument~AddReportLine", "Create a report")>
 Public Shared Sub CreateAReport(ByRef ldxApplication As DigiPara.LDX.LDXApplication)

     If ldxApplication.ActiveDocument Is Nothing Or ldxApplication.ActiveDocument.GetLDXObject("Shaft0.") Is Nothing Then
         MsgBox("Shafts not found!")
         Exit Sub
     End If
     ' Add a new report
     ldxApplication.ActiveDocument.AddReportLine("API example report", "", "", "", 0, "")
     Dim ldxReportLines As DigiPara.LDX.LDXReportLines = ldxApplication.ActiveDocument.Reports(ldxApplication.ActiveDocument.Reports.Count - 1)
     ' Configure the new report
     ' Delete the init line
     ldxReportLines.Clear()
     ' Column widths
     ldxReportLines.SetColWidth(0, 30)     ' First fixed column
     ldxReportLines.SetColWidth(1, 70)     ' Number
     ldxReportLines.SetColWidth(2, 40)     ' Status
     ldxReportLines.SetColWidth(3, 120)    ' Chapter
     ldxReportLines.SetColWidth(4, 200)    ' Topic
     ldxReportLines.SetColWidth(5, 400)    ' Annotation 0
     ldxReportLines.SetColWidth(11, 350)   ' Component name
     ' Add bold report line (header)
     ldxReportLines.Add("", "", "", 0, "", DigiPara.LDX.ReportLineModes.rlmBold)
     ldxReportLines.Item(ldxReportLines.Count - 1).SetMsg(DigiPara.LDX.ReportLineMessage.rlMessage0, "SHAFT")
     ' Add report line SHAFT WIDTH
     ldxReportLines.Add("", "", "SHAFT WIDTH (WW)", 0, "Shaft0.WIDTH", DigiPara.LDX.ReportLineModes.rlmNormal)
     ldxReportLines.Item(ldxReportLines.Count - 1).SetMsg(DigiPara.LDX.ReportLineMessage.rlMessage0, ldxApplication.ActiveDocument.GetValue("Shaft0.WIDTH").ToString())
     ' Add report line SHAFT DEPTH
     ldxReportLines.Add("", "", "SHAFT DEPTH (WD)", 0, "Shaft0.DEPTH", DigiPara.LDX.ReportLineModes.rlmError)
     ldxReportLines.Item(ldxReportLines.Count - 1).SetMsg(DigiPara.LDX.ReportLineMessage.rlMessage0, ldxApplication.ActiveDocument.GetValue("Shaft0.DEPTH").ToString())
 End Sub