locked
printing gets cut off using .exe RRS feed

  • Question

  • Hi All,

    i've created a vfp 9.0 program that prints 4 labels across a page for a total of 13.6" across.  It works great from my laptop, but when I create an exe to be used on other workstations, it cuts the print off at 8.5".  I'm stumped as to why it doesn't print properly on other workstations.  Anyone have a solution?

    Thanks, Doug

    Tuesday, November 12, 2013 9:17 PM

Answers

  • Don't know if this would help, but sometimes when I have specific printer/paper requirements on different computers, I exclude the report form from the EXE and put a local copy of the report on each workstation.  When the report runs, based upon the workstation/printer, I load printer specific parameters into the Expr field of the report, and then run the report.  It's a bit complicated, but it does work.

    Kevin Clark

    Wednesday, November 13, 2013 7:14 PM
  • I would put the report file in the same directory as the executable on each workstation.  What I generally do to generate the proper settings is set up my report for each printer with the settings I want and then save the report with those printer settings.  After saving, you can open the report as a database and pull all the settings out of the EXPR column of the first record.  Those are the settings that you will copy back for each of your different printers.

    Once you have all the settings, you determine at runtime which settings you need to copy back into the report file EXPR column based upon the selected or default printer.

    You also have to remember to exclude your report from your executable, or it won't use the external file.

    The printer data usually includes many settings, which might not all be needed, but I copy them all in rather than worry about what might be extraneous. The data looks something like this:

    DRIVER=winspool
    DEVICE=\\RECORDS3XP\HP LaserJet 4100 Series PCL
    OUTPUT=LPT1:
    ORIENTATION=1
    PAPERSIZE=1
    ASCII=0
    COPIES=1
    DEFAULTSOURCE=259
    PRINTQUALITY=600
    COLOR=1
    DUPLEX=1
    YRESOLUTION=600
    TTOPTION=3
    COLLATE=1

    Wednesday, November 13, 2013 10:01 PM

All replies

  • This depends on printers and paper sizes available at each computer. Do you have all laptop printers installed on all computers around?
    Tuesday, November 12, 2013 11:00 PM
  • Also,

    Make sure that your report doesn't store a specific printer 

    USE <<reportname>>.FRX

    Look at the fields EXPR, TAG, TAG2

    Tuesday, November 12, 2013 11:21 PM
  • how will the program know which printer to print to?  and does it matter that i'm using a label instead of a report?  the first row in all those fields does refer to the specific printer.
    • Edited by dougerstew Tuesday, November 12, 2013 11:33 PM
    Tuesday, November 12, 2013 11:29 PM
  • almost certain the printers are the same on the other computers.
    Tuesday, November 12, 2013 11:32 PM
  • If there is some information in EXPR, TAG or TAG2, most probably will look for those printers.

    If they are blank or empty (what you should do) if will look for the default printer

    Tuesday, November 12, 2013 11:33 PM
  • But i want the print jobs to go to specific printers.  my program asks the user to pick 1 of 3 printers, and none of those is the default printer on any of the workstations using the program.
    Tuesday, November 12, 2013 11:44 PM
  • You can always set <<SET PRINTER TO [PRINTER NAME]>> and then <<REPORT FORM [report name] TO PRINT>>
    Wednesday, November 13, 2013 12:14 AM
  • i'll give those suggestions a try.  so just delete the references to the printer name?  there are also references to the network ip address of the printers.  should I remove those too?

    Wednesday, November 13, 2013 12:24 AM
  • i appreciate all your thoughts, but it didn't change anything.  Any other ideas?

    thanks,

    Doug

    Wednesday, November 13, 2013 1:06 AM
  • By the measurements you've given it sounds as if you are printing landscape 13.6" across on your PC, but portrait 8.5" when you print from another computer. You need to set and store the page orientation in the label.  Look under Properties | Page Layout


    The English Bob

    Wednesday, November 13, 2013 10:01 AM
    Answerer
  • thanks for your thoughts, Bob.  On my laptop it is portrait 13.6, so i don't this that is the issue.  I can have the user manually change the settings with the prompt command in label form, but I'd like to try to avoid this.

    Any other thoughts?

    Wednesday, November 13, 2013 5:58 PM
  • Seems to be you are using a different paper size.

    Is possible the paper size is not register on the user's computer or the user's server.

    Registering the new paper size into the server would be enough for everybody to load the settings; also, you will have to register that paper size for all the printer that will use them

    Wednesday, November 13, 2013 6:30 PM
  • Also, look at my following example. I created a report file where I changed the paper size to 13x18

    if I open the frx file (as dbf) I will see on (1st record) EXPR field....    PAPERSIZE, ORIENTATION, etc.

    Wednesday, November 13, 2013 6:39 PM
  • Don't know if this would help, but sometimes when I have specific printer/paper requirements on different computers, I exclude the report form from the EXE and put a local copy of the report on each workstation.  When the report runs, based upon the workstation/printer, I load printer specific parameters into the Expr field of the report, and then run the report.  It's a bit complicated, but it does work.

    Kevin Clark

    Wednesday, November 13, 2013 7:14 PM
  • Why dont you create/have two versions of the report in the EXE, and call them based on settings or options?.

    The EXE will always run what is inside the Project, including reports, paths, etc

    Wednesday, November 13, 2013 7:23 PM
  • I'll try that Kevin.  where on the local workstation do you put it?  Does the expr field need both printer name and print size?

    Wednesday, November 13, 2013 7:36 PM
  • I would put the report file in the same directory as the executable on each workstation.  What I generally do to generate the proper settings is set up my report for each printer with the settings I want and then save the report with those printer settings.  After saving, you can open the report as a database and pull all the settings out of the EXPR column of the first record.  Those are the settings that you will copy back for each of your different printers.

    Once you have all the settings, you determine at runtime which settings you need to copy back into the report file EXPR column based upon the selected or default printer.

    You also have to remember to exclude your report from your executable, or it won't use the external file.

    The printer data usually includes many settings, which might not all be needed, but I copy them all in rather than worry about what might be extraneous. The data looks something like this:

    DRIVER=winspool
    DEVICE=\\RECORDS3XP\HP LaserJet 4100 Series PCL
    OUTPUT=LPT1:
    ORIENTATION=1
    PAPERSIZE=1
    ASCII=0
    COPIES=1
    DEFAULTSOURCE=259
    PRINTQUALITY=600
    COLOR=1
    DUPLEX=1
    YRESOLUTION=600
    TTOPTION=3
    COLLATE=1

    Wednesday, November 13, 2013 10:01 PM
  • If you have the printer you want on all workstations or PCs. Then set the printer and page size on your laptop and save the printer environment and then build the exe. 
    Thursday, November 14, 2013 9:20 AM
    Answerer