Variables and Report Printing

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

  • Variables and Report Printing

    I am writing a program and want the report to automatically save.

    Here is what I have;

    -------------------------------

    ASSIGN/S="S1234_"
    ASSIGN/J="J12345_"
    ASSIGN/P="P12345_"
    C1 =COMMENT/INPUT,NO,FULL SCREEN=NO,
    ENTER Serial
    ASSIGN/REPORT_NAME="Location I want to save\"+S+J+P+C1.INPUT+".PDF"

    Then I have my program.

    Dimensioning.

    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE=REPORT_NAME,AUTO OPEN=ON,$ (I have ON selected just to test)
    TO_PRINTER=OFF,COPIES=1,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
    TO_EXCEL=OFF,$
    PREVIOUS_RUNS=DELETE_INSTANCES

    -------------------------------

    Seems to work fine, until it opens the window to save the .pdf and the location isn't correct. Any idea what could be causing this?

  • #2
    If you add backslashes to a path string, they need to be double slashes ("C:\DOCUMENTS\PRIVATE_STASH"-->"C:\\DOCUMENTS\\PRIVATE_STASH")

    Comment


    • stkenitz
      stkenitz commented
      Editing a comment
      Single slashes work on a local destination. However the folder I want is network based. I will try the double slashes soon though.

  • #3
    Right click on the Print Command Click Edit, Make sure the Box is checked, Click on the 3 Dots and choose your Path, Click OK.

    Capture.JPG
    (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


    • stkenitz
      stkenitz commented
      Editing a comment
      File Path is correct, for whatever reason it just prompts a different drive.

  • #4
    If you're going to use a Print Command, DO NOT Set your Path under File/Printing/Report Window Print Setup or The Icon from the Top. This Icon.

    Capture1.JPG
    (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


    • stkenitz
      stkenitz commented
      Editing a comment
      Ok, I didn't...I went INSERT > REPORT COMMAND > PRINT COMMAND.

      Works perfectly working locally...but when I have the folder destination I want it prompts a save screen on a different network. But the report name variable with the address is correct.

  • #5
    I'm just curious, but if the location keeps failing, how can you be sure it's correct. I've seen a tiny space be in the file path cause this and to the human eye, it's almost undetectable. I'm just saying be careful about being over confident that the path is correct. What you are describing is what happens when the path is incorrect.

    Have you tried it with a simple location locally on the C drive just to test the it out? If that works, then change to the network location you want.

    It's very hard for us to guess what it might be when all you show is "location I want to save". There could be an error in there be we can't help you find it.

    Good luck
    PC-DMIS 2016.0 SP8

    Jeff

    Comment


    • stkenitz
      stkenitz commented
      Editing a comment
      Thanks for the help. I copy the address as text, and paste right into PC-Dmis. I have spaced through to make sure no extra symbols or spaces were thrown in.

  • #6
    I have the same issue here when people don't update the destination folder to match exactly the location the report should be saved to. I will have the destination folder open in Windows, right click the address bar, then click "copy address as text". I will then paste this into the print command while in command view. Then I add my variables to add the serial to the filename.

    It looks something like this.

    Code:
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE="S:\QA\CMM\Reports\CUSTOMER\PARTNUMBER_REV\JOBNUMBER\PARTNUMBER_REV_#"+V_SN+".PDF",AUTO OPEN=ON,$
    TO_PRINTER=OFF,COPIES=1,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
    TO_EXCEL=OFF,$
    PREVIOUS_RUNS=DELETE_INSTANCES

    Comment


    • #7
      I add a slash to the two initial ones. "\\\path"

      Comment


      • LostL
        LostL commented
        Editing a comment
        Good! It has to do with how PC-DMIS handles slashes in strings.

      • stkenitz
        stkenitz commented
        Editing a comment
        Makes sense. Thank you!

      • LostL
        LostL commented
        Editing a comment
        You're welcome!

    Related Topics

    Collapse

    Working...
    X