protected void LocalReport_SubreportProcessing(object sender, SubreportProcessingEventArgs e)
 {
     try
     {
         RDLReportDocument subReport = _reportDocument.SubReportList.Find(item => item.Name == e.ReportPath);
         if (subReport != null)
         {
             subReport.LoadSubReportSourceDataSet(e.Parameters);
             ReportDataSource rdSource = null;
             foreach (DataTable dtTable in subReport.DsSource.Tables)
             {
                 rdSource       = new ReportDataSource();
                 rdSource.Name  = dtTable.TableName;
                 rdSource.Value = dtTable.DefaultView;
                 e.DataSources.Add(rdSource);
             }
         }
         else
         {
             foreach (RDLReportDocument subSubReport in _reportDocument.SubReportList)
             {
                 SubSubreportProcessing(subSubReport, e);
             }
         }
     }
     catch (Exception ex)
     {
         throw (ex);
     }
 }
        protected void treeMenu_SelectedNodeChanged(object sender, EventArgs e)
        {
            try
            {
                if (treeMenu.SelectedNode.IsNotNull() && treeMenu.SelectedNode.ImageToolTip.IsNotNullOrEmpty())
                {
                    ReportSuite.BLL.ReportSuite reportSuite = new ReportSuite.BLL.ReportSuite(ASL.STATIC.ConnectionName.HR);
                    String reportPath = String.Empty;
                    reportPath            = AppDomain.CurrentDomain.BaseDirectory + "ASTReports\\" + treeMenu.SelectedNode.ImageToolTip;
                    Session["reportPath"] = reportPath;
                    if (System.IO.File.Exists(reportPath).IsFalse())
                    {
                        Response.Write("File does not exist.");
                        return;
                    }

                    ParameterValues = new DataSet();
                    ParameterValues = reportSuite.LoadReportParameterInfoFromDB(treeMenu.SelectedNode.Value.ToInt());
                    ParameterValues.Tables[0].TableName = ParamTableName;

                    Session["ReportID"] = treeMenu.SelectedNode.Value.ToString();

                    SubReportList = new List <RDLReportDocument>();
                    Report        = new RDLReportDocument(treeMenu.SelectedNode.Text);
                    Report.ReportPathWithOutName = treeMenu.SelectedNode.ToolTip;
                    Report.Load(reportPath);
                    Report.LoadFilterTable(ParameterValues.Tables[ParamTableName].Columns);
                    FilterSetList = Report.FilterSetList;
                }
            }
            catch (Exception ex)
            {
                ((PageBase)this.Page).ErrorMessage = (ExceptionHelper.getExceptionMessage(ex));
            }
        }
