Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

ReportViewer Control will not page results

$
0
0

I am using VS 2010, ReportViewer 2010, and .NET 4.0. The report will load and I can even export the report to excel, but I can not get it to change pages. It will act like it is loading but will just continue to show the first page. On this same server I have another project running VS2010, Reportviewer 2010, and .NET 3.5 and it works fine but I cannot see any differences between the two except for the .NET version. Is there an issue with using .Net 4.0 and reportviewer 2010?

below is my code behind code:                           

    Report rptInfo;
            int rptid;
            int cilcode;
            int empId;

            //get variables from url
            Int32.TryParse(StringEncryptDecrypt.Decrypt(Request.QueryString["rptid"]), out rptid);
            Int32.TryParse(StringEncryptDecrypt.Decrypt(Request.QueryString["cilcode"]), out cilcode);
            Int32.TryParse(StringEncryptDecrypt.Decrypt(Request.QueryString["empid"]), out empId);                        
            string secret = StringEncryptDecrypt.Decrypt(Request.QueryString["s"]);//secret phrase make sure this came from correct source

            if (secret != ConstantsShared.INSIGHT_REPORT_SERVER_PASS_PHRASE)
            {
                //errorMessage.Text = "Request not authorized. Be sure you ended up here through an application and not a bookmark. " + secret;
                return;
            }

            //if we don't have a report id then we can't do anything so show error message
            if (rptid == 0)
            {
                //errorMessage.Text = "report could not be found.";
                return;
            }

            //get report specific info so we can setup the report
            using (var rps = new ReportRps(empId))
            {
                rptInfo = rps.ByPK(rptid);
            }

            //if we have report info then lets show the report
            if(rptInfo != null)
            {
                rvReport.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
                rvReport.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["reportServerUrl"]);
                rvReport.ServerReport.ReportPath = rptInfo.Path;
                rvReport.ShowParameterPrompts = true;
                rvReport.ShowReportBody = true;

                //lblReportName.Text = rptInfo.Name;

                //go through filters adding to filter list
                foreach(var flt in rptInfo.Filters.Split(','))
                {
                        if(flt == "CilCode") 
                        {
                            Microsoft.Reporting.WebForms.ReportParameter objParameter;
                            objParameter = new Microsoft.Reporting.WebForms.ReportParameter(flt, cilcode.ToString());
                            rvReport.ServerReport.SetParameters(objParameter);
                        }
                }

                rvReport.Visible = true;

            } 

design view:

<div>
        <div id="report-header">
            <div class="logo">
                <img alt="Chiltern Logo" src="Images/chiltern_logo_ciif.jpg"/>
            </div>
            <div class="reportTitle">
                <h1>Insight Report Viewer</h1>
                <span><asp:Label ID="lblReportName" runat="server"></asp:Label></span>
            </div>
            <div class="clear error">
                <asp:Label ID="errorMessage" runat="server"></asp:Label>
            </div>
        </div>
        <div class="clear">
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <rsweb:ReportViewer ID="rvReport" runat="server" AsyncRendering="false" SizeToReportContent="True" >   
            </rsweb:ReportViewer>
        </div>
    </div>


Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>