August 20, 2004 04:06 AM
I think the point of that forum thread was to clip the grid so not all of it would show.
If you want to see the grid printed across multiple pages showing headers on each page, why are you not using the standard grid support for printing which prints across multiple pages showing headers on each page? You can see this in any of the grid\samples\CellTypes samples with the PrintPreview button. Or, it is also discussed in this kb. http://www.syncfusion.com/Support/article.aspx?id=10067
August 20, 2004 08:21 AM
We would certainly like to use the GridPrintDocument, however, we have multiple grids displayed on a form and many of them span a few pages (widthwise).
Ultimately what I would like is to print all grids as they appear in the gui. Basically, the user could take the printed pages and paste them together to see what they can see on the gui.
If I could clip certain pieces of the grid, then I can build this image myself. But, (as in the example) this is not working for us.
Can you help with this, or do you have an idea of another approach we can use to accomplish this task?
August 20, 2004 09:26 AM
In you code, the reason the headers are clipped is because of these two lines.
m_prGrid.GridBounds = new Rectangle(0, 0, 600, 300);
e.Graphics.IntersectClip(new Rectangle(10, 10, 700-50, 700-50));
The grid starts at location 0,0, but your clipping rectangle is soecified to start at 10, 10. So, a little piece of the headers is being clipped. If you change teh grid''s location to start at 10,10, the grid will no longer be clipped. One other thing that that you need to do is to call m_prGrid.ResetGridBounds(); at the bottom of the OnPrintPage code to make sure the grid bounds is reset to the defaults for the next time the grid is drawn.
But I don''t think this will be an easy way to draw serveral grids across several pages. I think hiding columns will be simpler. I will try to post a sample later in the next couple of days on how you might do this with hidden columns.
August 20, 2004 10:07 AM
Thanks for your help on that, I will try that.
Aslo, I was looking at the sample you pointed us to, and I think we can solve our problem, by temporarily adding all our grids to a single grid using the example Grid In Cells. That is what is done in the GridsinCells examples and it works great.
However, in the example, all the grids appear on a single page. I changed the sample so that the 20x20 grid spans from colums 2-13. When I did that and then clicked on PrintPreview, and looked at the second page in the Preview, the 20x20 grid does not appear correctly (some columns and rows do not appear).
If there is anything I can do to fix this, this will help us resolve this issue.
Also, if you cannot reproduce this, I can send you the modified code I have of the sample.
August 20, 2004 03:48 PM
Here is a sample that displays a grid in a particular rectangle on the output page and allows it to print on additional pages.