I am trying to export RDLC report to Excel without ReportViewer. I am using Microsoft Visual Studio 2010 and Microsoft SQL Server 2008 R2. Below are my Steps:
- Add New Item from Solution Explorer -- Reporting -- Report Wizard -- myReport.rdlc
Follow the wizard steps -- ConnectionString from web.config -- stored procedure as the source to create the report. I made 2 parameters, which is
StartDate
andEndDate
.This is my stored procedure:
CREATE PROCEDURE mySP (@StartDate datetime, @EndDate datetime) AS BEGIN SELECT * FROM myTable WHERE TheDate >= @StartDate AND TheDate <= @EndDate END
Add some fields for report
- On the report designer -- Add 2 parameter, StartDate and EndDate.
- Right Click on the designer -- Select Report Properties
- On Variables section -- Add 2 parameters by Clicking on 'fx' button
- Go to xsd file (myApp.xsd) -- on the tableadapter, right click then configure
- Configuration of TableAdapter -- No change, I just click Next and Finish
Those are my steps to create the RDLC Report. I took the source from Create RDLC Report in VS 2010 and SQL Server 2008
The question is: How can I export the RDLC Report that I just design without using ReportViewer? I have one button on my webpage, let's say: 'Export to Excel'.
Thank you.