hexagon logo

Multiple Reports

Is it possible to use separate custom reports inside the one program?

I need to measure some bits of a part and/or other bits dependent on what the operator choice is at the start of the program and need to show clear Cad views with dimensions attached for each situation, which a custom report works well with. Can I call them into a program at different locations etc...?

Or is there some form of legacy or hyper report that I could do this with? TIA
  • yes of course. i use 2 custom reports in one program
  • yes of course. i use 2 custom reports in one program


    Thanks for the reply!

    Is the use of the different custom reports automated or do you mean you pick the one you want manually before running the program? If it's automated, could you please post the code? TIA
  • I use script which switch template before printing. Do you want to share code?
  • Sub Main(RepID As String)

    Dim PCDapp As Object
    Dim PCDpart As Object
    Dim RepWin As Object

    Set PCDapp = CreateObject("PCDLRN.Application")
    Set PCDpart = PCDapp.ActivePartProgram
    Set RepWin = PCDpart.ReportWindow

    RepWin.Visible = False

    Dim lngRetVal As Long

    lngRetVal = RepWin.LoadCustomReport(RepID)
    RepWin.RefreshReport
    RepWin.SetCurrentAsDefaultReport

    Set RepWin = Nothing
    Set PCDpart = Nothing
    Set PCDapp = Nothing

    End Sub​


    Then you need to set name of custom template in Pcdmis into argument. In my case custom templates are "LH" and "RH" so i put command of script before print command.

    CUSTREP_RH =SCRIPT/FILENAME= D:\PCD_SCRIPTS\CUSTOMREPORTLOADER.BAS
    FUNCTION/Main,SHOW=YES,ARG1="RH",,
    STARTSCRIPT/
    ENDSCRIPT/​
  • I have the same problem as OP.

    Want to do with REPORT command and I can't figure it out how.

    I have 3 parts on one fixture, want to save a custom report (CAD) for every single one.

    I've tried:
    /code1
    -CS1 =REPORT/CUSTOM, FILENAME=Custom Report_G1, Section=-1
    PARAM/=
    ENDCUSTOM/
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,AUTO=1,AUTO OPEN=OFF,$
    TO_PRINTER=OFF,COPIES=1,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
    TO_EXCEL=OFF,$
    PREVIOUS_RUNS=DELETE_INSTANCES
    /code2
    -CS2 =REPORT/CUSTOM, FILENAME=Custom Report_G2, Section=-1
    PARAM/=
    ENDCUSTOM/
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,AUTO=10,AUTO OPEN=OFF,$
    TO_PRINTER=OFF,COPIES=1,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
    TO_EXCEL=OFF,$
    PREVIOUS_RUNS=DELETE_INSTANCES

    ....
  • and what happens when you use this code for the different custom reports?
  • On Monday I will share code. I managed fully working dual programs left and right part in one program each has separate custom and also excel reports, each is saved into differt folder and it;s smootly running without problems. I have pc-dmis 2022.1 but i have to be at work what i'll be on Monday. Do you waant me to share that code?
  • So program structure looks like this:

    1. Part
    Like single program - features
    - dimensions
    After dimensions i have variable with report path + filename of first part

    ASSIGN/REPORT_NAME="\\\128.0.7.25\\Company2\06_QUALITY\\1 487807_ASSY-TROUGH UPPER LH\\21.11.2022\\1487807_22325M_1.PDF"

    - command with script. Custom report name must be in ARG1 in my case "LH"

    CUSTREP_LH =SCRIPT/FILENAME= D:\PCD_SCRIPTS\CUSTOMREPORTLOADER.BAS
    FUNCTION/Main,SHOW=YES,ARG1="LH",,
    STARTSCRIPT/
    ENDSCRIPT/​

    - print command

    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE=REPORT_NAME,AUTO OPEN=OFF,$
    TO_PRINTER=OFF,COPIES=1,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
    TO_EXCEL=OFF,$
    PREVIOUS_RUNS=DELETE_INSTANCES

    Here print 1st part ends. I change alignment to 2nd part and repeat structure like in 1st part.
    Variable of course must have different name. Custom reports name is "RH"

    ASSIGN/REPORT_NAME2="\\\128.0.7.25\\Company2\06_QUALITY\\1487808_ASSY-TROUGH UPPER RH\\21.11.2022\\1487808_22325M_1.PDF"
    CUSTREP_RH =SCRIPT/FILENAME= D:\PCD_SCRIPTS\CUSTOMREPORTLOADER.BAS
    FUNCTION/Main,SHOW=YES,ARG1="RH",,
    STARTSCRIPT/
    ENDSCRIPT/
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,APPEND=REPORT_NAME2,AUTO OPEN=OFF,$
    TO_PRINTER=OFF,COPIES=1,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=OVERWRITE,FILENAME= ,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
    TO_EXCEL=OFF,$
    PREVIOUS_RUNS=DELETE_INSTANCES


    You can repeat this as many part you want in program. I use basic dialog at beginning of program with part selector and I use If/end if to run selected program.

    I can share full program prg if you want but you need to tell me your pcdims version.​​