How To Convert RDL files to RDLC files
May 6, 2010 11 Comments
Title : How To Convert RDL files to RDLC files
Publish Date : 06/05/2010
Version : 1.0
Author : Nasser Hadjloo
Author Mail : email@example.com
Copyright (c) 2010 Nasser Hadjloo.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.
1 – Both of them use a same XML schema called RDL (Report Definition Language). SQL Server Books Online documented this schema completely.
2 – “The ReportViewer control, which processes .rdlc files, ignores the <Query> element of RDL. If a report definition contains a query, the control will not process it. So A client report definition (.rdlc) file will only contain a query if it originated as a .rdl file.” MSDN said.
3 – DataSet and Data Source which used in RDLC and RDL files are totally different. RDLC (Client reports) use DataSet which actually is a DataTable and RDL (SQL Server Report) use DataSource which consist of a Data Source (actually connection String). Some Credential Information which used to access Database mentioned in Data Source and finally a SQL Command (StoreProcedure – Function …) or a Query which retrieve data from Database.
How To Convert RDL Files To RDLC Files
1 – As I mentioned before, both of these files are using RDL schema for representing items in a XML document, so in XML conversion there is no change. All the things you have to do, is to change RDL postfix to RDLC, commonly by Command Prompt.
2 – After that you need to Add this Report as an existing item to your Web project. (commonly in a report folder like “~/SystemName/Reports”)
3 – Next step is to create a dataset for this report, so create a DataSet File and put equivalent columns on it.
4 – At this time you need a method to retrieve data from Database and fill data on your DataSet.
5 – As you know, there is a Report Viewer control (actually an ActiveX) which get a Report and display itto user. So you need to create a page and use Report Viewer control on it. After including Report Viewer Control in the page, you need to assign your Report (RDLC file) to Report property of Report Viewer control. And also to assign your Dataset to DataSource property of ReportViewer.
6 – At the end you have to build project and check the results.