Skip to content

Understanding the key components

Matt Hidinger edited this page Apr 10, 2016 · 2 revisions

A Report relies on 2 distinct (and entirely extensible) mechanisms:

  • IReportSource - The Report must be supplied a collection of columns/rows using an IReportSource
  • IReportWriter - The Report needs to be written to a Stream using an IReportWriter

Report Sources

DoddleReport ships with all the Report Sources you should need, but even if it doesn't, you can write your own very easily by implementing a simple interface.

  • EnumerableReportSource - provides reporting for a variety of IEnumerable data types (including any .NET collection, LINQ queries, etc)
  • DataTableReportSource - provides reporting for any DataTable
  • [SPListReportSource](http://doddlereport.codeplex.com/wikipage?title=SharePoint) - provides reporting for any SharePoint List

Report Writers

The DoddleReport assembly ships with 3 types of Report Writers. The Extended report writers are included in stand-alone assemblies because they require additional libraries to function. You can write of course your own ReportWriters very easily by implementing a simple interface - and we would love if you could contribute them back to the project if so!

Default Report Writers

  • HtmlReportWriter - writes a basic HTML report
  • ExcelReportWriter - writes an Excel report using HTML internally. This will raise a confirmation prompt when the file is opened, telling the user that this is not a native Excel file. Use the OpenXML ExcelReportWriter described below if you want to avoid this.
  • DelimitedTextReportWriter – writes a delimited text file, the delimiter can be customized (the default is tab-delimited)

Add-On Report Writers (provided via stand-alone NuGet packages)

PDF

  • DoddleReport.iTextSharp.PdfReportWriter - writes a PDF report using iTextSharp. iTextSharp is an open source product at source forge, please check licensing to make sure it compllies with your project.

  • DoddleReport.AbcPdf.PdfReportWriter - writes a PDF report using ABCpdf (NOTE: this requires an ABCPdf license to function)

Excel

  • DoddleReport.OpenXml.ExcelReportWriter - this ExcelReportWriter uses OpenXML instead of the default ExcelReportWriter which uses HTML. This writer is also more robust than the default, but requires 2 additional assemblies to function (which will be included automatically if you use the NuGet install mechanism)