Пример #1
0
        private bool CopyReportDefinition2Doodle()
        {
            try

            {
                report = new DoddleReport.Report(reportOutput.Tables[0].ToReportSource());

                report.TextFields.Title    = string.Format(@"<h1 style=""text - align: center;""><strong>{0}</strong></h1>", Definition.Title.Text); // "Products Report";
                report.TextFields.SubTitle = Definition.SubTitle.Text;                                                                               //"This is a sample report showing how Doddle Report works";
                report.TextFields.Footer   = "Copyright 2021 &copy; The Beep Project";                                                               //Definition.Footer.Text;//
                report.TextFields.Header   = Definition.Header.Text;

                //            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;
                if (reportOutput.Tables[0].Rows.Count > 0)
                {
                    foreach (ReportBlockColumns item in Definition.Blocks[0].BlockColumns.Where(o => o.Show == true))
                    {
                        report.DataFields[item.ColumnName].Hidden = false;
                    }
                }



                DMEEditor.AddLogMessage("Success", $"Copying Report Data", DateTime.Now, 0, null, Errors.Ok);
                return(true);
            }
            catch (Exception ex)
            {
                string errmsg = "Error in Copying Report Data";
                DMEEditor.AddLogMessage("Fail", $"{errmsg}:{ex.Message}", DateTime.Now, 0, null, Errors.Failed);
                return(false);
            }
        }
Пример #2
0
 public DoodleReportGenerator()
 {
     report = new DoddleReport.Report();
     report.RenderingRow += Report_RenderingRow;
 }