Example #1
0
        // drill through
        protected void ReportViewer_Drillthrough(object sender, MsDrillthroughEventArgs e)
        {
            if (DrillThrough != null)
            {
                DrillThrough(this, e);
            }
            // find the drill-through report from the library
            string        configurationFilename = ConfigurationManager.AppSettings["VB.Reports.App.ReportDefinitionLibrary.Xml.Serialization.ReportMetadata.Path"];
            ReportFactory factory = ReportFactory.NewReportFactory(configurationFilename);

            IReport report = factory.FindReportByServerPath(e.ReportPath);

            // bind the data source

            if (e.Report is MsLocalReport)
            {
                BindLocalReport((MsLocalReport)e.Report, report);
            }
            else
            {
                BindServerReport((MsServerReport)e.Report, report);
            }

            // update the report parameter section to be hidden from view

            ReportParameterOptions.Visible = false;
            ReportParameterSubmit.Visible  = false;

            // show the back to parent report button

            ReportParameterBack.Visible  = true;
            ReportParameterBackText.Text = @"Back to " + TheReport().Name;
        }
Example #2
0
        protected void ReportViewer1_Drillthrough(object sender, Microsoft.Reporting.WebForms.DrillthroughEventArgs e)
        {
            Microsoft.Reporting.WebForms.LocalReport lr = e.Report as Microsoft.Reporting.WebForms.LocalReport;

            if (rptFacade == null)
            {
                rptFacade = new ReportViewFacade(this.DataProvider);
            }
            RptViewDesignMain rptDesign = rptFacade.GetRptViewDesignMainByReportName(e.ReportPath.ToUpper());

            RptViewUserSubscription[] viewerInput = new RptViewUserSubscription[lr.OriginalParametersToDrillthrough.Count];

            RptViewDataSource dataSource = (RptViewDataSource)rptFacade.GetRptViewDataSource(designMain.DataSourceID);

            for (int i = 0; i < lr.OriginalParametersToDrillthrough.Count; i++)
            {
                viewerInput[i]           = new RptViewUserSubscription();
                viewerInput[i].InputName = lr.OriginalParametersToDrillthrough[i].Name;

                if (dataSource.SourceType == DataSourceType.SQL)
                {
                    viewerInput[i].InputType         = ReportViewerInputType.SqlFilter;
                    viewerInput[i].SqlFilterSequence = i + 1;
                }
                else
                {
                    viewerInput[i].InputType = ReportViewerInputType.DllParameter;
                }

                viewerInput[i].InputValue = lr.OriginalParametersToDrillthrough[i].Values[0];
            }

            DataSet dsSource = rptFacade.ExecuteDataSetFromSource(rptDesign.ReportID, viewerInput, Server.MapPath("").ToString().Substring(0, Server.MapPath("").ToString().LastIndexOf("\\")));

            lr.DataSources.Clear();
            lr.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("MESRPT", dsSource.Tables[0]));
        }