Archive for the ‘programming’ category

MS Reporting Services Report Viewer Control printing errors with IE8 and Vista

May 29th, 2009

We use SQL Server 2008′s Reporting Services for all of our site’s reports here at work.  Along with that we also use Microsoft’s Report Viewer control which gives you the ability to serve up the RDL files that are stored in SQL Server.  One of the features that the control offers is the ability to print your reports.  To accomplsih this it uses Active-X, which we all know can be funky and a hassle to troubleshoot when it’s not working properly.

When we released our new system back in February we got most of our users printing with minimal support.  We encouraged all of them to upgrade to IE 7 (many were still using IE6) which did fine with the control.  Shortly after our launch Microsoft started rolling out IE8 and our users slowly started upgrading.

That’s when we found many of them having issues printing.  As you’ll see in this screen shot, they would simply get a generic error when clicking the print button, even after successfully installing the print control.  As a work around we were having folks export to PDF and then print from there.  Obviously this wasn’t an ideal solution and we started troubleshooting to figure out what the problem was.

rs-report-error

After doing some testing on our end on virtual machines we were able to reproduce the problem and narrowed it down to Windows Vista running IE8.  Since we weren’t able to resolve the problem on our virtual machine configuration with anything we tried we eventually opened a support ticket with Microsoft.

After some support calls with Microsoft they informed us that in order for this to work properly you have to add the site that’s using the report viewer control as a trusted site if you’re using Internet Explorer 8 and Windows Vista. We thought this was odd because we definitely had tried this on our virtual machine setup and didn’t have any luck.

What we found out on our own later was that as that this solution does not seem to help if you originally started out with a Beta or RC (Release Candidate) copy of IE8 that had been upgraded to the final release.  That was the scenario we had on our virtual machine that we were using to test IE8 and even the trusted site fix didn’t help in that scenario.

So, if you are having this problem and you’re using a clean install of IE8 or an upgrade to the final release of IE8 from a previous version adding the trusted site to fix this problem is easy.

Just open up IE and click Tools > Internet Options and follow the steps shown here in the screen shot to add your site as a trusted site:

trusted-sites

Restart your browser and you’re in business.

Now if they could only get away from Active-X so our users that decide not to use IE can print.

Baltimore SQL Server Users Group 5/4

April 23rd, 2009

