Click here to Skip to main content
11,639,861 members (65,811 online)
Click here to Skip to main content

Microsoft SQL Server Reporting Services (SSRS) using LINQ and ASP.NET

, 13 May 2010 CPOL 28K 18
Rate this:
Please Sign up or sign in to vote.
My first example of using Microsoft SQL Server 2008 Reporting Services (SSRS)

Introduction

What I want to do here is help out those who are just starting out with .NET 3.5 and the SSRS, if you follow the steps listed below you will be able to create your first Report.

Background

I have used VS 2008 and SQL 2005 and Linq for this example.

Steps

  1. Create a table for example StudentInfo:

  2. Add some data to your table:

    Report2.jpg

  3. Create a new project using VS 2008:

    Report3.jpg

  4. Add new item to your project:

    Report4.jpg

  5. Select the report from the list of item:

    Report5.jpg

  6. Enter your report name:

    Now what you have to do is drag the ReportViewer to your aspx page:

    Report6.jpg

    Select the datasource of your Reportviewer:

    Report7.jpg

This how your HTML page will look:

Report8.jpg

Here are some of the steps you have to do:

Add a dataset to your project and add a datatable to the dataset. I use MyDataset and DataTable StudentInfoDataTable. Here is the code you have to copy to your page load event:

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
MyDataClassesDataContext db = new MyDataClassesDataContext();
IQueryable<StudentInfo> data = from d in db.StudentInfos select d;
ReportDataSource rds = new ReportDataSource("MyDataSet_StudentInfoDataTable", data);
ReportViewer1.LocalReport.DataSources.Add(rds);
}
}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

T.Ashraf
Chief Technology Officer Compuacademy.net
United States United States
More than 15 years of experience in design, architecture and development of various commercial objects oriented application.Other Specialties

Data Migration:
• MS Access database to SQL 2005/2008
• MS Access database to Oracle
• MS Access database to My SQL
• FoxPro to SQL

Application Migration:
• Converted MS Access application to .net web application (Asp.net)
• Excel Application to .net 3.5 web application
• FoxPro application to .net 3.5
Reporting development and support
• MS access reports
• Crystal reports
• SQL Reports(SSRS)
• DevExpress reports
• Cognos reports
Application development and support
• .net Application web /Win forms
• SharePoint
• MS Access
• Website
• Ecommerce
• WCF
• Web Services
3rd Party Control Support
• DevExpress
• .netForum
• Telerik
Version controls Support
• Team Foundation Server
• Source Safe
• CVS
• SVN

You may also be interested in...

Comments and Discussions

 
Questionincomplete Pin
subhajit Giri20-Jul-13 0:55
membersubhajit Giri20-Jul-13 0:55 
GeneralMy vote of 1 Pin
rams2hari20-May-10 4:13
memberrams2hari20-May-10 4:13 
GeneralRe: My vote of 1 Pin
T.Ashraf26-May-10 4:48
memberT.Ashraf26-May-10 4:48 
GeneralIncomplete Pin
rams2hari20-May-10 4:13
memberrams2hari20-May-10 4:13 
GeneralMy vote of 2 Pin
tec-goblin17-May-10 23:32
membertec-goblin17-May-10 23:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150731.1 | Last Updated 13 May 2010
Article Copyright 2010 by T.Ashraf
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid