Exemple #1
0
 void LocalReport_SubreportProcessing(object sender, Microsoft.Reporting.WebForms.SubreportProcessingEventArgs e)
 {
     UCAReports.ReportCommon.SubReportDetail SubRep = SubReportsName.FirstOrDefault(r => r.ReportName == e.ReportPath);
     if (SubRep != null)
     {
         foreach (UCAReports.ReportCommon.ReportDataSource RepDS in SubRep.reportDataSource)
         {
             e.DataSources.Add(new ReportDataSource(RepDS.DataSetName, RepDS.DataSource));
         }
     }
 }
 public void SetSubDataSource(object sender, Microsoft.Reporting.WebForms.SubreportProcessingEventArgs e)
 {
     try
     {
         Microsoft.Reporting.WebForms.LocalReport rptTemp = (Microsoft.Reporting.WebForms.LocalReport)sender;
         DataTable dtTemp = (DataTable)rptTemp.DataSources[e.ReportPath.Trim()].Value;
         e.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource(e.DataSourceNames[0], dtTemp));
     }
     catch (Exception ex)
     {
         Streamline.BaseLayer.LogManager.LogException(ex, LogManager.LoggingCategory.General, LogManager.LoggingLevel.Error, this);
     }
 }
Exemple #3
0
        private void Report_SubreportProcessingEventHandler(Object sender, Microsoft.Reporting.WebForms.SubreportProcessingEventArgs e)
        {
            switch (Request.QueryString["rpt"].ToString())
            {
            case "ptomtosest":                  // sub report para el reporte de presupuesto - montos estimados

                switch (e.ReportPath)           // algún día puede haber más de un subreport !!
                {
                case "MontosEstimados_CuentasContables":

                    string sCodigoPresupuesto = e.Parameters["CodigoPresupuesto"].Values[0];
                    int    nCiaContab         = Convert.ToInt32(e.Parameters["CiaContab"].Values[0].ToString());

                    List <MontosEstimados_Consulta_CuentaContable> list = new List <MontosEstimados_Consulta_CuentaContable>();

                    using (dbContab_Contab_Entities contabContext = new dbContab_Contab_Entities())
                    {
                        var query = contabContext.CuentasContables.Where(c => c.Presupuesto_Codigos.Any(p => p.Codigo == sCodigoPresupuesto)).Select(c => c);
                        query = query.Where(c => c.Cia == nCiaContab);

                        MontosEstimados_Consulta_CuentaContable cuentaContable;

                        foreach (var cuenta in query)
                        {
                            cuentaContable = new MontosEstimados_Consulta_CuentaContable()
                            {
                                Cuenta        = cuenta.Cuenta,
                                CuentaEditada = cuenta.CuentaEditada,
                                Descripcion   = cuenta.Descripcion
                            };

                            list.Add(cuentaContable);
                        }
                    }

                    e.DataSources.Clear();

                    ReportDataSource myReportDataSource = new ReportDataSource();

                    myReportDataSource.Name  = "Presupuesto_MontosEstimados_CuentasContables";
                    myReportDataSource.Value = list;

                    e.DataSources.Add(myReportDataSource);

                    break;
                }
                break;
            }
        }
Exemple #4
0
        void CombinePurchaseAndPurchaseReturnReport_SubreportProcessing(object sender, Microsoft.Reporting.WebForms.SubreportProcessingEventArgs e)
        {
            // get Sub Table Id from the parameters
            int purchasedetailsId = Convert.ToInt32(e.Parameters[0].Values[0]);
            //int purchasereturndetailsId = Convert.ToInt32(e.Parameters[1].Values[0]);
            var dataSourceName = e.DataSourceNames;

            // remove all previously attached Datasources, since we want to attach one
            e.DataSources.Clear();
            // Retrieve employeeFamily list based on EmpID
            var purcahseDetails = context.tbl_purchasedetails.Where(s => s.purchasedetails_id == purchasedetailsId).ToList();

            //var purcahsereturnDetails = context.tbl_purchasereturndetails.Where(s => s.purchasereturndetails_id == purchasereturndetailsId).ToList();

            // add retrieved dataset or you can call it lis   t to data source
            e.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource()
            {
                Name  = dataSourceName.FirstOrDefault(),
                Value = purcahseDetails
            });
        }
Exemple #5
0
 void LocalReport_SubreportProcessing(object sender, Microsoft.Reporting.WebForms.SubreportProcessingEventArgs e)
 {
     //e.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("SubreportDataSet", this.SqlDataSource1));
 }