Display of a variable inside a LABEL.

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

  • Display of a variable inside a LABEL.

    Can I display a variable inside a report label? V4.1 of course...

    I assign a variable, let's say V1, with the value "RGHT 412".

    I want to display the string in the REPORT header. How do I do that? I editted the FILE_HEADER.LBL . But what would the syntax be?

    Here are a few things I tried:

    V1
    =V1
    =V1()
    Maybe DEST_EXPR or something???

    None of them seem to take. They are all treated as a string.

    Anybody tried this before? Please let me know!



    Jan.
    Last edited by Jan d.; 10-18-2006, 04:09 PM.
    ***************************
    PC-DMIS/NC 2010MR3; 15 December 2010; running on 18 machine tools.
    Romer Infinite; PC-DMIS 2010 MR3; 15 December 2010.

  • #2
    Just found in the help files that you can NOT use variables in Labels. But you have to use something called a DATA_TYPE. Anybody knows how to do that????


    Jan.
    ***************************
    PC-DMIS/NC 2010MR3; 15 December 2010; running on 18 machine tools.
    Romer Infinite; PC-DMIS 2010 MR3; 15 December 2010.

    Comment


    • #3
      Jan,

      Yes, I don't believe you can pass a variable value into the Reporting window, at least not into the GridControlObject. You could put the variable into a comment and display the comment in the Report window. But that doesn't sound like what you want.

      What information exactly are you trying to get displayed in the header? There may be another way to do it.
      Jared Hess - Techwriter @ WAI
      [View Reporting Tutorials Here]

      Comment


      • #4
        Jan,

        A follow up on this. I couldn't figure out how to send a PC-DMIS variable value to a GridControlObject. I don't think this is possible.

        But, I did manage to send one to a Text property of a Text object in the Report Template (not a Label template).

        Here's how.
        1. Open the report template in the Report Template Editor.
        2. Add a Text object. I assume here it is named Text1.
        3. Save the template. I assume here it is named Test.rtp.
        4. Open up the Edit window into Command mode.
        5. Place your insertion point after the line where you have your V1 variable defined.
        6. Select Insert | Report Command | HyperView Report... .
        7. From the Insert Report Template dialog box ensure that Files of Type list reads Report Templates. Then select your report template and click Open.
        8. PC-DMIS inserts something like this into your part program:

          CS3=REPORT/FILENAME=C:\PCDMIS41RELEASE\REPORTING\TEST.RTP, AUTOPRINT=NO, Section=-1
          PARAM/=
          ENDREPORT/

        9. Place your cursor before the = sign and type TEXT1.TEXT and then after the equals sign type V1. So it should look like:

          PARAM/TEXT1.TEXT=V1

          This essentially tells your report template to assign to the TEXT1 object's Text property the value of the V1 variable.
        10. Mark the command and Execute the part program.
        11. View the Report window. You will see that the Text object initially contains the appropriate value.
        I don't know how useful this will be to you since this text value remains only after the initial program execution. This means if you redraw or change your report in any way, the passed in variable is removed and the text object is either removed or the value displays zero.

        Good luck,
        Jared Hess - Techwriter @ WAI
        [View Reporting Tutorials Here]

        Comment


        • #5
          I don't know about putting a variable in the header(since no variables are set at that point), but you can send literal strings to a grid object.

          1. Create a new label with a 1x1 grid control. Put in =SRC_EXPR
          2. Close it
          3. Edit the rule tree for your report. Under FlowControl, select ASSIGNMENT, add a new rule. Select "use additional expression" and put in something like DEST_EXPR=="REPVAR" and select to use your new label from step #1.
          4. Anywhere in your program using ASSIGN/REPVAR = "some string" will display that in the report

          Note: It should show exactly as shown in your .prg (it will not evaluate V1+V2).

          This is just to show how..as was pointed out, a comment is better suited.

          Comment


          • #6
            Originally posted by QCinTN
            3. Edit the rule tree for your report. Under FlowControl, select ASSIGNMENT, add a new rule. Select "use additional expression" and put in something like DEST_EXPR=="REPVAR"

            PC-DMIS keeps hanging up on this line. I can do all that you suggest, but when I enter DEST_EXPR=="REPVAR", it keeps hanging PC-DMIS.

            I have created the variable in the program and executed. I have also created the new Label. But when I enter this line in the FlowControl ASSIGNMENT, it always hangs the report generation.

            It seems though that you are able to do what I was trying to do. Any suggestions to fix this????



            Jan.
            ***************************
            PC-DMIS/NC 2010MR3; 15 December 2010; running on 18 machine tools.
            Romer Infinite; PC-DMIS 2010 MR3; 15 December 2010.

            Comment


            • #7
              Originally posted by JaredHess
              Jan,

              A follow up on this. I couldn't figure out how to send a PC-DMIS variable value to a GridControlObject. I don't think this is possible.

              But, I did manage to send one to a Text property of a Text object in the Report Template (not a Label template).

              Here's how.
              1. Open the report template in the Report Template Editor.
              2. Add a Text object. I assume here it is named Text1.
              3. Save the template. I assume here it is named Test.rtp.
              4. Open up the Edit window into Command mode.
              5. Place your insertion point after the line where you have your V1 variable defined.
              6. Select Insert | Report Command | HyperView Report... .
              7. From the Insert Report Template dialog box ensure that Files of Type list reads Report Templates. Then select your report template and click Open.
              8. PC-DMIS inserts something like this into your part program:

                CS3=REPORT/FILENAME=C:\PCDMIS41RELEASE\REPORTING\TEST.RTP, AUTOPRINT=NO, Section=-1
                PARAM/=
                ENDREPORT/

              9. Place your cursor before the = sign and type TEXT1.TEXT and then after the equals sign type V1. So it should look like:

                PARAM/TEXT1.TEXT=V1

                This essentially tells your report template to assign to the TEXT1 object's Text property the value of the V1 variable.
              10. Mark the command and Execute the part program.
              11. View the Report window. You will see that the Text object initially contains the appropriate value.
              I don't know how useful this will be to you since this text value remains only after the initial program execution. This means if you redraw or change your report in any way, the passed in variable is removed and the text object is either removed or the value displays zero.

              Good luck,
              Did not really work for me. I tried it the way you suggested and I got it to print, but then my Report Window becomes "unstable" and it starts to NOT show anything anymore, just a blank page. It comes out from the printer OK though.

              We track our parts not only by Part Name and Rev letter, but also by another tracking number called the NOR number. I want to add this tracking number to the FILE_HEADER.LBL. Obviously, I can hard code it into the label. This is what I did until now and it works great, see attached file. But I would like to be able to display this other tracking number side by side with the Name and the Rev based on a variable.

              The reason is that in NC, I can have the operator enter this variable into the CNC-machine control. Then suck it into PC-DMIS as a variable. Obviously, that is quite nice because I can have the CNC operator drive the output in PC-DMIS. And I know this works. But now how do I get that variable into the FILE_HEADER?????? Yes, I can get it into a comment. But that is not as clean. It belongs in the FILE_HEADER, if it can be done.....



              Jan.
              Last edited by Jan d.; 08-29-2007, 12:07 PM.
              ***************************
              PC-DMIS/NC 2010MR3; 15 December 2010; running on 18 machine tools.
              Romer Infinite; PC-DMIS 2010 MR3; 15 December 2010.

              Comment


              • #8
                Hi Jan,

                I asked around about this and I'm afraid that the functionality you want isn't available until next version (v4.2.). Rumor has it that in 4.2 you should be able to use report expressions to pull in any part program variable.

                Here's a possible workaround to get the value into a header if you don't mind typing in the tracking number and you don't mind the header showing up on every page. You can type the number during execution as a user-assigned property value of a text object. Here's how:
                1. Copy the GridReportObject inside file_header.lbl and paste it inside of your Report Template Editor.
                2. Add a third row to the GridReportObject.
                3. Drag a Text object on top of the third row where you want the tracking number to appear. Format the text object so it matches the GridReportObject.
                4. Select the Text object and select the user-defined check box next to the text property. (For info on this, type "User Assigned Properties" in the help file's index)
                5. Use the rule tree editor and ensure that the previous file_header.lbl doesn't get used (since you've placed the grid from that label directly into the Report Template Editor, you don't need it).
                6. Save the template and set it as your default template. Then reexecute.
                PM me if you have questions and I'll send you this test template by email.
                Jared Hess - Techwriter @ WAI
                [View Reporting Tutorials Here]

                Comment


                • #9
                  I just tried this. It seems to work, but this is not quite what I was after.

                  I heard the rumor that V4.2 might be released before the new year comes around (2007 that is). That would be perfectly fine for me.

                  Thanks for trying to get me an answer! I seem to hit on all the hard ones lately...


                  Thanks again, Jan.
                  ***************************
                  PC-DMIS/NC 2010MR3; 15 December 2010; running on 18 machine tools.
                  Romer Infinite; PC-DMIS 2010 MR3; 15 December 2010.

                  Comment

                  Related Topics

                  Collapse

                  Working...
                  X