Last night at the Frederick .NET user group Jeremy Kadlec of Edgewood Solutions (one of the founders of the Baltimore SQL Server Users group, was a speaker.  I didn’t realize that this group met so close to where I work here in Columbia.  After checking out the website I was excited to learn that they met on the first Monday of the month.  Tuesdays and Thursdays, which seem to be popular days for most of the other user groups in the area are not an option for me since I handle the kids those nights while my wife tutors.

So, I’ll be checking out the group for the first time on Monday May 4th.

Presenter: Jack Richins of Microsoft

Title – SQL Server 2008 Security

Abstract – SQL Server 2008 introduced three new security features – Transparent Data Encryption, Enterprise Key Management, and SQL Audit. With increased concerns about privacy and data thefts, security remains a “must have” business feature even with constrained budgets. Come learn how to use these features to better secure your database applications and met business compliance regulations.

Learn how to:
* Protect your data at rest
* Use 3rd party key management systems to encrypt data in SQL Server with keys stored outside of SQL Server
* Keep an audit record of access to sensitive data without tanking your performance

Learn more about their meeting schedule here.  If you’re in the area and are interested in the topic, stop by!

Going for MCTS certification on Visual Studio 2008

April 23rd, 2009

I have been dragging my feet for the past few years in regards to finishing up my Microsoft development certification.  Actually, the last test I took was 70-229 Designing and Implementing Databases with Microsoft SQL Server 2000 Enterprise Edition back on Dec 08, 2003.  WOW, I had no idea it was that long until I just looked it up.

Anyway, what finally got me to get moving was a great voucer/coupon I got via email from Prometric, the testing company I used last time.  Not sure if it’s specific to me because I’m already a MCP (yes, I passed that test from years ago) or not but I’ll share it just in case it does work for others…

…Improving and validating your technical skills can help.

That is why Prometric is providing a limited offer to the first 4,000 individuals to help get your Microsoft Certified Professional status current or achieve an additional certification.

Offer available for customers who have taken their last certification exam prior to January 1, 2007.

Use this promo code ‘MCPBACK’ and get a $25 USD Certification (Normally priced at $125 USD). This offer is valid for any exam in the MCTS/MCPD/MCITP track. Does not include Microsoft Office or Windows end-user (non-IT) focused exams.

Go to: www.Prometric.com/microsoft to sign-up for your next exam.

But you better hurry!
You must take your exam by June 30, 2009.

Offer valid in US and Canada only.

My plan is to obtain the MCTS: .NET Framework 3.5, ASP.NET Applications certification related to Visual Studio 2008.  What I’m going to do is take the C# test rather than VB.NET, which is what I mainly use here at work.  I can work in C# and have written a few things in it, but my main language since I’ve been working in .NET has been VB.NET.

I figure this will be a good way to become more familiar with C# and will force me to learn the language.  Once you’ve been working with .NET for a while and looking through code samples on Google you’ll quickly realize that the majority of the code samples out there are done in C#.  So, as you can imagine, converting those to VB.NET can be frustrating after a while.

So, we’ll see how it goes.  I only spent $25 to book the test and another $44 to upgrade my copy of MCTS Self-Paced Training Kit (Exam 70-536): Microsoft® .NET Framework Application Development Foundation to the second edition.  I picked up the first edition a year or two ago when I first decided I wanted to get the MCTS and only got about 1/2 way through it.

My test is set for June 17, wish me luck!

FredNUG tonight

April 22nd, 2009

I’ll be attending the Frederick .NET user group tonight.  Tonight’s topics will be SQL Server Performance and Coding for Fun and Profit.  More information can be found here.

SQL Server 2008 SP1 Final Released?

April 1st, 2009

We’ve had an open support ticket with Microsoft due to some bugs we’re seeing with SQL Server Reporting Services 2008.  After Microsoft saying that the Update Pack 4 for SQL Server 2008 (released back in mid-March) would fix our problems, they sent us an email this week letting us know that the final version of Service Pack 1 for SQL Server 2008 would be released yesterday, March 31, 2009.

Unfortunately so far the links they’ve provided don’t go anywhere.  I’ll be checking these links through the day and the rest of the week and will post any further updates if I actually do find the “real” links.

According to our internal document, below is the information about SP1:

Microsoft SQL Server 2008 Service Pack 1

Release date: March 31, 2009

How to obtain

To obtain SQL Server 2008 SP1, visit the following Microsoft Web site:

http://www.microsoft.com/downloads/details.aspx?FamilyID=66ab3dbb-bf3e-4f46-9559-ccc6a4f9dc19

To obtain Microsoft SQL Server 2008 Feature Pack, April 2009, visit the following Microsoft Web site:

http://www.microsoft.com/downloads/details.aspx?FamilyID=b33d2c78-1059-4ce2-b80d-2343c099bcb4

To obtain Microsoft SQL Server 2008 Express Edition SP1, visit the following Microsoft Web site:

http://www.microsoft.com/downloads/details.aspx?FamilyID=01af61e6-2f63-4291-bcad-fd500f6027ff

It should be released on March 31, 2009.

Ways to optimize your ASP.NET applications

February 2nd, 2009

I’ve spent quite a bit of time recently optimizing our ASP.NET application to help improve performance.  After spending time analyzing the code and the database for inefficiencies, it was clear that something needed to be done to minimize the data (reduce the request size) that was being delivered to each user for each page request.

After lots of reading and testing, I ended up reducing the size of most of our page requests by as much as 95% in some instances. In the next few posts I will go over, in detail, how you can use the following steps to optimize your ASP.NET (and non-ASP.NET) web applications with only a little bit of work:

  • Enabling and configuring HTTP compression in IIS6
  • Enabling content expiration for static content (graphics, css files, JavaScript files, etc) in IIS6
  • Changing your application to store ViewState in the session rather than in each page
  • Configuring Telerik’s Radcontrols to work as efficiently as possible

Cumulative update package 3 for SQL Server 2008

January 30th, 2009

Since we have been developing with SQL Server 2008 here at work on my latest project I have been keeping an eye on its available updates and fixes (at least until they come out with Service Pack 1). Cumulative Update Package 3 has been made available now.

Per Microsoft:

A supported cumulative update package is now available from Microsoft. However, it is intended to correct only the problems that are described in this article. Apply it only to systems that are experiencing these specific problems. This cumulative update package may receive additional testing. Therefore, if you are not severely affected by any of these problems, we recommend that you wait for the next SQL Server 2008 service pack that contains the hotfixes in this cumulative update package.

After scanning down the list it seems that we could benefit from at least two or three fixes listed:

  • FIX: You may encounter a deadlock scenario when you use table variables in SQL Server 2005 or in SQL Server 2008
  • FIX: When you use a ReportViewer control to view a SQL Server 2008 Reporting Services report that contains two pages, the formatting for the second page is lost
  • FIX: When you print a report by using the SQL Server 2008 Reporting Services Client-Side Printing functionality, the spacing is too small or too large

I would probably take Microsoft’s advice and hold off installing this update if you’re not specifically seeing any of the issues mentioned in the fix list.

You can download Cumulative update package 3 for SQL Server 2008 here.

SQL Server (2008) Performance Tuning Resources

December 23rd, 2008

Here is a (running) list of some SQL Server Performance Tuning resources that I’ve compiled over the past week or so.  These have been helpful in educating me on the black art of database performance tuning.  I realize the title states SQL Server 2008, but really most of these probably apply for SQL Server 2005 and 2008.  I, particularly am working with 2008, which is why I’ve put them into that category.

General

Missing Indexes

Duplicate Indexes

Unused Indexes/Index Usage

Re-indexing

Inefficient Queries

Performance Counters

Performance Data Collector

Database Engine Tuning Advisor

Updating Statistics

Deadlocks

JavaScript Reporting Services ReportViewer control error fix

December 8th, 2008

I have been going back and forth banging my head against a wall trying to fix a JavaScript error that was happening on my Reporting Services ReportViewer control when the View Report button is clicked.  The error was a JavaScript error and seemed to be related to using something AJAX related on the same page as the ReportViewer control, but it took me a while to figure out what it was and fix it.  All of the problems I saw on the web related to using either an AJAX update panel or one of the extenders in the AJAX Control Toolkit.  Unfortunately for me I wasn’t using either one of them so trying to figure this one out was tricky.

The specific JavaScript error was:

Microsoft JScript runtime error: ‘this._postBackSettings.async’ is null or not an object

My page was setup where I had a master page with an AJAX menu on it (Radmenu to be specific).  In order to use the Radmenu you need a ScriptManager object.  Other than the menu, I didn’t have any AJAX related controls on either the master page or the content page.

What I eventually figured out was that my report pages (which use a base class) needed to disable partial rendering.  To do this, you must do it in your page’s init event.  If you do it after the init you’ll get an invalid operation exception.  Here’s the code in the base class (you can put this in your code behind if you’re not using a base class):

    Private Sub Page_Init1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
 
        ' Make sure this page has a master page
        If Not IsNothing(Me.Master) Then
 
            Dim masterScriptManager As ScriptManager
            masterScriptManager = CType(Master.FindControl("MasterScriptManager"), ScriptManager)
 
            ' Make sure our master page has the script manager we're looking for
            If Not IsNothing(masterScriptManager) Then
 
                ' Turn off partial page postbacks for this page
                masterScriptManager.EnablePartialRendering = False
            End If
 
        End If
 
    End Sub

Just in case others stumble across this and are trying to solve their problem, here are some of the links I landed on when trying to solve the problem:

SQL Server 2008 RTM released!

August 8th, 2008

Not that I think I’m breaking any news here, but SQL Server 2008 has been officially RTM (released to manufacturing).  So far I’ve been very pleased working with SQL Server 2008 and am excited to get my RC0 version updated to an official release.

One thing I stumbled across was a warning users to wait for Visual Studio.NET 2008 SP1 to be released BEFORE upgrading to the RTM version of SQL Server 2008.  This blog post cites compatibility problems if you don’t have SP1 installed before working with the RTM version of SQL. What I’m not sure about is if this applies to people using beta versions of SQL Server 2008 (RC0), Visual Studio 2008 SP1 and .NET Framework v3.5 SP1 like I am.  This uncertainty made me think that it may be best to wait for the final release of SP1 for VS.NET and the 3.5 Framework.

I then came across a nugget here that said:

well….there’s a…ahem…NDA about this topic…but SQL Server 2008 RTM ships with a RTM version of the .NET Framework 3.5 SP1 bits…i’ll let you connect the dots.

I guess it’s time to dig around in the RTM version of SQL 2008 to see if it’s there.  I also wonder if it’s safe to install over top of my RC0 version of if I should remove RC0 before installing the RTM version.  I guess I’ll have to Google more to see what’s required.  I’ll provide updates as I find answers and get upgraded.

**** Update:

According to the release notes the beta SP1 isn’t an acceptable solution.  And since they’re saying SP1 will be officially released next week anyways, it makes sense just to wait for that I think.