Hi
I have a report that contains several section grids (section.AddGrid) and several pages that contain images (section.AddPage page.AddImage)
after writting a grid I did section.AddPageBreak to make sure that the next item will start on a new page , I found the following problem
if the last item was a grid then the AddPageBreak added an extra empty page to the end of the document.
If after a grid I called section.AddPage for an image , then inbetween there was an empty page.
My understanding of AddPageBreak was to make sure that the NEXT item will start from a new page but seems that it add a new page always.
my workaround was to call AddPageBreak before I start a new grid and ONLY if the previous item was also a grid but this is not clean code.
is there something more elegant I can do . something that will tell the section to start a new page BUT ONLY if there is something new to add.
Thanks.
How are you exporting the grid? Which overload of the export method are you using?
My guess is that this has something to do with sections. The grid exports to a new section. So when you export the grid, it will always start on a new page, anyway. Perhaps instead of adding a page break, you should create a section for each item you export and then call the Export method that exports to a section you supply?
Hi Mike
I dont know anything about export functions. All I do is create a single section
section = report.AddSection.
and then for each new grid call
grid = section.AddGrid
fill grid in
I tried without the page break and the grids dont start on new pages without the page break.
Oh, when you mentioned the grid, I assumed you were exporting an UltraWinGrid control. If you are just adding a grid to the section, then I'm not sure why the page breaksare working the way you describe. Perhaps you should Submit an incident to Infragistics Developer Support.
Include a small sample project demonstrating the behavior you are getting so they can check it out.
Will do
thanks.