Reports to PDF, To save using Tracefields

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reports to PDF, To save using Tracefields

    Ok, so I have custom trace fields that ask for today date and what run number, so if they have to do 8 parts in one shift, the report to be program name todays date and then the r-number, is there away to have pc-dmis due that, instead of having to change it every time it goes to pdf.

  • #2
    This should answer your question...


    Top of prg.
    Code:
    TRACEFIELD/DISPLAY=YES,REPORT=YES,DISPLAY MESSAGE=Run Number ; RUN_NUMBER : 7
    Put at bottom of prg below your dimensions
    Code:
    ASSIGN/VAR_RUN_NUMBER=GETTRACEVALUE("RUN_NUMBER")
    ASSIGN/DATE=STR(SYSTEMDATE ("MMddyyyy"))
    ASSIGN/TIME=STR(SYSTEMTIME ("HHmmss"))
    ASSIGN/REPORT_NAME="X:\\CMMPROGRAMS\\CMM_PDF_PCDMIS\\AG0XXXX_XXX\\"+VAR_RUN_NUMBER+"__"+DATE+TIME +".PDF"
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=OFF,AUTO=1,AUTO OPEN=OFF,$
    TO_PRINTER=OFF,COPIES=1,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=REPORT_NAME,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
    TO_EXCEL=OFF,$
    PREVIOUS_RUNS=DELETE_INSTANCES
    Look at the "REPORT_NAME" variable. Edit the file path to suit your needs. Everything BEFORE the doubleslashes is the PATH the PDF will be saved AT (so you'll need to create a folder there that PC DMIS will recognize that that exact location with the exact name you put in your prg). Everything AFTER the doubleslashes will be the NAME of the PDF (in our case, all variables).

    Operator types in the run number, program runs, at the end... PC DMIS automagically pulls the system's date & time. That gets concatenated to the filepath (which already has the run number in there) and VOILA! You're good.
    Last edited by DAN_M; 01-14-2021, 03:28 PM.
    SF7107(PCD), SF454(PCD), 152614(Quindos), 9159(Quindos), 7107(Quindos), B&S Manual, M&M Gear Checker

    Comment


    • #3
      this an example of how i do it. I have the first coding after rough/manual alignment. but this way the operator is imputing the serial number, it gets assign, carries over to trace fiels, and in the code at the bottom. this way the PDF is named how i want it.

      Code:
      C3 =COMMENT/INPUT,NO,FULL SCREEN=NO,
      Job NUMBER
      ASSIGN/JN=C3.INPUT
      C4 =COMMENT/INPUT,NO,FULL SCREEN=NO,
      'SERIAL NUMBER'
      ASSIGN/SN=C4.INPUT
      TRACE_FIELDS=LABEL/
      STATS/ON,DATAPAGE+,,OFFLINE=YES
      RECORD=DIMENSION,TRACE,FCF PROFILE,
      TRACEFIELD/DISPLAY=NO,REPORT=NO,DISPLAY MESSAGE=New Trace ; Serial Number : C4.INPUT
      TRACEFIELD/DISPLAY=NO,REPORT=NO,DISPLAY MESSAGE=New Trace ; Job Number : C3.INPUT
      i have this above the print report.
      Code:
       ASSIGN/PRINTPATH="C:\\TEMP\\"+"3979_"+C3.INPUT+"_"+C4.INPUT+".PDF"
      PDF gets saved as "Partnumber_Job_Serialnumber.PDF"

      the "C:\\TEMP" is my location where the PDF will be saved. 3979 is my part number. it will never change. "+C3.INPUT", is the job number that is being inputted in COMMENT C3. "+C4.INPUT"s the serial that is being inputted in COMMENT C4.

      is this what your asking about? are you using it for SPC?
      Last edited by ProbFlex; 01-14-2021, 03:29 PM.

      Comment


      • #4
        I do it like this-->


        Top of prg
        Code:
        GROUP_SERIALNUMBER_AND_RUNNUMBER=GROUP/SHOWALLPARAMS=YES
        SERIALNUMBERQUESTION =COMMENT/INPUT,NO,FULL SCREEN=NO,
        Serial Number:
        ASSIGN/VAR_SERIAL_NUMBER=SERIALNUMBERQUESTION.INPUT
        ASSIGN/VAR_SERIALNUMBER_STATEMENT="Serial Number: "+SERIALNUMBERQUESTION.INPUT
        COMMENT/REPT,
        
        COMMENT/REPT,
        VAR_SERIALNUMBER_STATEMENT
        COMMENT/REPT,
        
        RUNNUMBERQUESTION =COMMENT/INPUT,NO,FULL SCREEN=NO,
        Run Number:
        IF_GOTO/RUNNUMBERQUESTION.INPUT<1 OR RUNNUMBERQUESTION.INPUT>9999,GOTO = RUNNUMBERQUESTION
        IF_GOTO/LEN(RUNNUMBERQUESTION.INPUT)>4,GOTO = RUNNUMBERQUESTION
        ASSIGN/VAR_RUNNUMBER=FORMAT("%04d",INT(RUNNUMBERQUESTION. INPUT))
        ASSIGN/VAR_RUNNUMBER_STATEMENT="Run Number: "+VAR_RUNNUMBER
        COMMENT/REPT,
        VAR_RUNNUMBER_STATEMENT
        COMMENT/REPT,
        
        ENDGROUP/ID=GROUP_SERIALNUMBER_AND_RUNNUMBER


        Bottom of prog right after dimensions
        Code:
        GROUP_PRINT_AND_CSV_COMMANDS=GROUP/SHOWALLPARAMS=YES
        ASSIGN/PROG_NAME=GETPROGRAMINFO ("PARTNAME")
        ASSIGN/DATE=STR(SYSTEMDATE ("MMddyyyy"))
        ASSIGN/TIME=STR(SYSTEMTIME ("HHmmss"))
        ASSIGN/REPORT_NAME="O:\\CMM PROGRAMS\\CMM_PDF_PC DMIS\\AG04667_020\\"+PROG_NAME+"__"+VAR_SERIAL_NUMBER+"__"+VAR_RUNNUMBER+"_"+DATE+TIME+".PDF"
        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_NAME,$
        REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
        TO_EXCEL=OFF,$
        PREVIOUS_RUNS=KEEP_INSTANCES
        ENDGROUP/ID=GROUP_PRINT_AND_CSV_COMMANDS
        Last edited by DAN_M; 01-14-2021, 03:29 PM.
        SF7107(PCD), SF454(PCD), 152614(Quindos), 9159(Quindos), 7107(Quindos), B&S Manual, M&M Gear Checker

        Comment


        • #5
          So many ways to skin the same kitty....

          Operator input at beginning of program
          Code:
          JOBNO =COMMENT/INPUT,NO,'
          ,
          ,Job Number
          ,
          ,'
          STATSNO =COMMENT/INPUT,NO,'
          ,
          ,What is the Stats Count?
          ,
          ,'
          OPID =COMMENT/INPUT,NO,'
          ,
          ,Operator I.D.
          ,
          ,'
          Print code at end of program
          Code:
          STATS/OFF
          IF/STATSNO.INPUT>=100
          ASSIGN/STATPAD=STR(STATSNO.INPUT)
          GOTO/STAT_PAD_DONE
          END_IF/
          ELSE_IF/STATSNO.INPUT>=10
          ASSIGN/STATPAD=STR(0)+STR(STATSNO.INPUT)
          GOTO/STAT_PAD_DONE
          END_ELSEIF/
          ELSE/
          ASSIGN/STATPAD=STR(0)+STR(0)+STR(STATSNO.INPUT)
          END_ELSE/
          STAT_PAD_DONE=LABEL/
          PRINTREPORT =COMMENT/YESNO,NO,
          ,
          ,Will you need a printed report?
          ,
          ,
          IF/PRINTREPORT.INPUT=="YES"
          ASSIGN/PRNTRPRT="ON"
          END_IF/
          IF/PRINTREPORT.INPUT=="NO"
          ASSIGN/PRNTRPRT="OFF"
          END_IF/
          ASSIGN/PATH="N:\63 - Metrology\CMM Reports\\"+PARTNUM+" Job"+JOBNO.INPUT+" "+STATPAD+" wire.PDF"
          PRINT/REPORT,EXEC MODE=END,$
          TO_FILE=ON,OVERWRITE=PATH,$
          TO_PRINTER=PRNTRPRT,$
          TO_DMIS_REPORT=OFF,FILE_OPTION=OVERWRITE,FILENAME= ,$
          REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
          PREVIOUS_RUNS=DELETE_INSTANCES
          Xcel & MicroVal Pfx & Global 37mr4 thru 2012mr1sp3
          Contura Calypso 5.4

          Lord, keep Your arm around my shoulder and Your hand over my mouth. Amen.

          Comment


          • #6
            Always so many ways to skin a cat, I was Programming Calypso for last 15 years and now doing Pcdmis, I do have some experience from it YEARS ago. I am trying to paste in the codes but PC-Dmis is not allowing me to do so, is there a way to cut and paste, or do I have to do it all manually???

            Again I appreciate all the help!

            Comment


            • DAN_M
              DAN_M commented
              Editing a comment
              Manually =( sorry

            • RobJohns
              RobJohns commented
              Editing a comment
              Ok, one last question, every time I run this it open a box to name the pdf file, How do I get to manually do it to fields that we have put into the program, I can't figure out why that box keeps coming up.

          • #7
            Ok, one last question, every time I run this it open a box to name the pdf file, How do I get to manually do it to fields that we have put into the program, I can't figure out why that box keeps coming up.

            Comment


            • #8
              This is the end of my program, No matter I turn on or off, every single time the dialog box at the very end pops asking me to name the PDF, I do not know what I am doing wrong, or what is turned on to cause it to keep poping up, it should be saving the PDF automatically to that file location but it isn't.

              ASSIGN/PROG_NAME=GETPROGRAMINFO ("PARTNAME")
              ASSIGN/VAR_SAMPLE=GETTRACEVALUE("SAMPLE")
              ASSIGN/DATE=STR(SYSTEMDATE ("MMDDYYYY"))
              ASSIGN/TIME=STR(SYSTEMTIME ("HHMM"))
              ASSIGN/REPORT_NAME="G:\\Operations\\0 Marine City\\CMM Reports MC\\000716001643\"+PROG_NAME+"_"+DATE+TIME+"_"+VA R_SAMPLE+".PDF"
              PRINT/REPORT,EXEC MODE=END,$
              TO_FILE=ON,AUTO=1,AUTO OPEN=OFF,$
              TO_PRINTER=OFF,COPIES=1,$
              TO_DMIS_REPORT=OFF,FILE_OPTION=APPEND,FILENAME=REP ORT_NAME,$
              REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=YES,$
              TO_EXCEL=OFF,$
              PREVIOUS_RUNS=DELETE_INSTANCES

              Comment


              • ProbFlex
                ProbFlex commented
                Editing a comment
                try F9 with the courser in the line "PRINT/REPORT,EXEC MODE=END,$". and select append and not prompt. let me know if this works for you. also try unchecking the Report output last.

              • ProbFlex
                ProbFlex commented
                Editing a comment
                i just tried it and by just selecting the "Append" did the trick. but you have to keep the Report output checked on.

              • RobJohns
                RobJohns commented
                Editing a comment
                It does have windows 10 on this computer, I have only been here 3 weeks now, so not sure if it was upgraded or not.

            • #9
              Originally posted by RobJohns View Post
              Ok, one last question, every time I run this it open a box to name the pdf file, How do I get to manually do it to fields that we have put into the program, I can't figure out why that box keeps coming up.
              The fix if you recently upgraded to Windows 10 is to give the Users group full permissions to. HKEY_CURRENT_CONFIG\Software\PC-DMIS 50 Converter. I was having this problem and our IT guy found this answer. I believe it came from another thread on this forum, but I though I would post it here as well.
              PC-DMIS 2016.0 SP8

              Jeff

              Comment


              • neil.challinor
                neil.challinor commented
                Editing a comment
                RobJohns, I see from a previous post you mention that you've only been at your company for three weeks. When you get your IT guy (or gal) to set the permissions for the PC-DMIS 50 Converter, it is probably worth getting them to check all of the other permissions are set correctly too. They can find a list of all the registry and folder locations that PC-Dmis requires access to listed in the readme file. I'm guessing that they probably just created a new user account for you when you started working for them and that could mean that it's not set up correctly with respect to PC-Dmis.

            • #10
              Is it possible to use a tracefield or comment input to create a folder? I want to use the julian date scribed on the part as the final folder destination, then use other tracefields/variables for the name of the report file. I must be using the wrong syntax, because it prompts me to manually save when I attempt it. If it is possible, do I have to create the folders prior? Or will it create a new folder if one doesn't already exist?

              I still need to take the 3rd training, so sorry if this is obvious.

              Comment

              Related Topics

              Collapse

              Working...
              X