10409 : Printing size


I am wrestling with the parameters for printing the gantt chart.  I am trying to print on a 11 x 17 inch printer.  It prints in landscape mode correctly, but i want the image to take up the whole page.  Its stopping at about 7.5 inches horizontally.  Can u provide an example of how do to this?  Here is the code i am using:

LOCAL w as  long,h as long

thisform.gant1.printToDefault(1, 150, 5, 5,;
        thisform.Gant1.TopItemTree, -1, .f., ;
        thisform.Gant1.Start , ;
        thisform.Gant1.Stop  ,; 
        thisform.gant1.scalerHeight, @w, @h)  


The Gantt works on pixels and you need to convert your inches from the printer to points or pixels. This is done by asking the printer for its resolution (this is standard windows but different in most environments).

Once you know how many pixels you want to fill you have two choices…
1. Use the available space in scale 1 to 1 that probably gives you very small time items on paper: To do this you would provide values for treewidth and ScaleLen that covers the available number of pixels.
2. Keeping the Treewidth and Scalelength more or less the same as on screen but calculate a scaling factor to use to fill the space: To do this you would go like this scale=PrinterPixelsInTheXDirection/(treeWidth+ScaleLen) and then use the scale in the PrintToDefault ( where you now use the value 5)


Leave a Reply