Populating report header

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

  • Populating report header

    At the end of all programs at my last employer had a box that opened at the end of the program that let you enter the job # operator ect... It was already something that was in use how do I create something like that.
    DeWain Hodge

  • #2
    https://www.pcdmisforum.com/forum/pc...t-name-rev-ser

    https://www.pcdmisforum.com/forum/pc...rt-number-code
    Last edited by KIRBSTER269; 10-05-2020, 08:54 AM.
    (In Memory of my Loving wife, "Ronda" who I lost March 7, 2016. I love you baby.)
    They say "Nobody's Perfect." I must be Nobody.

    Comment


    • #3
      I'm still trying to figure this out. Here is what I have so far:
      I created a form that will allow me to enter the data for the header I want

      formTEST.JPG

      Now my issue is getting the entered data to the header. Here what I think I need, but something is wrong.
      Code:
      [CODE]$$ NO,
      ************************************************** *************************************
      ************************************************** *************************************
      ************************************************** *************************************
      PART FORM DATA
      ASSIGN/PN="PART NAME"
      ASSIGN/DN="DRAWING NUMBER"
      ASSIGN/DR="DRAWING REV"
      CS1 =FORM/FILENAME= Z:\CMM PROGRAMS\JOBDATA.FORM
      PARAM/JOB1.VALUE=JOB
      PARAM/NAME1.VALUE=OPER
      PARAM/PART1.VALUE=PN
      PARAM/=
      ENDFORM/
      ASSIGN/JOB=""
      ASSIGN/OPER=""
      ASSIGN/PN=""
      [/CODE]

      Any help would be appreciated.
      DeWain Hodge

      Comment


      • mb0258
        mb0258 commented
        Editing a comment
        you put values in the form, but after that, you blank them with ""

    • #4
      You need to edit the FILE_HEADER.LBL with your variables for it to populate. I think KIRBSTER269 made a little info post with graphics and yellow arrows (it's the KIRBSTERS signature) somewhere.
      PC-DMIS CAD++ 2o19 R1 SP11

      Comment


    • #5
      ...or try these:

      https://www.automettech.com/pc-dmis-tips-and-tricks

      Courtesy of our own NinjaBadger !

      Or:
      https://www.pcdmisforum.com/forum/pc...in-one-program
      PC-DMIS CAD++ 2o19 R1 SP11

      Comment


      • #6
        My report header has been modified with the correct variable, but the variables always come up blank after I run the form. I'm just not understanding how to get the form data to the variable.
        DeWain Hodge

        Comment


        • SABarber
          SABarber commented
          Editing a comment
          Did you correct the code as mentioned above? Remove the assigns setting the variables to “” after the form.
          The PARAM is 2 way. Going to the form it reads the variable. Closing the form takes the value from the form and sets the pcdmis variable.

      • #7
        https://www.pcdmisforum.com/forum/pc...85-form-editor

        Maybe use Form, I know in this InspectorJester made a video, bfire85 added to it, and davehocum showed some examples. Working with some of the radio buttons and such, probably going to have to do a lot of reading on that. Great thing about this is once you do create your masterpiece, it's simply copy and paste.
        (In Memory of my Loving wife, "Ronda" who I lost March 7, 2016. I love you baby.)
        They say "Nobody's Perfect." I must be Nobody.

        Comment


        • #8
          This is typically how i start all of my programs. It just slides it into the report at the header and i'm good to run. This is at the top of all of my codes, granted the X's are our part numbers/paths/etc.



          Code:
          FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;MEAS,NOM,TOL,DEV,OUTTOL, ,
          LOADPROBE/HPSX1HS_4BY50MM
          TIP/T1A-90B-90, SHANKIJK=-1, 0, 0, ANGLE=-90
          WORKPLANE/XPLUS
          COMMENT/OPER,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
          Make sure the vice has aluminum jaws and is clean with a spacer
          Between the part and Jaw surface Load the vice onto the CMM
          With the jaws along the Y Axis and secure it with clamps
          Load the part into the Vice with datum A to the Left
          And along the Y axis Measure A for the Plane and Hub ID
          For the Circle
          
          
          TIP/T1A-90B-90, SHANKIJK=-1, 0, 0, ANGLE=-90
          L1 =LABEL/
          C1 =COMMENT/INPUT,NO,FULL SCREEN=NO,
          Inspectors Initials
          C2 =COMMENT/INPUT,NO,FULL SCREEN=NO,
          Finish S/N
          C3 =COMMENT/INPUT,NO,FULL SCREEN=NO,
          Forging S/N
          C4 =COMMENT/INPUT,NO,FULL SCREEN=NO,
          Forging Heat Code
          C55 =COMMENT/YESNO,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
          Please check that all the weld data sheet info is correct
          Thank you
          
          "Inspectors Initials "+ C1.INPUT
          
          "Finish S/N "+C2.INPUT
          
          "Forging S/N "+C3.INPUT
          
          "Forging Heat Code "+C4.INPUT
          
          
          IF_GOTO/C55.INPUT=="NO",GOTO = L1
          $$ NO,
          Enter the part number and Forging Number in the ASSIGN/PART_PO variable for the weld data sheet
          
          ASSIGN/PART_NO=ARRAY("XXXXXXXXXXXXXX","XXXXXXX")
          ASSIGN/PROGNAM=GETTEXT("Part Name",0,"FILEHEDR")
          ASSIGN/PATH="J:\PCDMIS Reports\XXXXXXXXXXXXXX\\"
          ASSIGN/DT=ARRAY(SYSTEMDATE("__MM_dd_yyyy_"),SYSTEMTIME("_ hh_mm_ss_tt"))
          ASSIGN/MYFILENAME=PATH+PROGNAM + "_" + C2.INPUT+DT.1+DT.2+".PDF"
          ASSIGN/WELDSHEET=PATH+"XXXXXX"+"_"+C2.INPUT+".PDF"
          C30 =COMMENT/YESNO,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
          DO YOU WANT TO RUN SETUP?
          
          Note: (Must run setup if this is the 1st part ran or part has been moved.)
          IF_GOTO/C30.INPUT=="NO",GOTO = PROG
          PL_1 =FEAT/PLANE,CARTESIAN,TRIANGLE
          THEO/<0,-0.4846,-0.7798>,<-1,0,0>
          ACTL/<17.9677,12.1762,-25.2938>,<-0.9999972,-0.0016647,-0.0016734>
          MEAS/PLANE,3
          HIT/BASIC,NORMAL,<0,-10.6216,3.4037>,<-1,0,0>,<17.9566,22.8902,-29.3492>,USE THEO=YES
          HIT/BASIC,NORMAL,<0,-0.7717,-11.0817>,<-1,0,0>,<17.9939,0.6147,-29.4259>,USE THEO=YES
          HIT/BASIC,NORMAL,<0,9.9395,5.3386>,<-1,0,0>,<17.9526,13.0236,-17.1063>,USE THEO=YES
          ENDMEAS/
          CI_1 =FEAT/CIRCLE,CARTESIAN,IN,LEAST_SQR
          THEO/<2.0073,0,0>,<1,0,0>,7.71
          ACTL/<19.7969,11.7499,-28.2745>,<1,0,0>,7.7162
          MEAS/CIRCLE,3,XPLUS
          HIT/BASIC,NORMAL,<2.0319,2.7363,-2.7155>,<0,-0.7098042,0.7043991>,<19.7976,13.0437,-24.6398>,USE THEO=YES
          HIT/BASIC,NORMAL,<1.9945,2.6597,2.7905>,<0,-0.6899288,-0.7238772>,<19.7966,7.9191,-28.7327>,USE THEO=YES
          HIT/BASIC,NORMAL,<1.9956,-3.8549,-0.0215>,<0,0.9999845,0.0055748>,<19.7965,15.5802,-28.7368>,USE THEO=YES
          ENDMEAS/
          PT1 =FEAT/POINT,CARTESIAN,NO
          THEO/<2.0073,10,0>,<1,0,0>
          ACTL/<19.7969,21.7499,-28.2745>,<1,0,0>
          CONSTR/POINT,OFFSET,CI_1,0,10,0
          MANALN =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
          ALIGNMENT/LEVEL,XMINUS,PL_1
          ALIGNMENT/ROTATE_CIRCLE,YPLUS,TO,CI_1,AND,PT1,ABOUT,XMINUS
          ALIGNMENT/TRANS,XAXIS,PL_1
          ALIGNMENT/TRANS,YAXIS,CI_1
          ALIGNMENT/TRANS,ZAXIS,CI_1
          ALIGNMENT/END
          PROG =LABEL/
          MODE/DCC


          Then i throw this bad boy at the end to make the report and populate it with my inputs from before:

          Code:
          CS2 =REPORT/CUSTOM, FILENAME=XXXXXXXXXX, Section=-1
          PARAM/TEXT_1.TEXT=C2.INPUT
          PARAM/TEXT_2.TEXT="*"+C2.INPUT+"*"
          PARAM/TEXT_3.TEXT=C3.INPUT
          PARAM/TEXT_4.TEXT="*"+C3.INPUT+"*"
          PARAM/TEXT_5.TEXT=C4.INPUT
          PARAM/TEXT_6.TEXT="*"+C4.INPUT+"*"
          PARAM/TEXT_7.TEXT=PART_NO.1
          PARAM/TEXT_8.TEXT="*"+PART_NO.1+"*"
          PARAM/TEXT_9.TEXT=PART_NO.2
          PARAM/TEXT_10.TEXT="*"+PART_NO.2+"*"
          PARAM/TEXT_27.TEXT="FULL"
          PARAM/TEXT_28.TEXT="*"+"FULL"+"*"
          PARAM/BARCODEWIZ1.BARCODE=C2.INPUT+","+PART_NO.1+","+C3. INPUT+","+PART_NO.2+","+C4.INPUT+",FULL"
          PARAM/=
          ENDCUSTOM/
          Looks like this:

          Header.PNG


          Minus the scribbles... of course
          Last edited by Blockay; 10-08-2020, 12:06 PM.

          Comment


          • DeWain Hodge
            DeWain Hodge commented
            Editing a comment
            But I like the scribbles

        • #9
          Here is the code I finally got to work.

          Code:
           $$ NO,
          ************************************************** *************************************
          ************************************************** *************************************
          ************************************************** *************************************
          PART FORM DATA
          ASSIGN/PN="PART NAME HERE"
          ASSIGN/DN="DRAWING NUMBER HERE"
          ASSIGN/DR="DRAWING REV HERE"
          ASSIGN/JOB=""
          ASSIGN/OPER=""
          ASSIGN/PART=""
          CS1 =FORM/FILENAME= Z:\CMM PROGRAMS\JOBDATA.FORM
          PARAM/JOB1.TEXT=JOB
          PARAM/NAME1.TEXT=OPER
          PARAM/PART1.TEXT=PART
          PARAM/=
          ENDFORM/
          And my form looks like this.

          Capture.JPG
          DeWain Hodge

          Comment


          • #10
            Now I just need to figure out how to force the form to not allow operators to continue without entering data in the boxes. I would also like to figure out how to put a continue button in the form.
            DeWain Hodge

            Comment


            • #11
              DeWain, there is a very good tutorial in the Help file on how to do exactly what you want:

              Step 5: Add Code to the Continue button
              1. Select the Button object, cmdContinue, and access its properties.
              2. Click on the EventClick event. The VBS Mini Editor appears.
              3. In this code window, type this code:
              If cboUsers.Value>0 And Len(txtDescription.Text)>0 And Len(txtMeasure.Text)>0 Then
              TheView.Cancel
              Else
              MsgBox "Please fill out the entire form before continuing."
              End If
              1. Click OK. The mini editor closes.
              2. Select File | Save to save the form.
              3. Test your report by pressing Ctrl + E and entering run mode. Click the Continue button.
              This code runs when you click the Continue button. It checks to make sure the form is all the way filled out, and if it is, it closes the Form Editor. If not, it displays a message telling the user to fill out what's missing.
              • The Len ( ) function tests the length (or the number of characters) for the text string in the edit boxes, making sure something is there.
              • The cboUsers.Value > 0 code checks to make sure a user name gets selected from the list.
              The code is 'generic' but am sure you'll be able to tweak it to your tastes.

              Comment


              • DeWain Hodge
                DeWain Hodge commented
                Editing a comment
                Thank you very much. Worked like a charm with very little tweeking.

            Related Topics

            Collapse

            Working...
            X