private void BtnDeleteSection_Click(object sender, RoutedEventArgs e)
 {
     ReportSections.Remove(SelectedSection);
     ste.Sections.Remove(SelectedSection);
     OnPropertyChanged("ReportSections");
     ste.SaveChanges();
 }
Example #2
0
        private static string GetPageHeader(ReportBuilder reportBuilder)
        {
            string strHeader = "";

            if (reportBuilder.Page == null || reportBuilder.Page.ReportHeader == null)
            {
                return("");
            }
            ReportSections reportHeader = reportBuilder.Page.ReportHeader;

            strHeader = @"<PageHeader> 
                          <Height>" + reportHeader.Size.Height.ToString() + @"in</Height> 
                          <PrintOnFirstPage>" + reportHeader.PrintOnFirstPage.ToString().ToLower() + @"</PrintOnFirstPage> 
                          <PrintOnLastPage>" + reportHeader.PrintOnLastPage.ToString().ToLower() + @"</PrintOnLastPage> 
                          <ReportItems>";
            ReportTextBoxControl[] headerTxt = reportBuilder.Page.ReportHeader.ReportControlItems.TextBoxControls;
            if (headerTxt != null)
            {
                for (int i = 0; i < headerTxt.Count(); i++)
                {
                    strHeader += GetTextBox(headerTxt[i].Name, null, headerTxt[i].ValueOrExpression);
                }
            }
            strHeader += @" 
                          </ReportItems> 
                          <Style /> 
                        </PageHeader>";
            return(strHeader);
        }
        private void PostaviIzvjestaj(DataSet ds)
        {
            DataTable dt = ds.Tables[0];

            this.reportViewer1.Reset();

            this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource(dt.TableName, dt));


            ReportBuilder reportBuilder = new ReportBuilder();

            reportBuilder.DataSource = ds;

            reportBuilder.Page = new ReportPage();
            ReportSections reportFooter      = new ReportSections();
            ReportItems    reportFooterItems = new ReportItems();

            ReportTextBoxControl[] footerTxt = new ReportTextBoxControl[3];
            footerTxt[0] = new ReportTextBoxControl()
            {
                Name = "txtCopyright", ValueOrExpression = new string[] { string.Format("Copyright {0}", DateTime.Now.Year) }
            };
            footerTxt[1] = new ReportTextBoxControl()
            {
                Name = "ExecutionTime", ValueOrExpression = new string[] { "Izvjestaj generiran " + DateTime.Now.ToString() }
            };
            footerTxt[2] = new ReportTextBoxControl()
            {
                Name = "PageNumber", ValueOrExpression = new string[] { "Stranica ", ReportGlobalParameters.CurrentPageNumber, " of ", ReportGlobalParameters.TotalPages }
            };

            reportFooterItems.TextBoxControls = footerTxt;
            reportFooter.ReportControlItems   = reportFooterItems;
            reportBuilder.Page.ReportFooter   = reportFooter;

            ReportSections reportHeader = new ReportSections();

            reportHeader.Size        = new ReportScale();
            reportHeader.Size.Height = 0.05;

            ReportItems reportHeaderItems = new ReportItems();

            ReportTextBoxControl[] headerTxt = new ReportTextBoxControl[1];
            headerTxt[0] = new ReportTextBoxControl()
            {
                Name = "txtReportTitle", ValueOrExpression = new string[] { "Stanje na dan : " + DateTime.Now.ToString() }
            };

            reportHeaderItems.TextBoxControls = headerTxt;
            reportHeader.ReportControlItems   = reportHeaderItems;
            reportBuilder.Page.ReportHeader   = reportHeader;



            this.reportViewer1.LocalReport.LoadReportDefinition(ReportEngine.GenerateReport(reportBuilder));

            this.reportViewer1.RefreshReport();
        }
    private static string GetPageHeader(ReportBuilder reportBuilder)
    {
        //< Image Name = ""Image1"" >
        // < Source > Embedded </ Source >
        // < Value > Logo </ Value >
        // < Sizing > FitProportional </ Sizing >
        // < Top > 0.05807in</ Top >
        //    < Left > 1cm </ Left >
        //       < Height > 0.4375in</ Height >
        //          < Width > 1.36459in</ Width >
        //             < ZIndex > 1 </ ZIndex >
        //             < Style />
        //           </ Image >
        string strHeader = "";

        if (reportBuilder.Page == null || reportBuilder.Page.ReportHeader == null)
        {
            return("");
        }
        ReportSections reportHeader = reportBuilder.Page.ReportHeader;

        strHeader = @"<PageHeader> 
                          <Height>0.56849in</Height> 
                          <PrintOnFirstPage>" + reportHeader.PrintOnFirstPage.ToString().ToLower() + @"</PrintOnFirstPage> 
                          <PrintOnLastPage>" + reportHeader.PrintOnLastPage.ToString().ToLower() + @"</PrintOnLastPage> 
                          <ReportItems>";
        ReportTextBoxControl[] headerTxt = reportBuilder.Page.ReportHeader.ReportControlItems.TextBoxControls;
        string left    = "1cm";
        var    titulo  = headerTxt[0].ValueOrExpression;
        var    empresa = headerTxt[1].ValueOrExpression;
        var    ruc     = headerTxt[2].ValueOrExpression;

        if (headerTxt != null)
        {
            //for (int i = 0; i < headerTxt.Count(); i++)
            //{
            //    strHeader += GetHeaderTextBox(headerTxt[i].Name, left, null, headerTxt[i].ValueOrExpression);
            //}
            strHeader += TituloReporte(titulo[0].ToString(), empresa[0].ToString(), ruc[0].ToString());
        }

        strHeader += @" </ReportItems> 
                          <Style /> 
                        </PageHeader>";
        return(strHeader);
    }
Example #5
0
    private static string GetPageHeader(ReportBuilder reportBuilder)
    {
        string strHeader = "";

        if (reportBuilder.Page == null || reportBuilder.Page.ReportHeader == null)
        {
            return("");
        }
        ReportSections reportHeader = reportBuilder.Page.ReportHeader;

        strHeader = @"<PageHeader> 
                          <Height>" + reportHeader.Size.Height.ToString() + @"in</Height> 
                          <PrintOnFirstPage>" + reportHeader.PrintOnFirstPage.ToString().ToLower() + @"</PrintOnFirstPage> 
                          <PrintOnLastPage>" + reportHeader.PrintOnLastPage.ToString().ToLower() + @"</PrintOnLastPage> 
                          <ReportItems>";
        ReportTextBoxControl[] headerTxt = reportBuilder.Page.ReportHeader.ReportControlItems.TextBoxControls;
        if (headerTxt != null)
        {
            for (int i = 0; i < headerTxt.Count(); i++)
            {
                strHeader += GetHeaderTextBox(headerTxt[i].Name, null, headerTxt[i].ValueOrExpression);
            }
        }
        strHeader += @" 
                            <Image Name=""Image1""> 
                              <Source>Embedded</Source> 
                              <Value>Logo</Value> 
                              <Sizing>FitProportional</Sizing> 
                              <Top>0.05807in</Top> 
                              <Left>1cm</Left> 
                              <Height>0.4375in</Height> 
                              <Width>1.36459in</Width> 
                              <ZIndex>1</ZIndex> 
                              <Style /> 
                            </Image> 

                          </ReportItems> 

                          <Style /> 
                        </PageHeader>";
        return(strHeader);
    }
        protected override void InitSections()
        {
            _sections = new ReportSections();

            UpdateStatus(0, 1, "Building Report Sections...", "", false);

            if (_byItemGroup)
            {
                // Note that an additonal root section 'Non-market items' may be added during
                // GetDataFromDatabase if it is required.
                EveDataSet.invTypesDataTable items = Items.GetItemsThatAreAssets(_assetAccessParams);
                List<int> itemIDs = new List<int>();
                foreach (EveDataSet.invTypesRow item in items)
                {
                    itemIDs.Add(item.typeID);
                }
                _marketGroups = MarketGroups.GetGroupsForItems(itemIDs);
                DataRow[] rootGroups = _marketGroups.Select("parentGroupID IS null");
                int counter = 0;
                ReportSection rootSection = new ReportSection(_columns.Length, "All Items", "All Items", this);
                _sections.Add(rootSection);
                ReportSection nonMarket = new ReportSection(_columns.Length, "Non-Market Items", "Non-Market Items", this);
                rootSection.AddSection(nonMarket);
                foreach (DataRow group in rootGroups)
                {
                    counter++;
                    EveDataSet.invMarketGroupsRow marketGroup = (EveDataSet.invMarketGroupsRow)group;
                    ReportSection section = new ReportSection(_columns.Length, marketGroup.marketGroupID.ToString(),
                        marketGroup.marketGroupName, this);
                    rootSection.AddSection(section);
                    BuildSection(section);
                    UpdateStatus(counter, rootGroups.Length, "", section.Text, false);
                }
            }
            else
            {
                _sections.Add(new ReportSection(_columns.Length, "All Items", "All Items", this));
            }
            UpdateStatus(1, 1, "", "", false);
        }
