Exemplo n.º 1
0
        private void LoadSubReportInfo()
        {
            RDLReportDocument subRep;
            String            reportName = String.Empty;
            XmlNodeList       xmlItems   = GetCustomNodeList("Subreport");

            foreach (XmlNode nod in xmlItems)
            {
                reportName = nod["ReportName"].InnerText;
                if (SubReportList.Find(item => item.Name == reportName).IsNull())
                {
                    subRep = new RDLReportDocument(reportName);
                    subRep.ReportPathWithOutName = reportPathWithOutName;
                    subRep.Load(String.Format(@"{0}\{1}.{2}", reportPathWithOutName, reportName, "rdlc"));
                    SubReportList.Add(subRep);
                }
            }
        }
Exemplo n.º 2
0
        protected void treeMenu_SelectedNodeChanged(object sender, EventArgs e)
        {
            try
            {
                if (treeMenu.SelectedNode.IsNotNull() && treeMenu.SelectedNode.ImageToolTip.IsNotNullOrEmpty())
                {
                    REPORT.BLL.ReportSuite reportSuite = new REPORT.BLL.ReportSuite(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();

                    Int32 reportID = reportSuite.CheckMailExist(treeMenu.SelectedNode.Value.ToString());
                    if (reportID == 0)
                    {
                        btnEmail.Visible = false;
                    }
                    else
                    {
                        btnEmail.Visible = true;
                    }

                    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));
            }
        }
Exemplo n.º 3
0
 private void LoadSubReportInfo()
 {
     RDLReportDocument subRep;
     String reportName = String.Empty;
     XmlNodeList xmlItems = GetCustomNodeList("Subreport");
     foreach (XmlNode nod in xmlItems)
     {
         reportName = nod["ReportName"].InnerText;
         if (SubReportList.Find(item => item.Name == reportName).IsNull())
         {
             subRep = new RDLReportDocument(reportName);
             subRep.ReportPathWithOutName = reportPathWithOutName;
             subRep.Load(String.Format(@"{0}\{1}.{2}", reportPathWithOutName, reportName, "rdlc"));
             SubReportList.Add(subRep);
         }
     }
 }
Exemplo n.º 4
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));
            }
        }