public static void ReportData()
        {
            int totalProducts = 0;
            int totalOrders   = 0;

            // Get the data for the report (any IEnumerable or LINQ query will work)
            var query = ProductRepository.GetAll();

            // Create the report and turn our query into a ReportSource
            var report = new Report(query.ToReportSource());

            // Customize the Text Fields
            report.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 rendered
            report.RenderHints.BooleanCheckboxes = true;

            // Customize the data fields
            report.DataFields["Id"].Hidden = true;
            report.DataFields["Price"].DataFormatString        = "{0:c}";
            report.DataFields["LastPurchase"].DataFormatString = "{0:d}";

            //  Write now!
            var writer = new HtmlReportWriter();

            writer.WriteReport(report, HttpContext.Response.OutputStream);
        }
        public static void ReportData()
        {
            int totalProducts = 0;
            int totalOrders = 0;

            // Get the data for the report (any IEnumerable or LINQ query will work)
            var query = ProductRepository.GetAll();

            // Create the report and turn our query into a ReportSource
            var report = new Report(query.ToReportSource());

            // Customize the Text Fields
            report.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 rendered
            report.RenderHints.BooleanCheckboxes = true;

            // Customize the data fields
            report.DataFields["Id"].Hidden = true;
            report.DataFields["Price"].DataFormatString = "{0:c}";
            report.DataFields["LastPurchase"].DataFormatString = "{0:d}";

            //  Write now!
            var writer = new HtmlReportWriter();
            writer.WriteReport(report, HttpContext.Response.OutputStream);
        }
 public void GenerateHTMLReport()
 {
     using (var fs = new StreamWriter(this._saveFilepath)) {
         var writer = new HtmlReportWriter();
         writer.WriteReport(this._report, fs.BaseStream);
     }
 }
        public IErrorsInfo RunReport(ReportType reportType, string outputFile)
        {
            try

            {
                reportOutput            = new ReportOutput();
                reportOutput.Definition = Definition;
                reportOutput.DMEEditor  = DMEEditor;

                if (reportOutput.GetBlockDataIntoTables())
                {
                    CopyReportDefinition2Doodle();
                    switch (reportType)
                    {
                    case ReportType.html:
                        break;

                    case ReportType.xls:
                        break;

                    case ReportType.csv:
                        break;

                    case ReportType.pdf:
                        break;

                    default:
                        break;
                    }
                    FileStream fileStream = new FileStream(outputFile + "." + reportType.ToString(), FileMode.Create);
                    outputstream = fileStream;
                    var writer = new HtmlReportWriter();
                    writer.WriteReport(report, outputstream);
                    OutputFile = outputFile + "." + reportType.ToString();
                    DMEEditor.AddLogMessage("Success", $"Creating Doddle Report", DateTime.Now, 0, null, Errors.Ok);
                }
            }
            catch (Exception ex)
            {
                string errmsg = "Error Saving Function Mapping ";
                DMEEditor.AddLogMessage("Fail", $"{errmsg}:{ex.Message}", DateTime.Now, 0, null, Errors.Failed);
            }
            return(DMEEditor.ErrorObject);
        }
        public void SaveReport(string fileName)
        {
            string ext = Path.GetExtension(fileName);

            if (ext == null)
            {
                return;
            }

            ext = ext.ToLower();

            var r           = this.CreateReport(fileName);
            var reportStyle = new ReportStyle();

            switch (ext)
            {
            case ".txt":
                using (var s = File.Create(fileName))
                {
                    using (var w = new TextReportWriter(s))
                    {
                        r.Write(w);
                    }
                }

                break;

            case ".html":
                using (var s = File.Create(fileName))
                {
                    using (var w = new HtmlReportWriter(s))
                    {
                        w.WriteReport(r, reportStyle);
                    }
                }

                break;

            case ".pdf":
                using (var w = new PdfReportWriter(fileName))
                {
                    w.WriteReport(r, reportStyle);
                }

                break;

            case ".rtf":
                using (var w = new RtfReportWriter(fileName))
                {
                    w.WriteReport(r, reportStyle);
                }

                break;

            case ".tex":
                using (var s = File.Create(fileName))
                {
                    using (var w = new LatexReportWriter(s, "Example report", "oxyplot"))
                    {
                        w.WriteReport(r, reportStyle);
                    }
                }

                break;

            case ".xps":
                using (var w = new FlowDocumentReportWriter())
                {
                    w.WriteReport(r, reportStyle);
                    w.Save(fileName);
                }

                break;

            case ".docx":
                using (var w = new WordDocumentReportWriter(fileName))
                {
                    w.WriteReport(r, reportStyle);
                    w.Save();
                }

                break;
            }
        }