Esempio n. 1
0
        private void DrillthroughEventHandler(object sender, DrillthroughEventArgs e)
        {
            if (UseSSRSParams())
            {
                return;
            }

            ReportStore store = GetStore();

            try
            {
                e.Report.DisplayName = e.ReportPath;
                DrillThrough dt = new DrillThrough();
                dt.ReportPath = Util.ResolveReference(e.ReportPath, ReportPath);

                if (e.Report.GetType() != typeof(ServerReport))
                {
                    LocalReport localReport = (LocalReport)e.Report;
                    dt.ParamValues = localReport.OriginalParametersToDrillthrough;

                    Report rep = new Report(Util.ResolveReference(e.ReportPath, ReportPath), store);
                    e.Report.LoadReportDefinition(rep.Stream);
                    rep.AddSubreports(localReport, rep.ReportPath);

                    //Moify Data Source and Data Sets if needed
                    rep.SetDataSources(localReport.DataSources, new List <ReportParameter>(localReport.OriginalParametersToDrillthrough));
                    localReport.SetParameters(localReport.OriginalParametersToDrillthrough);

                    localReport.EnableExternalImages = true;
                    localReport.EnableHyperlinks     = true;

                    localReport.Refresh();
                }
                else
                {
                    dt.ParamValues = Util.GetRuntimeParameters(e.Report.GetParameters());
                }
                //Store params for client
                string script = @"document.getElementById('DrillThroughParams').value = '" + JsonConvert.SerializeObject(dt) + "';";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "open", script, true);
            }
            catch (Exception ex)
            {
                string err = ex.Message;

                if (ex.InnerException != null)
                {
                    err = ex.InnerException.Message;
                }

                SetErrorText(err);
            }
        }
Esempio n. 2
0
        private void BackEventHandler(object sender, BackEventArgs e)
        {
            if (UseSSRSParams())
            {
                return;
            }
            ReportStore store = GetStore();

            try
            {
                //Keep track of depth
                string script = @"document.getElementById('DrillThroughParams').value = 'parent';";
                if (e.ParentReport.IsDrillthroughReport)
                {
                    Report       rep = new Report(Util.ResolveReference(e.ParentReport.DisplayName, ReportPath), store);
                    DrillThrough dt  = new DrillThrough();
                    dt.ReportPath = Util.ResolveReference(e.ParentReport.DisplayName, ReportPath);
                    if (e.ParentReport.GetType() == typeof(ServerReport))
                    {
                        dt.ParamValues = Util.GetRuntimeParameters(e.ParentReport.GetParameters());
                    }
                    else
                    {
                        dt.ParamValues = ((LocalReport)e.ParentReport).OriginalParametersToDrillthrough;
                    }

                    //Store params for client
                    script = @"document.getElementById('DrillThroughParams').value = '" + JsonConvert.SerializeObject(dt) + "';";
                }
                ScriptManager.RegisterStartupScript(this, this.GetType(), "open", script, true);
            }
            catch (Exception ex)
            {
                string err = ex.Message;

                if (ex.InnerException != null)
                {
                    err = ex.InnerException.Message;
                }

                SetErrorText(err);
            }
        }