MS SQL Server
  Home arrow MS SQL Server arrow Page 4 - Building a Multi-table Report with SQL 200...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MS SQL SERVER

Building a Multi-table Report with SQL 2005 Reporting Services
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 13
    2006-12-05

    Table of Contents:
  • Building a Multi-table Report with SQL 2005 Reporting Services
  • Create an RS Project
  • Connecting to data
  • Creating a query
  • Designing the table: choosing page and grouping
  • Deploying the report on the Report Server

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Building a Multi-table Report with SQL 2005 Reporting Services - Creating a query


    (Page 4 of 6 )

    The Report Wizard--Design the Query window pops up as shown in the next picture. Herein you will be building the query used in the report.

    Click on the Query Builder... button. The Query Builder screen opens up as shown in the next picture. If you are used to any of Microsoft's database software such as MS SQL Server or Visual InterDev, this should be familiar to you. However, in order to bring the tables to the design pane, you need to click on the icon at the very left of this page at the top. When you hover over this icon with the mouse the tool-tip should show 'Generic Query Designer.' If this is not properly set, the context sensitive drop-down menu that shows up when you right click the design pane will not show the menu to add tables.

    Now when you right click in an empty area in the design pane, you can choose to add the tables from the database you chose in the earlier screen as shown.

    When you click on Add Table... in the above drop-down, you will be presented with the window shown in the next picture, where you add the tables to the design pane. Click the Customers and Orders tables. Close the Add Table window. You will find the two tables in the Query Builder design pane as shown.

    The two tables show up as joined by some relationship that is defined by their primary/foreign key relationships. If you want to examine what it is, click on the line joining the two tables to show the join Properties as shown below. The properties indicate that CustomerID is the common column for the two tables and that the join is of the type Inner Join.

    Now choose the columns that you need to include in your report in the check boxes alongside the columns in the two tables. The default SQL statement in the SQL pane gets modified simultaneously with your choice. Here a number of columns have been chosen. The query may be modified to suit your needs as the processes of selecting and deselecting are reversible.

    Once you are satisfied that you have made the right choices, the right filtering, and the right ordering, you may test the query by executing it. This is again accomplished by bringing up the context sensitive help and picking the ExecuteSQL item as shown.

    As mentioned earlier you may refine the query by making changes to the SQL Statement, or in the designer. The query chosen for this report is as shown in the next paragraph.

    SELECT Customers.CompanyName, Customers.City, Customers.PostalCode, 
    Customers.Phone, Orders.OrderDate, Orders.RequiredDate, 
    Orders.ShipVia, Orders.ShipCity
    FROM   Customers INNER JOIN
    Orders ON Customers.CustomerID = Orders.CustomerID
    WHERE     (Orders.ShipCountry = N'Germany')
    

    Now click on the OK button in the Query Builder. This will bring you back to an earlier screen as shown in the next picture showing the query string you developed in the earlier screen.

    Select the type of report

    Clicking on the Next button will bring up the window Report Wizard--Select Report Type. There are only two choices; the default is tabular. This is accepted for this tutorial. The Report Services window appears to show all records embedded in a table when this option is chosen, as we shall see later.

    More MS SQL Server Articles
    More By Jayaram Krishnaswamy


       · SQL 2005 Server's RS is a full service reporting tool fully integrated with VS...
       · i would like to know how to generate multi-table ( belong to different databases)...
       · Hi,There is a very easy to use built for OEM integration solution that does...
     

    MS SQL SERVER ARTICLES

    - Completing the Introduction to Transact-SQL
    - A Brief Introduction to Transact-SQL
    - Lookups and Blocking Bad Data
    - Field Validation Rules for Blocking Bad Data
    - Using Masks to Block Bad Data
    - Blocking Bad Data
    - Using @@ROWCOUNT and TABLE Variables for Dat...
    - How to Use Variables, IF and CASE in Databas...
    - Creating Important Aspects of Notification S...
    - Working wth Variables in Database Interactio...
    - Delving Deeper into Notification Services
    - Notification Services
    - Building a Multi-table Report with SQL 2005 ...
    - A Secure Way of Building Connection Strings
    - Transferring a Database Using the SSIS Desig...

     
    Application Delivery: Everything You Wanted to Know, but Didn`t Know You Needed to Ask
    A comprehensive guide to examining the topics of Wide-area Data Services and app....

     
    Best Practices: Safe and Secure Hardware Asset Recovery
    Companies increasingly must meet EPA and local requirements for the disposal of ....

     
    Managing SSL Security in Multi-Server Environments
    Read this white paper to learn how to simplify management of your organization's....

     
    Open Source Security Myths
    Open Source Software (OSS) is computer software whose source code is available t....

     
    Power and Cooling Capacity Management for Data Centers
    This paper describes the principles for achieving power and cooling capacity man....

     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT