Hi,
I want to create a report that has two different sections which takes different columns from an unique grid.
It fetches the data from a parent grid and I fetch the desired columns with initializelayout of the child grid, then at the event of a click of the button I create my report with the print settings and my section and export it using UlltraGridDocumentExporter.
I thought I could create two different sections, but exporter only gives me the first and not the second.
I also ask if it is possible to rotate (perhaps using the report rotator or another solution) my grid to create a double-sided A6 sheet
I hope I have been thorough in my question and I apologize if I misspelled but English isn't my first language
Hello Ca,
I have been investigating into the behavior you are referring to, and it is possible to export your grid objects to different sections using the UltraGridDocumentExporter. There is an overload to the Export method that takes an ISection, and so if you were to create your report first, and then add a section to it, you could then export to that particular section, like so:
Report report = new Report(); var section1 = report.AddSection(); var section2 = report.AddSection(); ultraGridDocumentExporter1.Export(ultraGrid1, section1); ultraGridDocumentExporter1.Export(ultraGrid2, section2);
Regarding the “A6” sheet, I am not familiar with that type of Report, but it sounds like you are looking to be able to rotate the grid on the back of the page. I am not sure the IRotator will help you here, but since you have mentioned in another forum thread that you are getting a unique set of columns, I would recommend reorganizing those columns in your UltraGridBand such that they are essentially reversed.
I hope this helps. Please let me know if you have any other questions or concerns on this matter.
It's important to note that the UltraGridDocumentExporter assumes that the section it's exporting into is dedicated to the grid. If the grid is wider than the page, the UltraGridDocumentExporter will adjust the width of the section so that all of the columns in the grid fit on one page horizontally. So you should never export 2 grids to the same section. And if you have other content to include in the report, it should probably go into it's own section apart from the grid's sections.
So do you suggest I do another report and link it to that one ultra grid document exporter? Could this solve my problem? Thanks for your help
In order to add “free text” under the grid, I would simply recommend that you use the AddText or AddQuickText methods off of the section that you are exporting your grid to. I see that you are doing this already with the ISectionFooter, but the footer will show at the bottom of the page.
Regarding getting the summary values, these can be retrieved from the UltraGrid.Rows.SummaryValues collection. For example, if you had only a single SummaryValue, you could get it using the following code:
var value = ultraGrid1.Rows.SummaryValues[0].Value;
Please let me know if you have any other questions or concerns on this matter.
I don’t believe Mike’s recommendation would necessarily be to export to two different reports, but rather just to not export multiple UltraGrids to the same section within the same report. The code snippet I had provided above demonstrates this with the overload of the Export method that takes a section of a report, in that I am exporting each grid to a different section of the same Report object.