This project has moved and is read-only. For the latest updates, please go here.

Multiple Sheet in OpenXml through Doodle

Sep 19, 2013 at 9:40 AM
I want to create multiple sheet in exported excel from Doodle. The columns in each sheet are different.

I am currently using the DoddleReport.OpenXml.ExcelReportWriter .

Please advise if this functionality is possible through doodle.

Thanks for the help in advance.
Oct 9, 2013 at 7:32 PM
Yes, it's possible. Here's an example that will create a report with three sheets. This code is from an controller method.

            // Let's assume these are enumerables (or anything else with ToReportSource extenstion implemented)
            var results1;
            var results2;
            var results3;

            var mainReport = new Report(results1.ToReportSource(), new ExcelReportWriter());
            mainReport.RenderHints["SheetName"] = "results1";

            var report2 = new Report(results2.ToReportSource(), new ExcelReportWriter());
            report2.RenderHints["SheetName"] = "results2";

            var report3 = new Report(results3.ToReportSource(), new ExcelReportWriter());
            report3.RenderHints["SheetName"] = "results3";

            var writer = new ExcelReportWriter();
            writer.AppendReport(mainReport, report2);
            writer.AppendReport(mainReport, report3);

            return new ReportResult(mainReport, writer);
Oct 10, 2013 at 6:12 AM
Thanks for the reply.

I tried this way but it is not working. it is only creating the excel with first sheet only.