Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing large charts on the Printer object

Status
Not open for further replies.

GPerk

Programmer
Jul 6, 2002
161
US
I have a table of data that fits nicely on one page. First I draw lines on the page to make a grid. Then I print the data in each box.
But sometimes the data has more items than will fit on one page. Then the first page prints with the grid, the excess grids prints on the second page, and then the data prints on page three and four.

OK, so I can fix this by printing the grid and data as I go, and it will print the extra grid and data on page 2. But this raises a more serious question - suppose I display a large chart (perhaps an organizational chart or a floor plan) on the screen. I can scroll it on the screen to see all of it. But how can I print such a chart on the printer when it won't fit on one page?
I would like to print, say the upper left quarter of the chart on one sheet, the upper right 4th on a second sheet, etc. and the sheets could be glued or taped together to complete the chart.
I have tried doing this by setting a Base X and Base Y and draw the lines and text so that only a portion of the chart is within the (0,0) - (1440*8.5,1440*10) box of the printer's 'visible' page, (that is, to print a middle page, I send data that goes from (-2880,-2880) to (5760,5760) ), but the printer seems to be trying to print everything at once, spitting out multiple pages with sundry parts of the chart.
Any suggestions?
 
This sort of strange printing behavior normally occurs when your X or Y value are off the limits of the actual page. This may seem like a stupid question.. but are you using printer.newpage?

ie...

Private Sub Button_Click
PrintPage 1
PrintPage 2
PrintPage 3
PrintPage 4
end Sub

Private Sub PrintPage (vPageNumber)
With Printer
.Currectx=X
.CurrectY=Y
'The rest of the printing code goes here
.NewPage
End with
end Sub
 
Yes, I was definitely sending X and Y values that were off the page. And I was using .Enddoc after each page.

But this highlights my apparent misconception about how the printer object works.
When I send graphics drawing commands to a form or picturebox, everthing that is not within the boundaries of the object is "clipped". This is one way of achieving scrolling of a large graphic object.
I assumed that the printer object does the same clipping. ???

To get around this problem, I now send the chart to a invisible picturebox which does the clipping, and then use Paintpicture to send the picturebox to the printer. This works, but it would be nice if the printer acted more like a picturebox.
Is there a simpler method?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top