+1

Print Yes/NO

Michael vor 7 Jahren in Metrology Software / PC-DMIS aktualisiert von neil kay vor 5 Jahren 19

hello


hello i would like the function  i want a print yes or no


and that you can tell that you only get the mistakes a report with mitutoyo this is easy



Hello Michael,


there a already solutions in PC-DMIS to get an YES/NO - command to print.

One possibility is to use form reports.
Here you have very free possibilities to fill different variables.

Another (easier) way is to use tracefields with PC-DMIS 2018 R1 or newer.

Here you have the possibility to create dropdown menus with YES or NO.

You can use this selection at an IF/EndIf-Command to start a print process or not.


Please take a look at the attached picture, here you can see an example.


Regards, Tobias

Or use comment command.

The New Tracefield method that is shown here will only work for 2018 R1.

If you open this in a older version then the other Value that was added "Yes" will have to be added back to the Tracefield after the program is open in 2018 R1. Hopefully this will be fixed in the up coming service pack.

I forgot to add something. So far I do like the New Tracefield for 2018 R1.

yes it works
only I am having the problem that I always want to save my document and print  when necessary 
Giving a print job twice, he does not get the 2nd one is empty

That's because the first Print command clears the report after saving the report to a file. The next Print Command will not print if the report is blank. You can add a script after each print command that has a code to refresh the report.


My Template for PC-DMIS is now over 6,000 lines of code when Groups are expanded and 90 percent of this code is to deal with the lack of reporting controls in PC-DMIS.


This is one of many issues or weakness with PC-DMIS Reporting and should have been fixed years ago.

Here is the Refresh Report Script.


Sub Main


Dim App As Object
Set App = createobject("pcdlrn.application")
Dim Part As Object
Set Part = App.activepartprogram
Dim Cmds As Object
Set Cmds = Part.Commands
Dim Cmd As Object
Set ReportWindow = Part.ReportWindow


Dim ReFrw As Object
Set ReFrw = Part.ReportWindow


'Full Report Mode
'lngRetVal = ReportWindow.FullReportMode()


'Last Execution Report Mode
lngRetVal = ReportWindow.LastExecutionReportMode()


'Report Refresh
ReFrw.refreshreport



Set ReportWindow = Nothing
Set EditWindow = Nothing
Set DmisPart = Nothing
Set DmisApp = Nothing
 
End Sub



It is correct that the reports gets blanked after the print command, but this is not a problem, you can do this for sure and you need no additional dimensions or scripts :)


You should only work with IF/END IF and ELSE/END ELSE command.


In your example you can create it like the following style:


- IF COMMAND (for example GETTRACE..........=="YES")

- PRINT COMMAND (here please check PDF and PRINT)

- END IF

- ELSE

- PRINT COMMAND (here please check only PDF)

- END ELSE


This is no weakness, you should only work correct with the software, then it works without problems ;)


I think we need no additional function here...

Is the answer OK for you, Michael?

If not, you can contact your software support, I think, they can help you.


* It is only a example with the tracefield.

For sure, you can use also form feeds or the principe with a comment YES / NO, which davehocum showed.

Yes, this is the weakness of the reporting in PC-DMIS. Because you shouldn't have do this and it should not have to be this complicated. And yes I already do this in my template as you have shown and more. But the Get trace command has issues with older versions with the new Trace Field.

While we are on the subject is there any plans of improving the reporting for PC-DMIS?

Sorry, I only wanted to help Michael with his problem, because there are some solutions already,

and I thought that he is thinking that there is no solution. Thats the reason, why I said we need no additional function.


If anyone of you wants to get a better / easier solution, then our developer have to decide, if they can do this.

Thank you Tobi for the Examples and info.

Hey
it works perfectly I put everything in a subroutine for printing.
and for that I save the pdf where I want it

thank you

Awesome idea with the subroutine for the printing. I have been thinking about using subroutines to help reduce the size of the template.

hello


the only thing I am now with is that I head 1 protocol that is filled in but after the cript it is completely empty

Here is my Test Sample:


Call Subroutine:

PNT16      =FEAT/POINT,CARTESIAN,NO
            THEO/<0,0,0>,<0,1,0>
            ACTL/<0,0,0>,<0,1,0>
            CONSTR/POINT,ORIGIN
DIM LOC1= LOCATION OF POINT PNT16  UNITS=IN ,$
GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
X       1.0000     0.0020     0.0020     0.0000    -1.0000     0.9980 <--------
Y       0.0000     0.0020     0.0020     0.0000     0.0000     0.0000 ----#----
Z       0.0000     0.0020     0.0020     0.0000     0.0000     0.0000 ----#----
END OF DIMENSION LOC1
CS1        =CALLSUB/PRINTING_REPORT,C:\Users\Public\Documents\New Programs\Testing Printing 2016.0.PRG:,


Subroutine Program:


            SUBROUTINE/PRINTING_REPORT,
                 =
CONTINUE_PRINTING_C1 =COMMENT/YESNO,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
            Do want to Print the Report?
           
            Select Yes to print the Report.
            Select No to continue without printing the Report.
           
            Select Cancel to End Program
           
            IF/CONTINUE_PRINTING_C1.INPUT=="YES" 
              ASSIGN/OUTTOL_PRINT_V1=GETPROGRAMINFO("NUMOOT")
              IF_GOTO/OUTTOL_PRINT_V1.INPUT==0,GOTO = SKIP_OUTTOL_PRINTING_L1
CONTINUE_PRINTING_OUTTOL_C1   =COMMENT/YESNO,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
              Do want to Print the Out of Tolerance Report?
             
              Select Yes to print the Report.
              Select No to continue without printing the Report.
             
              Select Cancel to End Program
             
              IF_GOTO/CONTINUE_PRINTING_OUTTOL_C1.INPUT =="NO",GOTO = SKIP_OUTTOL_PRINTING_L1
  $$ NO,
              OUTTOL PRINTER
              PRINT/REPORT,EXEC MODE=END,$
                TO_FILE=ON,OVERWRITE=C:\TEMP\Testing 2016.0.PDF,AUTO OPEN REPORT=OFF,$
                TO_PRINTER=ON,COPIES=1,$
                TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
                REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                TO_EXCEL_OUTPUT=OFF,
                PREVIOUS_RUNS=DELETE_INSTANCES
CS1          =SCRIPT/FILENAME= C:\USERS\PUBLIC\DOCUMENTS\PCDMISQUICKTOOLS\QUICKTOOLS\REFRESHREPORT NEW.BAS
              FUNCTION/Main,SHOW=YES,,
              STARTSCRIPT/
              ENDSCRIPT/
SKIP_OUTTOL_PRINTING_L1  =LABEL/
  $$ NO,
              AUTO FILE SAVE
              PRINT/REPORT,EXEC MODE=END,$
                TO_FILE=ON,AUTO=11,AUTO OPEN REPORT=OFF,$
                TO_PRINTER=OFF,COPIES=1,$
                TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
                REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                TO_EXCEL_OUTPUT=OFF,
                PREVIOUS_RUNS=DELETE_INSTANCES
CS2          =SCRIPT/FILENAME= C:\USERS\PUBLIC\DOCUMENTS\PCDMISQUICKTOOLS\QUICKTOOLS\REFRESHREPORT NEW.BAS
              FUNCTION/Main,SHOW=YES,,
              STARTSCRIPT/
              ENDSCRIPT/
            END_IF/
            ENDSUB/
END_PROGRAM_L1=LABEL/

can you email the sample i cant koppie past it 


michael_wilting@hotmail.com

More examples with issues using Print Commands.
Two Reports in On Routine?