We have set RowSizingAutoMaxLines to 10 for screen display. But for grid report, we'd like to display all info, is there a way to reset RowSizingAutoMaxLines for grid report.
Thanks,
Crystal.
Hi Crystal,
What exactly do you mean by "grid report?"
If you are printing or exporting the grid, then there are events you can trap where you will be passed in a clone of the grid's DisplayLayout and you can modify the properties on the layout without affecting the on-screen grid.
The events to use would be things like InitializePrint, InitializePrintPreview, BeginExport, etc. But without knowing what kind of report you are talking about, it's hard to give you a clear answer.
Thanks Mike, I am trying to modify print display layout in InitializePrint event handler. I'd like to know which value to use to remvoed the RowSizingAutoMaxLine limit.
Hi Mike,
I tried to use ResetRowSizingAutoMaxLines in both InitializePrintPreview and InitializePrint event handlers, Not all data displayed in first page, large row is still cut, rows in other pages are displayed correctly in report print preview and printed report.
If I removed the RowSizingAutoMaxLines setting in InitializeLayout, all data in all rows are displayed in report, but we need to set the property to limit the row height in screen.
Hm, I don't see how that can be. Can you post a small sample project demonstrating this so I can take a look?
Hi Mike, I am able to reproduce the issue in a sample project, please see attachment. Thanks a lot for looking into it.
It's using VS2008 V9.0, infragistics2 v9.2
Crystal
Okay, I see the problem. If you just run the sample and click the button you will see that it is actually working, but only for the rows that are not on-screen initially. This is because the rows don't get re-sized when you print. So the rows that are already on-screen on using their on-screen sizes when printing. The other rows have not yet been created yet (since they are not visible) and they get created when you print, at which time the RowSizingAutoMaxLines has been reset, so it works okay for those rows. So what you have to do is force the print rows to be autosized again when printing.
private void ultraGrid1_InitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Band.Layout.IsPrintLayout) { e.Row.Band.Layout.Override.ResetRowSizingAutoMaxLines(); e.Row.PerformAutoSize(); } }
Thanks a lot, Mike. It works fine now after I added the code in.