SSRS Drillthrough event RRS feed

  • Question

  • Below is the code I am using:
    protected void ReportViewer1_Drillthrough(object sender, DrillthroughEventArgs e)
    LocalReport localReport = (LocalReport)e.Report;
    localReport.DataSources.Add(new ReportDataSource("InfosourceReportsDS"));

    Below is the aspx for reportviewer:
    <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt"
    Height="800px" ProcessingMode="Remote" Width="1075px"
    ShowPrintButton="false" ExportContentDisposition="AlwaysInline"
    <ServerReport ReportServerUrl="" />
    <LocalReport EnableHyperlinks="True">

    I am getting the below exception in the Drillthrough event at the below statement:
    LocalReport localReport = (LocalReport)e.Report;

    cast Microsoft.Reporting.WebForms.ServerReport' to type 'Microsoft.Reporting.WebForms.LocalReport'
    Monday, November 22, 2010 8:27 AM

All replies

  • if you are using Report Server  - ProcessingMode="Remote" than it should be :

    ServerReport report = (ServerReport)e.Report;

    if you want to use LocalReport - change the ProcessingMode to ProcessingMode="Local"

    Monday, November 22, 2010 12:20 PM