Hi everyone,
I had to create a print document to display some data (I wish to display them into a table) but the problem is, I have too much columns to show, so they can't fit within one page.
I want to be able to display columns who don't fit on the first page on the second one, columns who don't fit on the second one on the third page and so on... Like an excel spreadsheet who is too wide to fit on one page.
Anyone knows how to do that?
I had already tried the "UltraWinGridPrintDocument" control, it works but that control doesn't let me change the layouts of the table...
No need to reply me, I've found a way to do what I had to do...
I've created a class who inherits of a .NET PrintDocument control and I have overloaded some print methods to create a document who is able to print a table with a lot of columns, (in my case about 30 columns) on many pages.
I didn't use to do that an Infragistics control but the same thing could be done with the UltraPrintDocument.
Hi,
Can you please give some clue about the approach that you have suggested. I am trying to do something similar. Currently If a column does not fit on page 1 of the grid , it still prints that clipped column on page 1 and again on second page it will re print the last chopped off column of page 1 . I would like to override this behaviour , so that if the column does not fit on page 1 , then print it only on page 2.
It's not really easy to explain by word but I'll try to do it short and simple.
I create my document one column at a time from top to bottom testing on each row if the row can be printed or not. If I can't I keep on a variable the index of the last row I've tried to print. After that I try to print all rows previously printed (I must keep a range of rows in some variables to not reprint from the first row of the grid).
For the other columns until I reach the edge of the page or right margin of the page. I keep the index of the last tried column and I create a new page to print all of the rows previously printed for the next columns.
After all columns has been printed, I create a new page to print remaining rows (last tried row variable) for all columns using the same pattern.
From the top to bottom and left to right.
If you need more explanations or a sample of code, just ask me I'll try to send a sample.
Did you get a reply on this? I am having the same issues with a datagridview control. I appreciate it!