Example #7
0
    /// <summary>
    /// Bind Report With DataSet
    /// </summary>
    /// <param name="ds">DataSet</param>
    public void DataBind(DataSet ds)
    {
        int count = 0;

        foreach (DataTable dt in ds.Tables)
        {
            count++;
            var       report_name = "Report" + count;
            DataTable dt1         = new DataTable(report_name.ToString());
            dt1           = ds.Tables[count - 1];
            dt1.TableName = report_name.ToString();
        }


        //Report Viewer, Builder and Engine
        ReportViewer1.Reset();
        for (int i = 0; i < ds.Tables.Count; i++)
        {
            ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource(ds.Tables[i].TableName, ds.Tables[i]));
        }

        ReportBuilder reportBuilder = new ReportBuilder();

        reportBuilder.DataSource = ds;

        reportBuilder.Page = new ReportPage();
        ReportSections reportFooter      = new ReportSections();
        ReportItems    reportFooterItems = new ReportItems();

        ReportTextBoxControl[] footerTxt = new ReportTextBoxControl[3];
        //string footer = string.Format("Copyright {0}         Report Generated On {1}          Page {2}", DateTime.Now.Year, DateTime.Now, ReportGlobalParameters.CurrentPageNumber);
        string footer = string.Format("Copyright  {0}         Report Generated On  {1}          Page  {2}  of {3} ", DateTime.Now.Year, DateTime.Now, ReportGlobalParameters.CurrentPageNumber, ReportGlobalParameters.TotalPages);

        footerTxt[0] = new ReportTextBoxControl()
        {
            Name = "txtCopyright", ValueOrExpression = new string[] { footer }
        };



        reportFooterItems.TextBoxControls = footerTxt;
        reportFooter.ReportControlItems   = reportFooterItems;
        reportBuilder.Page.ReportFooter   = reportFooter;

        ReportSections reportHeader = new ReportSections();

        reportHeader.Size        = new ReportScale();
        reportHeader.Size.Height = 0.56849;

        ReportItems reportHeaderItems = new ReportItems();

        ReportTextBoxControl[] headerTxt = new ReportTextBoxControl[1];
        headerTxt[0] = new ReportTextBoxControl()
        {
            Name = "txtReportTitle", ValueOrExpression = new string[] { "Report Name: " + ReportTitle }
        };


        reportHeaderItems.TextBoxControls = headerTxt;
        reportHeader.ReportControlItems   = reportHeaderItems;
        reportBuilder.Page.ReportHeader   = reportHeader;

        ReportViewer1.LocalReport.LoadReportDefinition(ReportEngine.GenerateReport(reportBuilder));
        ReportViewer1.LocalReport.DisplayName = ReportName;
    }
