Hi there,
Is it possible to merge 2 reports that have been saved to the file system using Report.Save(fileName)?
Regards,
Mark
I mean, apart from loading them into XDoc's and merging them manually...
I don't see any way to do that. You could, of course, create a single report with the information from both initially. But once you save them to a file, I don't see any way to load both reports into one.
Okay, thanks Mike.
If anyone stumbles across this and wants to know how I overcame it I wrote an Infragistics report xml merger that merges sections from multiple reports into a single report document, patches style names to avoid naming collisions. It works, but should be noted that it is slightly fragile as it will break if Infragistics greatly change the xml report format (ie, if Style, Section or Report elements are renamed) in future versions.
Note to infragistics: It would be great if you could enhance section handling in reports so that sections are available using an enumerator, and an override is provided to AddSection that can accept a new section retrieved from another document (styles would have to be pulled over as well)
Hi Mark,
Feel free to Submit a feature request to Infragistics.
The whole Documents assembly is currently designed to be forward-only, so you build your documents in a linear fashion, so that's why it doesn't expose collections of sections (or anything else). Which is not to say that it couldn't be done with indexers, enumerators, and collections.