none
Adding ReportViewer Dynamicly - Drilltrough Events Will not work. RRS feed

  • Question

  • Hi

     

    I am working in Visual Studio 2008 using C# in creating a web user control.

    I am connecting to SQL 2008 February CTP (Katmai) Reporting Services.

     

    I am adding adding a report viewer control dynamicly to a web page which works fine.

     

    //Sample code

    ReportViewer reportViewer;

    try

    {

    reportViewer = new ReportViewer();

    reportViewer.ShowToolBar = false;

    reportViewer.ShowParameterPrompts = false;

    reportViewer.ProcessingMode = ProcessingMode.Remote;

    reportViewer.ServerReport.ReportServerCredentials = new MyReportServerCredentials();

    reportServerPath = new Uri(ConfigurationManager.AppSettings["ReportServer"]);

    reportViewer.ServerReport.ReportServerUrl = reportServerPath;

    reportViewer.ServerReport.ReportPath = "/Report Project1/Report5";

    }

    finally

    {}

     

    I also want to add Drilltrough functionailty to be able to click on the report and then go to the next report.

     

    I add the event with the following code but it does not want to go into the event when i click on the report even though the page does a postback on the click.

     

    //Sample code

    reportViewer.Drillthrough += new DrillthroughEventHandler(reportViewer_Drillthrough);

    reportViewer.Attributes.Add("Drillthrough", "reportViewer_Drillthrough");

     

    void reportViewer_Drillthrough(object sender, DrillthroughEventArgs e)

    {

    throw new NotImplementedException();

    }

     

    //

     

    I add multiple report viewer controls etc. And it works fine but the it seems to trough away the added event.

     

    I report viewer functionality sits in a user control which a called from a normal aspx page.

     

     

    Thanks in advance
    Thursday, May 8, 2008 8:53 PM