Example #8
0
        protected Section ConstructReportSection(ReportSections section, CycleList cycles)
        {
            Section sec = null;
            if (!(bool)selectedReportSections.GetValue((int)section))
                return sec;
            try
            {
                switch (section)
                {
                    // these have multiple rows based on the report content
                    case ReportSections.CycleSource:
                        sec = new Section(typeof(CycleSource), 1, 1, 1, "Cycle");
                        sec[1].Add(0, "Cycle source");
                        break;
                    case ReportSections.MultiplicityDistributions:
                        sec = DoAcrossForManyMults("Cycle multiplicity distributions", typeof(eMultiplicityDistributions), true);
                        break;
                    case ReportSections.ChannelCounts:
                        break;
                    case ReportSections.ChannelRates:
                        break;
                    case ReportSections.ComputedMultiplicityIntermediates:
                        sec = DoAcrossForManyMults("Cycle moments (NNV)", typeof(ComputedMultiplicityIntermediates), true);
                        break;
                    case ReportSections.RawCycles:
                    {
                        ConstructedSource src = ConstructedSource.Unknown;
                        InstrType inst = InstrType.Unknown;
                        if (cycles.Count > 0)
                        {
                            src = cycles[0].DataSourceId.source;
                            inst = cycles[0].DataSourceId.SRType;
                        }
                        if (cycles.Count > 0 && src.MightHaveScalerData(inst)) // anything that might have Scaler data
                            sec = DoAcrossForManyMults("Cycle raw data", typeof(INCCCycles), true);
                        else
                            sec = DoAcrossForManyMults("Cycle raw data", typeof(RawCycles), true);
                    }
                        break;
                    case ReportSections.DTCRateCycles:
                        sec = DoAcrossForManyMults("Cycle DTC rate data", typeof(DTCRateCycles), true);
                        break;
                    case ReportSections.RateCycles:
                        sec = DoAcrossForManyMults("Cycle rate data", typeof(RateCycles), true);
                        break;
                    case ReportSections.RepResults:
                        break;
                    case ReportSections.RepDytlewskiResults:

                        break;
                }
                if (sec == null) // no mult-based data
                    return sec;
                Row[] temp = null;
                foreach (Cycle cyc in cycles)
                {
                    switch (section)
                    {
                        // these have multiple rows based on the report content
                        case ReportSections.MultiplicityDistributions:
                            int repeat = meas.CountingAnalysisResults.GetResultsCount(typeof(Multiplicity));
                            temp = GenMultDistRows(cyc.CountingAnalysisResults, cyc.seq); // done: uses # of analyzers and goes across
                            Section sec2 = new Section(typeof(eMultiplicityDistributions), 0, 0, temp.Length, "Cycle " + cyc.seq, repeat);
                            sec.AddRange(sec2);
                            sec.AddRange(temp);
                            break;
                        case ReportSections.ChannelCounts:
                            //    sec.Add(GenChannelCountsRows(cyc));
                            break;
                        case ReportSections.ChannelRates:
                            //    sec.Add(GenChannelCountsRows(cyc));
                            break;
                        case ReportSections.ComputedMultiplicityIntermediates:
                            temp = GenMultiplicityIntermediatesRow(cyc.CountingAnalysisResults, cyc); // alpha and beta are only in the summary because they do not change (gatelength-based)
                            sec.AddRange(temp);
                            break;
                        case ReportSections.RawCycles:
                            if (cyc.DataSourceId.source.SRDAQ(cyc.DataSourceId.SRType))
                                sec.Add(GenINCCCycleRow(cyc));
                            else
                                sec.Add(GenRawCycleRow(cyc)); // done: uses # of analyzers and goes across
                            break;
                        case ReportSections.DTCRateCycles:
                            sec.Add(GenRateCycleRow(cyc, dtc:true));  // # of analyzers and goes across
                            break;
                        case ReportSections.RateCycles:
                            sec.Add(GenRateCycleRow(cyc));
                            break;
                        case ReportSections.RepResults:
                            //    sec.Add(GenResultsCycleRow(cyc));
                            break;
                        case ReportSections.RepDytlewskiResults:
                            //    sec.Add(GenDytlewskiResultsCycleRow(cyc));
                            break;
                        case ReportSections.CycleSource:
                            sec.Add(GenCycleSourceRow(cyc));
                            break;
                    }
                }
            }
            catch (Exception e)
            {
                ctrllog.TraceException(e);
            }
            return sec;
        }
