[Last Call] Learn how to a build a cloud-first strategyRegister Now


How do I run asp.net reports off my web site?

Posted on 2009-05-01
Medium Priority
Last Modified: 2013-11-26
I have written an asp.net C# web site using visual studio 2008. I am using a .net 3.5 listview control as my data viewer connected to a linq datasource to perform my select queries, inserts, edits and deletes. I am now hoping to provide my users with some sort of frontend reporting interface/tool so they can easily pull back crucial data (between certain dates, items with a closing date within the next month etc) from my backend sql database allowing them to print the results for reviewing. I have come across the below link but I was wondering if there was an easier free approach that I can use?


Question by:Shepwedd
  • 2
  • 2

Accepted Solution

RyanAndres earned 2000 total points
ID: 24281058
You could use a ReportViewer or CrystalReportViewer control.

See below for an example:
ReportViewer viewer = new ReportViewer();
            DataTable dt = new DataTable(); //  Change this to your datatable
            ReportDataSource ds = new ReportDataSource("DataSet", dt); // Change this to your dataset name defined int he report file
            viewer.LocalReport.DisplayName = "Report Name";
            viewer.LocalReport.ReportPath = @"C:\report.rdlc";

Open in new window


Author Comment

ID: 24296216
I've managed to create a ReportViewer page (rdlc) through the ASP.NET Reports Web Site template within Visual Studio 2008. I have managed to build the Object Data Source and retrieve data from one of my tables. What I now need to do is join this table on to others in my database to retrieve more relevant data and then create two textbox controls (that will contain date values - to and from date) to allow users to filter my data between two dates, possible?


Expert Comment

ID: 24296587
You can manipulate the table as necessary before adding it to the reportviewer then reference it in your rdlc.

Author Comment

ID: 24296889
I think my problem is that I didn't start with an asp.net reports web site, I started with just a normal asp.net web site and now that my default.aspx page etc is completed I'm now wanting to add a report to my project, possible? I noticed that when starting a new reports web site from the VS 2008 templates and following the wizard to run the report it's the default.aspx page that is needed, I already have a default.aspx page assigned to my listview so how do I run my report? And how do I reference a manipulated table through the rdlc page? I'm guessing the joins etc have to be done through the object data source? Can I link a report to a linq data source?


Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

834 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