DoddleReport generates tabular reports from any IEnumerable datasource.
Out of the box it can render reports to Excel, PDF, HTML, and CSV – fully pluggable of course. I designed the project to provide reporting output over the LINQ queries we had already written for the application, but maybe you can find other uses for it.
Blog Updates
For updates and other topics please visit my blog at http://www.matthidinger.com or follow@matthidinger
New to DoddleReport?
- Look at the Building Your First Report page
- If you’re using ASP.NET make sure to read the Web Reporting section
- Review the sample project in the solution
- Check out the full documentationfor advanced customization and configuration
Get it!
- The preferred install method is NuGet
- …but the compiled Binaries can be found under Downloads
- …or just get the latest source
NuGet Packages
DoddleReport has been split into multiple packages to support more users’ needs. See their Descriptions within NuGet for more on the differences
- Install-Package DoddleReport
- Install-Package DoddleReport.Web
- Install-Package DoddleReport.iTextSharp
- Install-Package DoddleReport.AbcPdf
- Install-Package DoddleReport.OpenXml
New in v1.2
- NEW WRITER: A new OpenXML ExcelReportWriter found in the DoddleReport.OpenXml package, courtesy of Louis-Philippe Perras
- NEW WRITER: A new iTextSharp PDF writer can be found in the DoddleReport.iTextSharp package, courtesy of Louis-Philippe Perras (thanks again!)
- Breaking change: The root namespace changed from Doddle.Reporting to justDoddleReport
- Breaking change: The Default Orientation for reports is now Portrait
- All Web references moved to separate project to allow for .NET Client Profile support for WinForms/WPF
- Added “myReport.RenderHints.BooleansAsYesNo = true” to write Yes/No on the reports for boolean fields
- Added custom FileName support for web reporting as requested in Discussions
- Added MVC Areas support by calling areaRegistrationContext.MapReportingRoute();
- Various Bug fixes and enhancements as reported in the Discussion forum and Issue Tracker
So what does it generate?
The following samples are generated live in real-time (notice the data will change every time you open the report)
Excel Report (OpenXML)
| Excel Report (HTML)
|
PDF Report (iTextSharp)
| PDF Report (ABCpdf)
|
CSV/Delimited
| HTML Report
|
Basic Usage
// Get the data for the report (any IEnumerable will work)var query = ProductRepository.GetAll();var totalProducts = query.Count;var totalOrders = query.Sum(p => p.OrderCount);// Create the report and turn our query into a ReportSourcevar report = new Report(query.ToReportSource());// Customize the Text Fieldsreport.TextFields.Title = "Products Report"; report.TextFields.SubTitle = "This is a sample report showing how Doddle Report works"; report.TextFields.Footer = "Copyright 2011 © The Doddle Project"; report.TextFields.Header = string.Format(@" Report Generated: {0} Total Products: {1} Total Orders: {2} Total Sales: {3:c}", DateTime.Now, totalProducts, totalOrders, totalProducts * totalOrders);// Render hints allow you to pass additional hints to the reports as they are being renderedreport.RenderHints.BooleanCheckboxes = true;// Customize the data fieldsreport.DataFields["Id"].Hidden = true; report.DataFields["Price"].DataFormatString = "{0:c}"; report.DataFields["LastPurchase"].DataFormatString = "{0:d}";