Example #9
0
 protected Section ConstructReportSection(ReportSections section, Multiplicity mu, MultiplicityCountingRes mcr)
 {
     Section sec = null;
     if (!(bool)selectedReportSections.GetValue((int)section))
         return sec;
     try
     {
         switch (section)
         {
             case ReportSections.RepResults:
                 sec = new Section(typeof(RepResults), 1, 1, 1);
                 sec[1].Add(0, "Corrected rates for SR " + mu.ShortName());
                 sec.Add(GenResultsRow(mcr));
                 break;
             case ReportSections.RepDytlewskiResults:
                 sec = new Section(typeof(RepResults), 1, 1, 1);
                 sec[1].Add(0, "Dytlewski rates for SR " + mu.ShortName());
                 sec.Add(GenDytlewskiResultsRow(mcr));
                 break;
         }
     }
     catch (Exception e)
     {
         ctrllog.TraceException(e);
     }
     return sec;
 }
Example #10
0
        /*
         * call ConstructReportSections with a cycle to
         *   gen empty row
         *   gen header row
         *   gen data row(s)
         */
        protected Section ConstructReportSection(ReportSections section)
        {
            Section sec = null;
            if (!(bool)selectedReportSections.GetValue((int)section))
                return sec;
            try
            {
                Row[] temp;
                switch (section)
                {
                    case ReportSections.SofwareContext:
                        temp = GenSoftwareConfigRows();
                        sec = new Section(null, 1, 1, temp.Length);
                        sec[1].Add(0, "Software application configuration details");
                        sec.InsertRange(sec.dataidx, temp);
                        break;
                    case ReportSections.DescriptiveSummary:
                        sec = new Section(typeof(DescriptiveSummary), 0, 1, 1);
                        sec.Add(GenDescriptiveSummaryRow());
                        break;
                    case ReportSections.MeasurementDetails:
                        sec = new Section(typeof(MeasurementDetails), 0, 1, 1);
                        sec.Add(GenMeasurementDetailsRow(meas.CountingAnalysisResults.HasMultiplicity));
                        break;
                    case ReportSections.DetectorCalibration:

                        sec = new Section(typeof(DetectorCalibration), 0, 1, 1);
                        Row hcrow = sec[sec.Count - 1];
                        hcrow.Clear();
                        hcrow.TS = DetectorCalibrationHeader;
                        if (meas.CountingAnalysisResults.HasMultiplicity)
                        {
                            hcrow.GenFromEnum(typeof(DetectorCalibration), null, 0);
                            // there is a disconnect between the detector list and the Instrument list,
                            // there is disconnect between the detector and the subordinate SR analyzer param sets;
                            IEnumerator iter = meas.CountingAnalysisResults.GetMultiplicityEnumerator(true);
                            while (iter.MoveNext())
                            {
                                Multiplicity mkey = (Multiplicity)((KeyValuePair<SpecificCountingAnalyzerParams, object>)(iter.Current)).Key;
                                sec.Add(GenDetectorCalibrationRow(meas.Detector, mkey));
                            }
                        }
                        else
                        {
                            hcrow.GenFromEnum(typeof(BaseDetectorCalibration), null, 0);
                            sec.Add(GenDetectorCalibrationRow(meas.Detector));
                        }

                        break;
                    case ReportSections.ComputedMultiplicityIntermediates:
                        // RA, A, alpha, beta
                        // 0...3 rows
                        //sec = DoAcrossForManyMults("Averaged moments (NNV)", typeof(ComputedMultiplicityIntermediates), false);
                        //temp = GenMultiplicityIntermediatesRow(m.CountingAnalysisResults);
                        //sec.AddRange(temp);
                        break;
                    case ReportSections.ChannelCounts:
                        temp = GenChannelCountsRows();
                        sec = new Section(typeof(ChannelCounts), 1, 1, temp.Length);
                        sec[1].Add(0, "Hits per channel sums");
                        sec.InsertRange(sec.dataidx, temp);
                        break;
                    case ReportSections.ChannelRates:
                        temp = GenChannelRatesRows();
                        sec = new Section(typeof(ChannelCounts), 1, 1, temp.Length);
                        sec[1].Add(0, "Channel hits per second (averaged over the cycles)");
                        sec.InsertRange(sec.dataidx, temp);
                        break;
                    case ReportSections.RawAndMultSums:
                        sec = DoAcrossForManyMults("Summed cycle data", typeof(RawSums), false);
                        if (sec != null)
                        {
                            sec.Add(GenRawSumsRow(meas.CountingAnalysisResults));  // done: uses # of analyzers and goes across
                            temp = GenMultDistRows(meas.CountingAnalysisResults, 0); //done: sum for all analyzers, see method comments
                            Section sec2 = new Section(typeof(DistributionsAndAlphaBeta), 0, 0, temp.Length, "Bin", meas.CountingAnalysisResults.GetResultsCount(typeof(Multiplicity)));
                            sec.AddRange(sec2);
                            sec.AddRange(temp);
                        }
                        break;
                }
            }
            catch (Exception e)
            {
                ctrllog.TraceException(e);
            }
            return sec;
        }
Example #11
0
        private void btnRechargeCardView_Click(object sender, EventArgs e)
        {
            if (!ValidateDataCardInput())
            {
                return;
            }

            dgvRechargeCardHistory.DataSource = null;

            DateTime date_begin = new DateTime(dtpSaleGasBegin.Value.Year, dtpSaleGasBegin.Value.Month, dtpSaleGasBegin.Value.Day, 0, 0, 0);

            DateTime date_end   = new DateTime(dtpSaleGasEnd.Value.Date.Year, dtpSaleGasEnd.Value.Month, dtpSaleGasEnd.Value.Day, 23, 59, 59);
            String   customerId = (cboRechargeCardCustomer.SelectedItem as ComboboxItem).Value.ToString();

            Task <String> task = SGM_WaitingIdicator.WaitingForm.waitingFrm.progressReporter.RegisterTask(
                () =>
            {
                return(m_service.SGMSaleGas_GetCardReport(customerId, date_begin, date_end, txtRechargeCardID.Text.Trim()));
            });

            SGM_WaitingIdicator.WaitingForm.waitingFrm.progressReporter.RegisterContinuation(task, () =>
            {
                String stResponse         = task.Result as String;
                DataTransfer dataResponse = JSonHelper.ConvertJSonToObject(stResponse);
                if (dataResponse.ResponseCode == DataTransfer.RESPONSE_CODE_SUCCESS)
                {
                    if (dataResponse.ResponseDataSet != null)
                    {
                        dgvRechargeCardHistory.DataSource = dataResponse.ResponseDataSet.Tables[0];
                        cardReportViewer.Reset();
                        String tableName = dataResponse.ResponseDataSet.Tables[0].TableName;
                        DataTable data   = dataResponse.ResponseDataSet.Tables[0];
                        cardReportViewer.LocalReport.DataSources.Add(new ReportDataSource(tableName, data));

                        ReportBuilder reportBuilder = new ReportBuilder();
                        reportBuilder.DataSource    = dataResponse.ResponseDataSet;
                        reportBuilder.Page          = new ReportPage();


                        ReportSections reportHeader = new ReportSections();
                        reportHeader.Size           = new ReportScale();
                        reportHeader.Size.Height    = 0.1;

                        ReportItems reportHeaderItems    = new ReportItems();
                        ReportTextBoxControl[] headerTxt = new ReportTextBoxControl[1];
                        headerTxt[0] = new ReportTextBoxControl()
                        {
                            Name = "txtReportTitle", ValueOrExpression = new string[] { string.Format("Sales Report: {0}", DateTime.Now) }
                        };

                        reportHeaderItems.TextBoxControls = headerTxt;
                        reportHeader.ReportControlItems   = reportHeaderItems;
                        reportBuilder.Page.ReportHeader   = reportHeader;

                        cardReportViewer.LocalReport.LoadReportDefinition(ReportEngine.GenerateReport(reportBuilder));

                        cardReportViewer.RefreshReport();
                    }
                    else
                    {
                        frmMsg.ShowMsg(SGMText.SGM_INFO, SGMText.REPORT_NO_DATA, SGMMessageType.SGM_MESSAGE_TYPE_INFO);
                    }
                }
                else
                {
                    frmMsg.ShowMsg(SGMText.SGM_ERROR, dataResponse.ResponseErrorMsg, SGMMessageType.SGM_MESSAGE_TYPE_ERROR);
                }
            }, SynchronizationContext.Current);
        }
