Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cesar
  Where is Cesar?
 
 Brazil
 Cesar
 To: mohammed qasem
  Where is mohammed qasem?
 amman
 Jordan
 mohammed qasem
 Tags
Subject: RE: print chart
Thread ID: 248704 Message ID: 248706 # Views: 1 # Ratings: 3
Version: Visual FoxPro 9 Category: Reports and Printers
Date: Tuesday, December 22, 2009 12:42:07 PM         
   


> hi all,
>
> i need help to set the printer as landscape or portrait to print the chart
>
> i use this code
>
> LOCAL loBmp as xfcBitmap
> loBmp = Thisform.Foxcharts1.oBmp
>
> loBmp.ToPrinter()
>
> thanks

Hi Mohammed,

Definitely, the most recommended way to print charts is using the ReportDesigner, and using the DrawReport() method.

.ToPrinter() may fail in some situations, for some printers it sometimes does not work at all.

Anyway, below are the parameters available for the ToPrinter() method:

Parameters: tnStretch, tcPrinterName, tnOrientation, tnAlignment

     tnStretch
     *   Specifies how an image is sized to fit inside a control.
     *   0 - Clip. The image is clipped to fit the page. (Default)
     *   1 - Isometric. The image resizes to fit the page while maintaining its original proportions.
     *   2 - Stretch. The image resizes to fit the page, but does not maintain its original proportions.
                        
     tcPrinterName
     *   Specifies the name of the printer, the same of GETPRINTER()
                        
     tnOrientation:
     *   0 - Portrait
     *   1 - Landscape
                        
     tnAlignment
     *   Specifies a numerical value representing the alignment of the image in the page.
     *   0 - Vertically Centered Left.
     *   1 - Vertically Centered Right.
     *   2 - Centered. Centers image vertically and horizontally.
     *   4 - Top Left. Aligns image in top left corner of the page.
     *   5 - Top Right. Aligns image in top right corner of the page.
     *   6 - Top Center. Aligns image at the top and horizontally centered on the page.
     *   7 - Bottom Left. Aligns image in the bottom left corner of the page.
     *   8 - Bottom Right. Aligns image in bottom right corner of the page.
     *   9 - Bottom Center. Aligns image at the bottom and vertically centered on the page.
  
     Returns: Nothing




Regards,

Cesar
My Blog

ENTIRE THREAD

print chart Posted by mohammed qasem @ 12/22/2009 12:27:20 PM
RE: print chart Posted by Cesar @ 12/22/2009 12:42:07 PM
RE: print chart Posted by Cesar @ 12/23/2009 10:38:56 AM
RE: print chart Posted by mohammed qasem @ 12/23/2009 1:20:43 PM
RE: print chart Posted by Cesar @ 12/23/2009 2:20:11 PM
RE: print chart Posted by mohammed qasem @ 12/24/2009 8:24:34 AM
RE: print chart Posted by Cesar @ 12/24/2009 11:41:55 AM
RE: print chart Posted by mohammed qasem @ 12/24/2009 12:08:05 PM