=SYS(1037) on VFP90 no longer allows printer changes

Can anyone tell me how to work around the changes in SYS(1037)   I used to call this with =SYS(1037) before printing in a batch (checks and invoices) and it no longer allows my customers to change the printer in VFP90 (no 'apply' button).  The 'prompt' option in REPORT FORM works just perfect too, but I don't want to call it in a loop (too repetative.)  Any ideas

Thanks


Answer this question

=SYS(1037) on VFP90 no longer allows printer changes

  • ImallocEx

    Using the 80 style report output, you can chain reports, but only when printing. Using the ReportListener output you can also preview chained reports.

    What kind of problems are you having with legacy reports using the new style output Is it something like numeric fields, long memos or just a combination of many slight differences


  • Ted Eiles

    In VFP9 both the "Print" and "Page Setup" dialogs were updated so that when run on Windows 2000 and higher they use the new style dialogs. SYS(1037) was always designed to be primarily a Page Setup dialog. In the new dialog you can still change the current printer using the "Printer..." button. However I suspect what you really want is the GetPrinter() function which can be used like this to change the current printer:

    SET("Printer",3)
    SET PRINTER TO NAME (GETPRINTER
    ())
     
    SET
    ("Printer",3)

    I hope this helps.

    Richard Stanton
    Software Design Engineer
    Microsoft : VS Data : FoxPro


  • TIrthma

    I had planned on looking into this more over the weekend.  Would your solution work if the reportengine was set to 80   I'm having trouble printing my legacy report forms with reportengine = 90. 

  • Surfertje

    The problem was solved by removing ALL references to the printer driver and setup in the report form itself.  Previous versions of VFP must not have been as 'pickey' (technical term) with regard to SYS(1037):

    Open *.frx with USE
    Find record with Objtype = 1 and objcode = 53 (usually the first record in the file)
    Replace tag with ""
    Replace tag2 WITH ""
    replace expr WITH ""

    Close with USE

    Now, the report does not fight any longer with the printer driver.

    Thanks to all for your help.

    Lynn

  • Edgar Stiles

    I use DOS based reports and print them to a window for my screen output.  I found them easier to read than the preview option.  I get some kind of a graph when calling a screen report and then the program freezes up.

    Thanks again and have a great weekend.

  • Aigarslv

    If you want to send multiple reports out as the same print job, then you can chain them using the NOPAGEEJECT clause. Then the setting from the first "Printer Prompt" are used for all the following reports. Does this help this problem

    ox = NEWOBJECT("ReportListener")
    ox.
    listenertype = 0
    REPORT FORM c:\foxtest\md_simple2 TO PRINTER PROMPT NOPAGEEJECT OBJECT ox
    REPORT FORM c:\foxtest\md_simple2 OBJECT ox


  • sewe

    Thanks, Ray, I will try CancelReport().  I did not include a 'nopageeject' on the succeeding pages.

  • Robin Grantham

    This solution seems to work, but the printer spools the print job until I quit my application.  I have been trying to research this prolem all afternoon, but can't find the answer.

    I placed the call:
    ox = NEWOBJECT("ReportListener")
    ox.
    listenertype = 0

    in my main calling program and the rest of your code in the specific form using a variable value to trigger the first report form call with 'prompt' for the first record then I changed the variable value to call the succeeding report form call for the rest of the records (I am printing checks).

    Thank you,
    Lynn


  • skt

    The last report in a chain should NOT have a NOPAGEEJECT. Otherwise it will leave the print job opened. This may be the problem you are seeing.
    Although if you are using a ReportListener, you can finish the print job by calling the CancelReport() method after the last report runs.


  • Scott Hodgin

    Thank you for the reply, but my customers have tried using the printer button, then selecting another printer, click 'OK' then the report prints to the default printer instead of the one they selected.

    I, however, will try your solution.  Again, thank you for your reply. 

    I just tested this solution and it does work if changing the printer is the only intent, however, some customers have to change the paper size to a custom size for check printing.  Is the any solution that will mimic the 'prompt' option in the report form command and allow all printer settings

    Thank you again.

  • =SYS(1037) on VFP90 no longer allows printer changes