Exemplo n.º 1
0
        /// <summary>
        /// Build report for DataGridView content.
        /// Call this method if you have already set all required parameters.
        /// </summary>
        /// <returns>Report</returns>
        public ReportBase GenerateReport()
        {
            _report = new ReportBase();

            Columns     = reportDataAdapter.GetColumns();
            TableGroups = reportDataAdapter.GetTableGroups(Columns);

            CreateHeaders();
            CopyRowData();

            reportBuilder.AddDataSource(_report.ExportedTable);
            reportBuilder.AddReportTable(_report.ExportedTable, Columns, TableGroups, reportDataAdapter.GetRowHeight());
            reportBuilder.AddEmbeddedImages(_report.GlobalEmbeddedImages);

            string GeneratedRDLC = reportBuilder.BuildRDLC();

            _report.Rdlc = GeneratedRDLC;

#if DEBUG
            DateTime currentTime  = DateTime.Now;
            string   strTime      = string.Format("{0}-{1}_{2}-{3}-{4}", currentTime.Day, currentTime.Month, currentTime.Hour, currentTime.Minute, currentTime.Second);
            string   tempFileName = Path.Combine(
                Path.GetTempPath(),
                string.Format("testReportExport{0}.rdlc", strTime));
            File.WriteAllText(tempFileName, GeneratedRDLC, Encoding.Unicode);
#endif

            return(_report);
        }
Exemplo n.º 2
0
 public RMatrix(DataTable _sourceDataTable, IList <ReportColumn> _reportDataColumns,
                ReportTableGroupList _reportTableGroups)
     : this()
 {
     this.SourceDataTable   = _sourceDataTable;
     this.DataSetName       = RDataSet.GetDataSetName(_sourceDataTable);
     this.reportDataColumns = _reportDataColumns;
     this.reportTableGroups = _reportTableGroups;
 }
Exemplo n.º 3
0
 public RTable(DataTable _sourceDataTable, IList <ReportColumn> _reportDataColumns,
               ReportTableGroupList _reportTableGroups, Size _rowHeight)
     : this()
 {
     this.SourceDataTable   = _sourceDataTable;
     this.DataSetName       = RDataSet.GetDataSetName(_sourceDataTable);
     this.reportDataColumns = _reportDataColumns;
     this.reportTableGroups = _reportTableGroups;
     this.rowHeight         = _rowHeight;
 }
Exemplo n.º 4
0
        public void AddReportTable(DataTable dataTable, IList <ReportColumn> reportDataColumns,
                                   ReportTableGroupList _reportTableGroups, Size _rowHeight)
        {
            RdlcWrapper.ReportControlItem viewItem = null;

            if ((_reportTableGroups != null) && (_reportTableGroups.IsMatrix))
            {
                RdlcWrapper.RMatrix matrix = new RdlcWrapper.RMatrix(
                    dataTable, reportDataColumns, _reportTableGroups);

                viewItem = matrix;
            }
            else
            {
                RdlcWrapper.RTable table = new RdlcWrapper.RTable(
                    dataTable, reportDataColumns, _reportTableGroups, _rowHeight);

                viewItem = table;
            }

            rdlcWrapper.Report.Body.ReportItems.Add(viewItem);
        }