2
votes

I have added a reportviewer to my page :

   <asp:ScriptManager ID="Scriptmanager1" runat="server"></asp:ScriptManager>
    <rsweb:ReportViewer ID="repViewer" runat="server" Width="100%" Height="100%" OnDrillthrough="repViewer_Drillthrough"></rsweb:ReportViewer>

Reports are loading fine, but when I click on a drillthrough column (a link), the report seems to reload (navigation buttons of the report go disabled and enabled again), but that's it, the OnDrillthrough event is not triggered (the breakpoint is not reached).

What am I doing wrong ?

EDIT

After playing a bit more with the control, I've noticed that nothing actually works. Paging, Searching, DrillingThrough, you name it... The report goes disabled and enabled again, but it always shows the same set of data (first page basically...)

One more thing. I don't have the report locally in my website. I use the ReportViewer to access remote reports. The code-behind is as follow:

  protected void Page_Load(object sender, EventArgs e)
    {

        repViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
        repViewer.ServerReport.ReportServerUrl = new Uri("http://mssql/reportserver");
        repViewer.ServerReport.ReportPath = "/Domiciliations/myreport";
        repViewer.ServerReport.Refresh();
    }
1
Does the report have a file extension of .rdl or .rdlc? Are you catching any errors? - tgolisch
When you run the report on the report server (SSRS host) does it work correctly? (ie, is the error only happening with reportviewer)? - tgolisch
yes, on the server it works absolutely fine. This problem only occurs when running the report inside the reportviewer. - Sam
Are you running any of this through a proxy or gateway (like RSA) or SharePoint or some other wrapper that will re-write the URL? I encountered this same thing when I ran reports through AquaLogic (a web wrapper/proxy that provided a security layer in front of my asp.net stuff). - tgolisch
yes, I do have a URL rewrite module. But I've disabled it because I thought the problem might come from that. It doesn't change anything. When I interact with the report (paging, searching,...) I can see javascript being downloaded, so it's definitely not rewriting url's. - Sam

1 Answers

3
votes

I just spotted the problem. Each time the page loads, you are re-binding the report and wiping any additional state changes. You should only initialize it when the page is not posting back. Try this instead:

protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack())
    {
        repViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
        repViewer.ServerReport.ReportServerUrl = new Uri("http://mssql/reportserver");
        repViewer.ServerReport.ReportPath = "/Domiciliations/myreport";
        repViewer.ServerReport.Refresh();
    }
}