Example #12
0
 public void GenerateSections()
 {
     Sections = new ReportSections(this);
 }
Example #13
0
        /// <summary>
        /// Bind Report With DataSet
        /// </summary>
        /// <param name="ds">DataSet</param>
        public void RDataBind(DataSet ds, string filter, bool showThisGrouped, int[] lista)
        {
            int count = 0;

            foreach (DataTable dt in ds.Tables)
            {
                count++;
                var       report_name = "Report" + count;
                DataTable dt1         = new DataTable(report_name.ToString());
                dt1           = ds.Tables[count - 1];
                dt1.TableName = report_name.ToString();
            }


            //Report Viewer, Builder and Engine
            ReportViewer ReportViewer1 = new ReportViewer();

            ReportViewer1.Reset();
            for (int i = 0; i < ds.Tables.Count; i++)
            {
                ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource(ds.Tables[i].TableName, ds.Tables[i]));
            }

            ReportBuilder reportBuilder = new ReportBuilder();

            reportBuilder.DataSource = ds;

            reportBuilder.Page = new ReportPage();
            ReportSections reportFooter      = new ReportSections();
            ReportItems    reportFooterItems = new ReportItems();

            ReportTextBoxControl[] footerTxt = new ReportTextBoxControl[3];
            //string footer = string.Format("Copyright {0}         Report Generated On {1}          Page {2}", DateTime.Now.Year, DateTime.Now, ReportGlobalParameters.CurrentPageNumber);
            string footer = string.Format("Copyright  {0}         Report Generated On  {1}          Page  {2}  of {3} ", DateTime.Now.Year, DateTime.Now, ReportGlobalParameters.CurrentPageNumber, ReportGlobalParameters.TotalPages);

            footerTxt[0] = new ReportTextBoxControl()
            {
                Name = "txtCopyright", ValueOrExpression = new string[] { footer }
            };



            reportFooterItems.TextBoxControls = footerTxt;
            reportFooter.ReportControlItems   = reportFooterItems;
            reportBuilder.Page.ReportFooter   = reportFooter;

            ReportSections reportHeader = new ReportSections();

            reportHeader.Size        = new ReportScale();
            reportHeader.Size.Height = 0.56849;

            ReportItems reportHeaderItems = new ReportItems();

            ReportTextBoxControl[] headerTxt = new ReportTextBoxControl[3];
            headerTxt[0] = new ReportTextBoxControl()
            {
                Name = "txtReportTitle", ValueOrExpression = new string[] { "NOMBRE DEL REPORTE: 2" + ReportTitle }
            };

            headerTxt[1] = new ReportTextBoxControl()
            {
                Name = "txtReportTitle2", ValueOrExpression = new string[] { "Razon Social: 0 " + Empresa }
            };
            headerTxt[2] = new ReportTextBoxControl()
            {
                Name = "txtReportTitle1", ValueOrExpression = new string[] { "Ruc: 1 " + Ruc }
            };
            reportHeaderItems.TextBoxControls = headerTxt;
            reportHeader.ReportControlItems   = reportHeaderItems;
            reportBuilder.Page.ReportHeader   = reportHeader;

            ReportViewer1.LocalReport.LoadReportDefinition(ReportEngine.GenerateReport(reportBuilder, filter, showThisGrouped, lista));
            ReportViewer1.LocalReport.DisplayName = ReportName;
            ReportViewer1.Dock = DockStyle.Fill;
            Form Frm = new Form();

            Frm.Size = new Size(750, 550);
            Frm.Controls.Add(ReportViewer1);
            Frm.Show();
            ReportViewer1.RefreshReport();
        }
        protected override void InitSections()
        {
            _sections = new ReportSections();
            ReportSection root = new ReportSection(_columns.Length, "NAV", "NAV", this);
            _sections.Add(root);
            ReportSection walletSection = new ReportSection(_columns.Length, "W", "Wallet Balance", this);
            ReportSection escrowSection = new ReportSection(_columns.Length, "E", "Cash in Escrow", this);
            ReportSection assetsSection = new ReportSection(_columns.Length, "A", "Assets", this);
            ReportSection sellOrdersSection = new ReportSection(_columns.Length, "S", "Sell Orders", this);

            root.AddSection(walletSection);
            root.AddSection(escrowSection);
            root.AddSection(assetsSection);
            root.AddSection(sellOrdersSection);

            foreach (FinanceAccessParams accessParams in _financeAccessParams)
            {
                long ownerID = accessParams.OwnerID;
                bool corp = false;

                APICharacter character = UserAccount.CurrentGroup.GetCharacter(ownerID, ref corp);
                //ReportSection ownerAssets = null;

                if (corp)
                {
                    walletSection.AddSection(new ReportSection(_columns.Length, "W" + ownerID.ToString(),
                        character.CorpName, this));
                    escrowSection.AddSection(new ReportSection(_columns.Length, "E" + ownerID.ToString(),
                        character.CorpName, this));
                    //ownerAssets = new ReportSection(_columns.Length, "A" + ownerID.ToString(),
                    //    character.CorpName, this);
                }
                else
                {
                    //ownerAssets = new ReportSection(_columns.Length, "A" + ownerID.ToString(),
                    //    character.CharName, this);
                }
                //assetsSection.AddSection(ownerAssets);
            }
        }
 protected override void InitSections()
 {
     _sections = new ReportSections();
     _sections.Add(new ReportSection(_columns.Length, "All Corps", "All Corps", this));
 }
        protected override void InitSections()
        {
            _sections = new ReportSections();

            UpdateStatus(0, 1, "Building Report Sections...", "", false);

            if (_byItemGroup)
            {
                // Note that an additonal root section 'Non-market items' may be added during
                // GetDataFromDatabase if it is required.
                List<int> itemIDs = Items.GetItemIDsWithTransactions(_financeAccessParams);
                List<int> tmpItemIDs = new List<int>();
                if (_tradedItemsOnly)
                {
                    List<int> tradedItemIDs = UserAccount.CurrentGroup.TradedItems.GetAllItemIDs();
                    foreach (int itemID in itemIDs)
                    {
                        if (tradedItemIDs.Contains(itemID)) { tmpItemIDs.Add(itemID); }
                    }
                    itemIDs = tmpItemIDs;
                }
                _marketGroups = MarketGroups.GetGroupsForItems(itemIDs);
                DataRow[] rootGroups = _marketGroups.Select("parentGroupID IS null");
                int counter = 0;
                ReportSection rootSection = new ReportSection(_columns.Length, "All Items", "All Items", this);
                _sections.Add(rootSection);
                foreach (DataRow group in rootGroups)
                {
                    counter++;
                    EveDataSet.invMarketGroupsRow marketGroup = (EveDataSet.invMarketGroupsRow)group;
                    ReportSection section = new ReportSection(_columns.Length, marketGroup.marketGroupID.ToString(),
                        marketGroup.marketGroupName, this);
                    rootSection.AddSection(section);
                    BuildSection(section);
                    UpdateStatus(counter, rootGroups.Length, "", section.Text, false);
                }
            }
            else
            {
                _sections.Add(new ReportSection(_columns.Length, "All Items", "All Items", this));
            }
            UpdateStatus(1, 1, "", "", false);
        }
 protected override void InitSections()
 {
     _sections = new ReportSections();
     _sections.Add(new ReportSection(_columns.Length, "Revenue", "Revenue", this));
     _sections.Add(new ReportSection(_columns.Length, "Expenses", "Expenses", this));
 }