Solved

Strange SSRS printing issue.

Posted on 2014-02-12
3
643 Views
Last Modified: 2014-02-14
Hello Experts,

I've recently setup a new webserver with Windows Server 2012.  I installed SSRS 2008 R2 with SP2.  I've made sure all udpates are done.

I have an aspx page with a reportviewer and some code-behind.  Here is the code:

            ReportViewer1.ProcessingMode = ProcessingMode.Remote
            ReportViewer1.ServerReport.ReportServerUrl = New System.Uri("http://myweb/SSRS")
            ReportViewer1.ServerReport.ReportPath = "/mypath"
            ReportViewer1.ShowCredentialPrompts = False
            ReportViewer1.ServerReport.ReportServerCredentials = New MyReportServerCredentials

Open in new window


I've used this code on many pages before without any issues.  I also assign about 7 different report parameters.  Since setting up a test page I've had issues printing reports.  Whenever I load a report it will print normally.  If I change one of the report parameters and then try to print the report it will always print the original report, the settings prior to the parameter change.  Doesn't matter if I click "View Report" a few times, or refresh the report.  The data on the report changed to the new parameter setting, but when I print the report it is still the original data.  

I thought it was a browser issue, or maybe the print client.  I have tried this on two different desktops, along with the actual webserver.  I've deleted the print client and re-installed it.  I even updated sql 2008 r2 with SP2 to see if that would help and it doesn't.

When I view this report in the report manager it works fine.  Looking at the print preview, the data always changes after a parameter change.  So my assumption is that there is an issue with my code for the reportviewer, or some IIS issue related to reports and printing?

Any help?  I can't seem to find anyone else with this problem...
0
Comment
Question by:jay-are
  • 3
3 Comments
 

Author Comment

by:jay-are
ID: 39854866
I just used debug in VS2010 with my test page.  It worked fine.  So it works on the report manager and in VS debug, but not when printing from IE.

I can also export the report to pdf, excel, csv etc. with no issues.
0
 

Author Comment

by:jay-are
ID: 39857686
There must be something simple I'm doing wrong here.  Anyone?

Win server 2012
SQL 2008 R2 SP2
VS 2010

All patches done.  Works in debug and it works on the reportmanager, doesn't work on published page.
0
 

Accepted Solution

by:
jay-are earned 0 total points
ID: 39859826
I was able to resolve this issue.  Some time back I was trying to stop my clients from caching the website pages.  In my web.config I had this:

<httpProtocol>
      <customHeaders>
        <add name="Cache-Control" value="max-age=2592000;" />
      </customHeaders>
    </httpProtocol>
    <staticContent>
      <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00" />
    </staticContent>

Open in new window


This was actually causing the client browser to cache the report when it first loads.  When you click the print icon in the reportviewer it would not make a call to the server to get the current report info.  It was simply using its cached data.  Such a simple and stupid mistake on my part.

Just leaving this here in case anyone ever has this issue.  I hope others don't make these mistakes like I do!  :)
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It is helpful to note: This is a cosmetic update and is not required, but should help your reports look better for your boss.  This issue has manifested itself in SSRS version 3.0 is where I have seen this behavior in.  And this behavior is only see…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now