none
SYS(1037) - Landscape/portrait printing

    Question

  • Program stub:

    CLEAR

    SYS(1037)   && set interactively to landscape

    SET PRINTER TO PRINTER

    SET PRINTER ON

    X="Canon printer test"

    @6,4 SAY x    && Should print landscape and does

    SET DEVICE TO SCREEN

    SET PRINTER TO   && causes eject

    SYS(1037)   && Set interactively to portrait

    SET DEVICE TO PRINT

    SET PRINTER ON

    @6,4 say x    && Should print portrait but prints landscape

    SYS(1037)   && Included to allow examination of status (portrait)

    SET DEVICE TO SCREEN

    SET PRINTER TO    &&  Causes eject

    RETURN

    QUESTIONS:  Why does the second page print landscape after the orientation has been returned to portrait?  Why does a blank page print after quitting VFP?  NOTE:  I have tried putting the SYT(1037) command after SET PRINTER ON but no difference.

    Thanks muchly.

    bookends623


    623bookends

    Monday, June 03, 2013 4:01 PM

Answers

  • Sorry I have to say that but you are asking at the wrong place probably...

    The only answer is: "Because Microsoft did not test this old fashioned printing sufficiently or the Canon printer is not compatible enough"...

    So what we can do? We may play with parameters and various commands used to control printers in VFP. Maybe some combination will print/change layout even on the Canon printer. BUT to create the report layout by CREATE REPORT and place one text field at given place is much easier and more reliable in VFP. Yes, you still can find OS/printer combination which will behave unexpectedly but with less probability...

    I'll test your code on Canon printer when flooding will end...

    • Marked as answer by 623bookends Wednesday, June 19, 2013 3:22 PM
    Monday, June 03, 2013 8:27 PM
    Moderator
  • The learning curve for creation of a report is HUGE, or so it appears to me. 

    Huge learning curve? Not at all. Basic reporting takes less than 40 minutes... See the following page: http://www.garfieldhudson.com/freevideos.aspx

    Sunday, June 09, 2013 3:41 PM
    Moderator

All replies

  • Sorry I have to say that but you are asking at the wrong place probably...

    The only answer is: "Because Microsoft did not test this old fashioned printing sufficiently or the Canon printer is not compatible enough"...

    So what we can do? We may play with parameters and various commands used to control printers in VFP. Maybe some combination will print/change layout even on the Canon printer. BUT to create the report layout by CREATE REPORT and place one text field at given place is much easier and more reliable in VFP. Yes, you still can find OS/printer combination which will behave unexpectedly but with less probability...

    I'll test your code on Canon printer when flooding will end...

    • Marked as answer by 623bookends Wednesday, June 19, 2013 3:22 PM
    Monday, June 03, 2013 8:27 PM
    Moderator
  • The Canon is brand new (10 days) and a current model.  And it is capable of changing from portrait to landscape.  But for some reason the change sometimes gets trapped perhaps by a buffer and doesn't reach the printer.  For example, the first change command works:  the printer goes from the default portrait to landscape.  But it won't go back to portrait.  This worked well on my old HP.  So much for printer improvements.

    I haven't given up yet.  Next I'm going to try the dual printer installation idea--one with portrait default and one with landscape default.  It might work and is worth a try.

    As for CREATE REPORT, I plan to dig into that as well.  Never know when a solution will be around the corner.  I have held back here because there are only 4 lines of print involved for each check and no database.

    Thanks again for your suggestions.

    Bookends623


    623bookends

    Monday, June 03, 2013 9:11 PM
  • If you have no database then you may create a cursor:

    SELECT 0
    CREATE CURSOR cDummy (SomeColumn char(10))
    APPEND BLANK
    *-- and now execute reports using just variables
    REPORT FORM YourPortraitReport
    REPORT FORM YourLandscapeReport
    USE IN cDummy && close the cursor

    BUT reading your last post I am not sure whether REPORT can help... This seems to be rather printer driver problem than anything else.

    Tuesday, June 04, 2013 7:24 AM
    Moderator
  • Bookends,

    I tried your code with a Brother printer. Could only get the first print send to work. Never got 2 pages printed. Second one always came out blank.  It therefore suggests this old method of printing is very much printer dependent.  Not a good way to continue. 

    I suggest like Pavel you move to creating a report - they are really very easy - and simple to control.  You will also get more support on forums like this one.

    Tuesday, June 04, 2013 9:08 AM
    Answerer
  • I'm still working on my check printing problem.  My Canon printer will not print check size without first changing the paper size setting in the printer.  It's quite a nuisance.  This can be done manually but should be capable of being done through the .PRG program.  Are you aware of any code or function which will permit setting of paper size?  It might work with envelope size if that could be done.

    As for the program itself, I've concluded that one change from portrait to landscape or from landscape to portrait can be done with SYS(1037) but there is no way to change it back without quitting VFP and restarting it.  Another nuisance.

    bookends623

     

    623bookends

    Friday, June 07, 2013 1:44 PM
  • Had you try:

    1) Create a report form?

    2) Print to a file, the entire report and once is finish, to send the file to the printer?

    Friday, June 07, 2013 2:25 PM
    Answerer
  • No, I have not tried a report.  This program is intended only to write checks by computer for use by a handicapped person.  There is no database involved and only 5 variables plus the current date.  The problem is the Canon printer since I used the same program with my old HP and it ran fine.  SYS(1037) works only once, ie, once the orientation is changed in a program SYS(1037) will not change it back.  Also, the Canon printer insists on the right size printer paper being present or the paper size needs to be manually changed.  That's too much like work and without some automation process (which was the reason for my post) the program isn't practical.

    bookends623


    623bookends

    Friday, June 07, 2013 9:25 PM
  • What is the problem to test two simple REPORT layouts one in portrait and the other one in landscape? It should take 30 minutes at most...
    Friday, June 07, 2013 9:45 PM
    Moderator
  • The learning curve for creation of a report is HUGE, or so it appears to me.  I have looked into it and for those who have the knowhow it probably would be no sweat.  But to create a report for the simple task I need to do is going after a fly with an elephant.  I think it would be easier (at least me me) to do it in Excel through use of a template.  No doubt in the long run I should learn how to create a report  but I'm not up to it now.  Nevertheless it is a good idea.

    bookends623


    623bookends

    Friday, June 07, 2013 10:05 PM
  • You can take a horse to water, but ......
    Saturday, June 08, 2013 9:38 AM
    Answerer
  • I agree.  You're absolutely right.  But it doesn't solve the problem.

    bookends623


    623bookends

    Saturday, June 08, 2013 2:15 PM
  • The learning curve for creation of a report is HUGE, or so it appears to me. 

    Huge learning curve? Not at all. Basic reporting takes less than 40 minutes... See the following page: http://www.garfieldhudson.com/freevideos.aspx

    Sunday, June 09, 2013 3:41 PM
    Moderator
  • Good idea.  The video was well done.  Thanks for the suggestions.

    bookends623


    623bookends

    Sunday, June 09, 2013 10:48 PM