hexagon logo

2016 report printing issue

I've been using the same vb.net application to print (PDF and hard copy) from PCDMIS 2011 for a few years now. In 2016 it no longer works the same. After printing once, it will not print a second time. PCDMIS doesn't even flinch when the second set of commands are called. If I print the PDF first, it skips the hard copy, if I print the hard copy first, it skips the PDF...no matter what, it will not print twice in a row, like it used to. We have upgraded 7 machines to 2016, all have the same problem.

Any thoughts??


'print to PDF

[FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]prt.EditWindow.SetPrintOptionsEx(PCDLRN.[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]PCDPRINTLOC[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].PCD_FILE, PCDLRN.[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]ENUM_PCD_ON_OFF[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].DMIS_ON, PCDLRN.[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]PCDPRINTFILEMODE[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].PCD_NEWFILE, 1, [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]sPath[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2], PCDLRN.[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]PCDFILEPRINTFORMAT[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].PCD_PDF, [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]False[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2])[/SIZE][/FONT][/SIZE][/FONT]
[FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]RepWin.PrintReport()

'print hard copy

prt.EditWindow.SetPrintOptions([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]PCDPRINTLOC[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].PCD_PRINTER, [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]ENUM_PCD_ON_OFF[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].DMIS_ON, [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]PCDPRINTFILEMODE[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].PCD_OVERWRITE, 1)[/SIZE][/FONT][/SIZE][/FONT]
[FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]RepWin.PrintReport()[/SIZE][/FONT][/SIZE][/FONT]


Parents

  • Just checked in 2017 R2 SP3 and this is still a problem. The following two print commands (writing to different PDF names) each work separately (answering 1 or 2 to the input q.), but only the first gets executed when I try to do them both in a row.

    C1         =COMMENT/INPUT,NO,FULL SCREEN=NO,
                1 OR 2 or 3 (both)
                IF/C1.INPUT==1 OR C1.INPUT==3
                  PRINT/REPORT,EXEC MODE=END,$
                    TO_FILE=ON,AUTO=1,AUTO OPEN REPORT=OFF,$
                    TO_PRINTER=OFF,COPIES=1,$
                    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
                    REPORT_THEORETICALS=ALL,REPORT_FEATURE_WITH_DIMENSIONS=YES,$
                    TO_EXCEL_OUTPUT=OFF,
                    PREVIOUS_RUNS=DELETE_INSTANCES
                END_IF/
                IF/C1.INPUT==2 OR C1.INPUT==3
                  PRINT/REPORT,EXEC MODE=END,$
                    TO_FILE=ON,AUTO=1,AUTO OPEN REPORT=OFF,$
                    TO_PRINTER=OFF,COPIES=1,$
                    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
                    REPORT_THEORETICALS=ALL,REPORT_FEATURE_WITH_DIMENSIONS=YES,$
                    TO_EXCEL_OUTPUT=OFF,
                    PREVIOUS_RUNS=DELETE_INSTANCES
                END_IF/
    


    But, inserting a call on the REFRESHREPORT.BAS script between the two IF statements makes it work, just as bjacobson says.

    CS1        =SCRIPT/FILENAME= F:\PUBLIC\DOCUMENTS\PC-DMIS\BASIC\REFRESHREPORT.BAS
                FUNCTION/Main,SHOW=YES,,
                STARTSCRIPT/
                ENDSCRIPT/
    


    Sub main()
    
    Dim App As Object
    Set App = CreateObject("PCDLRN.Application")
    
    Dim Part As Object
    Set Part = App.ActivePartProgram
    
    Dim repwin As Object
    Set repwin = part.reportwindow
    
    repwin.refreshreport 'refresh report
    
    End Sub
    


Reply

  • Just checked in 2017 R2 SP3 and this is still a problem. The following two print commands (writing to different PDF names) each work separately (answering 1 or 2 to the input q.), but only the first gets executed when I try to do them both in a row.

    C1         =COMMENT/INPUT,NO,FULL SCREEN=NO,
                1 OR 2 or 3 (both)
                IF/C1.INPUT==1 OR C1.INPUT==3
                  PRINT/REPORT,EXEC MODE=END,$
                    TO_FILE=ON,AUTO=1,AUTO OPEN REPORT=OFF,$
                    TO_PRINTER=OFF,COPIES=1,$
                    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
                    REPORT_THEORETICALS=ALL,REPORT_FEATURE_WITH_DIMENSIONS=YES,$
                    TO_EXCEL_OUTPUT=OFF,
                    PREVIOUS_RUNS=DELETE_INSTANCES
                END_IF/
                IF/C1.INPUT==2 OR C1.INPUT==3
                  PRINT/REPORT,EXEC MODE=END,$
                    TO_FILE=ON,AUTO=1,AUTO OPEN REPORT=OFF,$
                    TO_PRINTER=OFF,COPIES=1,$
                    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
                    REPORT_THEORETICALS=ALL,REPORT_FEATURE_WITH_DIMENSIONS=YES,$
                    TO_EXCEL_OUTPUT=OFF,
                    PREVIOUS_RUNS=DELETE_INSTANCES
                END_IF/
    


    But, inserting a call on the REFRESHREPORT.BAS script between the two IF statements makes it work, just as bjacobson says.

    CS1        =SCRIPT/FILENAME= F:\PUBLIC\DOCUMENTS\PC-DMIS\BASIC\REFRESHREPORT.BAS
                FUNCTION/Main,SHOW=YES,,
                STARTSCRIPT/
                ENDSCRIPT/
    


    Sub main()
    
    Dim App As Object
    Set App = CreateObject("PCDLRN.Application")
    
    Dim Part As Object
    Set Part = App.ActivePartProgram
    
    Dim repwin As Object
    Set repwin = part.reportwindow
    
    repwin.refreshreport 'refresh report
    
    End Sub
    


Children
No Data