Using XML to Find Errors in a SSRS Report

Home > Blogs > SQL Server > Using XML to Find Errors in a SSRS Report

Using XML to Find Errors in a SSRS Report

Like This Blog 0 Peter Avila
Added by July 2, 2013

As we see in the BI779 SQL Server Reporting Services course, a report’s rdl file is actually an XML file. One of the benefits of an XML file is that, since it is text and includes all the objects of our report, we can use it to help us find solutions to certain errors that might otherwise be hard to find. Let’s see an example of this.

Let’s say we have a report with a parameter called @CustID. When we try to run the report, Reporting Services encounters an error in the spelling of a parameter name (@CustoID), but it does not tell us where the error was found.

001-using-XML-to-find-errors-in-a-SQL-Reporting-Services-Report

Parameters can be used in many places, including datasets, textboxes, and others. If you have a large report with several data regions, each containing several textboxes, and/or multiple datasets, it can be a daunting task to find where the misspelling is located. But there is an easy way to pinpoint the location of the error. All we need to do is search for it in the XML file.

1. To open the XML file, right-click on the report .rdl file in Solution Explorer and select View Code.

002-view-code-using-XML-to-find-errors-in-a-SQL-Reporting-Services-Report

2. Notice that the XML file is displayed.

003-xml-displayed-using-XML-to-find-errors-in-a-SQL-Reporting-Services-Report

3. Press Ctrl-F on your keyboard to open the Find and Replace window, enter the text you want to find (@CustoID, in our case) in the Find what field, and then click Find Next.

004-find-replace-custID-using-XML-to-find-errors-in-a-SQL-Reporting-Services-Report

4. In our example, the misspelling is found to be in the SalesOrders dataset.

005-SalesOrders dataset-using-XML-to-find-errors-in-a-SQL-Reporting-Services-Report

5. So, now we know where to go to fix the problem. We right-click the SalesOrders dataset in the Report Data panel and select its properties…

006-SalesOrders-panel-dataset-using-XML-to-find-errors-in-a-SQL-Reporting-Services-Report

6. …and we can now easily locate the problem and fix it.

007-fixed-dataset-using-XML-to-find-errors-in-a-SQL-Reporting-Services-Report

 

And that’s it!

Enjoy!
Peter Avila
SQL Server Instructor – Interface Technical Training
Phoenix, AZ

Videos You May Like

Cable Testers and How to Use them in Network Environments

0 645 1

This content is from our CompTIA Network + Video Certification Training Course. Start training today! In this video, CompTIA Network + instructor Rick Trader demonstrates how to use cable testers in network environments. Let’s look at some tools that we can use to test our different cables in our environment. Cable Testers Properly Wired Connectivity … Continue reading Cable Testers and How to Use them in Network Environments

How to use the PowerShell Script Analyzer to Clean Up Your Code

0 1211 2

In this video, PowerShell instructor Jason Yoder demonstrates how you can use the PowerShell Script Analyzer to help you format your code to best-practices. For instructor-led PowerShell training classes, see our course schedule: Microsoft Windows PowerShell Training Download the PowerShell Analyzer scripts used in this video. <# ╔══════════════════════════════════════════════════════════════════════════════╗ ║ ║ ║ PowerShell Script Analyzer ║ … Continue reading How to use the PowerShell Script Analyzer to Clean Up Your Code

OSPF Adjacency Troubleshooting Solution – Getting Close to the OSPF adj

0 246 1

In this video, Cisco CCNA & CCNP instructor Mark Jacob shows how to troubleshoot OSPF Adjacency issues by showing the distance between routers with the show ip ospf neighbor command.

Write a Comment

Share your thoughts...

Please fill out the comment form below to post a reply.