We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Print virtual grid into many grids

Thread ID:

Created:

Updated:

Platform:

Replies:

18205 Aug 25,2004 09:06 PM UTC Sep 27,2004 02:20 AM UTC WinForms 4
loading
Tags: GridControl
Dan
Asked On August 25, 2004 09:06 PM UTC

I have a virtual grid that displays a subset of data based on a tab control selection by the user in the GUI. When it''s time to print however, I need to print the grids for each tab, on sucessive pages. In other words, programatically print the first grid (possibly multiple pages - I have that part working), then simulate that the user clicked on the next tab, print that grid, 3rd tab, etc. In the GUI, when the user clicks a tab, I refresh the virtual grid, so it gets redrawn using the different underlying data. When printing however, can I continue a print flow (ev.HasMorePages = true), and somehow refresh the grid, causing the grid printing mechanism to start over at row 1 of the virtual grid for the next subset of data? Make any sense? Thanks!

Administrator [Syncfusion]
Replied On August 26, 2004 05:13 AM UTC

If you want the printout to appear as on continuous flow (meaning row 1 of the second grid be displayed immediately under the last row of the first grid as if the two rows were in the same grid), then I think the simplest way to handle this is ''do a fake merge'' of all the grids into the first grid. If you want the second grid to start on its own page, then I would suggest just printing the second grid after the first grid has been completed by just restarting the print process again, for each subsequent grid. By a ''fake merge'', I mean setting a flag to indicate you are printing the grids. Then in your QueryCellInfo and QueryRowCount (and maybe QueryColCount), you can have a conditional case where you set the values as if the virtual datasource contains all three datasources. So, in QueryRowCount, the return value would be the sum of the rowcounts of the 3 datasources. In queryCellInfo, you would check the value of e.RowIndex and determine whether the value comes from datasource1, or datasource2 or datasource3, and set e.Style to the appropriate value from the appropriate datasource. (I think this sounds more complicated than it actually is when you start trying to do it.) Then when you start a print, you would set your flag, and call grid1.ResetVolatileData. This should trigger grid1 using the combined virtual datasources. After the print has finished, reset the flag and call resetvolatiledata again.

kgpsan
Replied On September 24, 2004 06:45 AM UTC

Burch, can you please provide a sample for the above method which you have mentioned, Thanks in advance. Kgpsan >If you want the printout to appear as on continuous flow (meaning row 1 of the second grid be displayed immediately under the last row of the first grid as if the two rows were in the same grid), then I think the simplest way to handle this is ''do a fake merge'' of all the grids into the first grid. > >If you want the second grid to start on its own page, then I would suggest just printing the second grid after the first grid has been completed by just restarting the print process again, for each subsequent grid. > >By a ''fake merge'', I mean setting a flag to indicate you are printing the grids. Then in your QueryCellInfo and QueryRowCount (and maybe QueryColCount), you can have a conditional case where you set the values as if the virtual datasource contains all three datasources. So, in QueryRowCount, the return value would be the sum of the rowcounts of the 3 datasources. In queryCellInfo, you would check the value of e.RowIndex and determine whether the value comes from datasource1, or datasource2 or datasource3, and set e.Style to the appropriate value from the appropriate datasource. (I think this sounds more complicated than it actually is when you start trying to do it.) Then when you start a print, you would set your flag, and call grid1.ResetVolatileData. This should trigger grid1 using the combined virtual datasources. After the print has finished, reset the flag and call resetvolatiledata again. > >

Administrator [Syncfusion]
Replied On September 24, 2004 07:29 PM UTC

Here is a sample that prints two grids as one using a virtual grid. Print2GridsAsOne_3573.zip

kgpsan
Replied On September 27, 2004 02:20 AM UTC

Thanks, it worked fine.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;