Using:Infragistics ver. 8.3.20083.2039, C#, VS 2008
Problem using UltraGridDocumentExporter
I have the following problem:
I have a grid with dynamic amount of columns.The columns are grouped. Every group consists of three columns.Every group has a caption and every column has a caption.
For print report I am using UltraGridDocumentExporter and it works fine (preview, PDF etc) - until the number of columns are to many and don't fit on one page (using paperorientation landscape).
Autmatic pagebreaks doesn't seem to be supported.
So I thought the use of .Hidden [e.g band.Groups[i].Hidden = true;] for groups and columns and modifying the current section and make pagebreaks after every third group and hide the groups/columns that not should be printed on just that page would be the solution.I also tried to hide column on "column-level" [band.Columns[i].Hidden = true;] ( That shouldn't really be necessary since I have hidden the group).
The groups are hidden in the grid on screen, but on the exported printout the group header caption will not hide.The columns are hidden, the pagebreaks [ section.AddPageBreak(); ] works fine, but the group header caption [ band.Groups[i].Header.Caption ] is still visible on the print out, and messes up the document - while it looks good on screen.
I must be able to restore the grid as it was before printing (that works fine) so don't want to remove the groups completely.
What can I possibly do wrong?
Hi,
I'm not exactly sure why that's happening. One odd thing I noticed is that you say you are hiding the group in the actual on-screen grid. That's unneccessary and probably not a good idea. You can modify the export layout without affecting the grid on the screen. And if you modify the on-screen grid's layout after the export begins, it won't have any effect on the export, since the Export layout will already be created at that point. Of course, this does not explain why it works for columns, but not bands.
Anyway, I'm attaching a small sample test project that I used to try this out and that works fine for me. Try running it and see what kind of results you get. If this sample doesn't work for you, then something is wrong with your version of the controls. Perhaps in that case, you just need to get the latest service release.
If my sample does work for you, then something in your real application code must be causing the issue.
Hi!
Thanks for answer. I just made a quick look and I have a question.
The sample code runs fine, but the result wasn't was I expected.
When I press the button I get Group A and Column 1.
The code says:
e.Layout.Bands[0].Groups[0].Hidden =
true;
Shouldn't it be B and Column 1 then?
Kind regards
Magnus R
Yes, but I run this sample, I see Group B. You must be using a different version that I am.
Strange... I can't find any obvious differences. When I compare our projects (your test-app and my app) under References it seem like we use exact the same version of Infragistics (8.3.20083.2039).
There was one thing though: I couldn't run your app with the license-file attached in the zip-file. I noticed your license-file refered to Version=8.1.0.9000, while the test-app has Version=8.3.20083.2039, so I replaced that licenses.licx to mine.
But I can't see why that would be problem.
Otherwise: Is there a simple way I can make pagebreaks when exported columns does'nt fit on one page, using UltraGridDocumentExporter?
Magnus R, Sweden
Hi Magnus,
tempmarab said:Strange... I can't find any obvious differences. When I compare our projects (your test-app and my app) under References it seem like we use exact the same version of Infragistics (8.3.20083.2039).
That doesn't mean anything. The project is just picking up the assemblies on your machine. The numbers there have on meaning in terms of the version I was using. I used the latest internal build to test this. So it's likely that you just need to update to the latest Hot Fix. It's possible that the version I have has not been released, yet, so you should check the Infragistics web site to see if there is a newer version available beyond 2039. My Infragistics Keys and Downloads - Download Anything and Everything You Own
I downloaded the latest hotfix 20083.2068 and that one worked fine.
Thanx
/MR