Exemple #3
0
 public ReportsController(IReportSuiteRepository reportSuiteSqlRepository
                          , IEfRepository <ReportSuite> reportSuiteRepository
                          , IEfRepository <ReportSuiteExternalSetup> reportSuiteExternalSetupRepository
                          , IEfRepository <ReportSuiteColumnValue> reportSuiteColumnValueRepository
                          , RDLReportDocument reportDocument
                          , IMapper mapper)
 {
     _reportSuiteSqlRepository           = reportSuiteSqlRepository;
     _reportSuiteRepository              = reportSuiteRepository;
     _reportSuiteExternalSetupRepository = reportSuiteExternalSetupRepository;
     _reportSuiteColumnValueRepository   = reportSuiteColumnValueRepository;
     _reportDocument = reportDocument;
     _mapper         = mapper;
 }
 private void LoadSubSubReportDefinition(RDLReportDocument subReport)
 {
     try
     {
         foreach (RDLReportDocument subSubReport in subReport.SubReportList)
         {
             subSubReport.InitializeReportParameter();
             rpViewer.LocalReport.LoadSubreportDefinition(subSubReport.Name, _reportDocument.GetCustomTextReader(subSubReport.ReportPath));
             LoadSubSubReportDefinition(subSubReport);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #5
0
        protected void rpViewer_Drillthrough(object sender, DrillthroughEventArgs e)
        {
            try
            {
                // Handle local drillthrough only
                if (e.Report is ServerReport)
                {
                    return;
                }

                LocalReport localreport = (LocalReport)e.Report;

                RDLReportDocument drillReport = new RDLReportDocument(e.ReportPath);
                drillReport.ReportPathWithOutName = Report.ReportPathWithOutName;
                drillReport.Load(String.Format(@"{0}\{1}.{2}", Report.ReportPathWithOutName, e.ReportPath, "rdl"));

                drillReport.LoadSourceDataSet(localreport.OriginalParametersToDrillthrough);

                localreport.DataSources.Clear();
                localreport.LoadReportDefinition(drillReport.GetCustomTextReader(drillReport.ReportPath));
                localreport.DisplayName = drillReport.Name;
                SetDataSource(drillReport.dsSource, localreport);

                ReportParameter[] Parameters = new ReportParameter[drillReport.Parameters.Count];
                int i = 0;
                foreach (RDLParameter rpParam in drillReport.Parameters)
                {
                    Parameters[i]      = new ReportParameter();
                    Parameters[i].Name = rpParam.Name;
                    Parameters[i].Values.Add(rpParam.Value.ToString());
                    i++;
                }
                localreport.Refresh();
            }
            catch (Exception ex)
            {
                this.ErrorMessage = (ExceptionHelper.getExceptionMessage(ex));
            }
        }
 protected void SubSubreportProcessing(RDLReportDocument subReport, SubreportProcessingEventArgs e)
 {
     try
     {
         RDLReportDocument objSubSubReport = subReport.SubReportList.Find(item => item.Name == e.ReportPath);
         if (objSubSubReport != null)
         {
             LocalReport_SubSubreportProcessing(subReport, e);
         }
         else
         {
             foreach (RDLReportDocument subSubReport in subReport.SubReportList)
             {
                 SubSubreportProcessing(subSubReport, e);
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        protected void RpViewerDrillthrough(object sender, DrillthroughEventArgs e)
        {
            try
            {
                if (e.Report is ServerReport)
                {
                    return;
                }

                LocalReport localreport = (LocalReport)e.Report;

                RDLReportDocument drillReport = new RDLReportDocument();
                drillReport.SetFields(User.Identity.GetUserId <int>().ToString(), _reportDocument.Name, _reportDocument.ReportPathWithOutName);
                drillReport.Load(string.Format(@"{0}\{1}.{2}", _reportDocument.ReportPathWithOutName, e.ReportPath, "rdl"));

                drillReport.LoadSourceDataSet(localreport.OriginalParametersToDrillthrough);

                localreport.DataSources.Clear();
                localreport.LoadReportDefinition(drillReport.GetCustomTextReader(drillReport.ReportPath));
                localreport.DisplayName = drillReport.Name;
                SetDataSource(drillReport.DsSource, localreport);

                ReportParameter[] Parameters = new ReportParameter[drillReport.Parameters.Count];
                int i = 0;
                foreach (RDLParameter rpParam in drillReport.Parameters)
                {
                    Parameters[i]      = new ReportParameter();
                    Parameters[i].Name = rpParam.Name;
                    Parameters[i].Values.Add(rpParam.Value.ToString());
                    i++;
                }
                localreport.Refresh();
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
Exemple #8
0
 protected void LocalReport_SubreportProcessing(object sender, SubreportProcessingEventArgs e)
 {
     try
     {
         RDLReportDocument subReport = SubReportList.Find(item => item.Name == e.ReportPath);
         if (subReport.IsNotNull())
         {
             subReport.LoadSubReportSourceDataSet(e.Parameters);
             ReportDataSource rdSource = null;
             foreach (DataTable dtTable in subReport.dsSource.Tables)
             {
                 rdSource       = new ReportDataSource();
                 rdSource.Name  = dtTable.TableName;
                 rdSource.Value = dtTable.DefaultView;
                 e.DataSources.Add(rdSource);
             }
         }
     }
     catch (Exception ex)
     {
         this.ErrorMessage = (ExceptionHelper.getExceptionMessage(ex));
     }
 }
 public ReportView()
 {
     _reportSuiteRepository = DependencyResolver.Current.GetService <IEfRepository <ReportSuite> >();
     _reportDocument        = DependencyResolver.Current.GetService <RDLReportDocument>();
 }