Skip to content

Configuration via web.config

Matt Hidinger edited this page Apr 10, 2016 · 1 revision

DoddleReport supports a complete configuration section that you can use if you choose. It is not required that you add the below XML to your app.config or web.config. If you do decide to use it, you will be afford yourself some nice customization options including specifying your own writers all without any recompilation of your application.

If you wish to use the configuration features you will need to add the below XML in your <configSections>

<configSections>
  <section name="doddleReport" type="DoddleReport.Configuration.DoddleReportSection, DoddleReport"/>
</configSections>
<doddleReport defaultWriter="Html" dataRowStyle="DataRowStyle" headerRowStyle="HeaderRowStyle" footerRowStyle="FooterRowStyle">
  <styles>
    <style name="DataRowStyle" />
    <style name="HeaderRowStyle" bold="true" underline="true"/>
    <style name="FooterRowStyle" bold="true"/>
    <style name="Footer" italic="true"/>
    <style name="Title" fontSize="16"/>
  </styles>
  <writers>
    <clear/>
    <add format="Html" type="DoddleReport.Writers.HtmlReportWriter, DoddleReport" contentType="text/html;charset=UTF-8" fileExtension=".html"/>
    <add format="Text" type="DoddleReport.Writers.DelimitedTextReportWriter, DoddleReport" contentType="text/plain;charset=UTF-8" fileExtension=".txt" offerDownload="true"/>
    <add format="ExcelOpenXml" type="DoddleReport.OpenXml.ExcelReportWriter, DoddleReport.OpenXml" contentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" offerDownload="true" fileExtension=".xlsx"/>
    <add format="Excel" type="DoddleReport.Writers.ExcelReportWriter, DoddleReport" contentType="application/vnd.ms-excel" offerDownload="true" fileExtension=".xls"/>
    <add format="iTextSharpPdf" type="DoddleReport.iTextSharp.PdfReportWriter, DoddleReport.iTextSharp" contentType="application/pdf" offerDownload="false" fileExtension=".pdf" />
    <add format="AbcPdf" type="DoddleReport.AbcPdf.PdfReportWriter, DoddleReport.AbcPdf" contentType="application/pdf" offerDownload="false" fileExtension=".pdf"/>
  </writers>
</doddleReport>