Posts

Showing posts from November, 2016

How to generate PDF/ xls report from .rdlc without using Reporting services in c#.

In this blog, I am going to show how to create a Report dynamically using a DataSet in Report document (*.rdlc). and show the

report without much effort.


Step 1: Create a Report(.rldc) using SSRS or any other tool. Add appropriate  DataSet and DataSource and with required columns

create a table and Bind DataColumns. Once Report created build and Goto Code behind solution.

Step 2: Now in the Code behind, add the following codes and required references.

Note: I have added just 3 fields report and the same field should be used in code behind also with exact DataSet name as it is

in Report. Currently DataSet has hardcode value which you can replace with fetched value from Database.


using System.Collections.Generic;
using Microsoft.Reporting.WebForms;


        #region ReportGenerateFromRDLFile
        public static void RenderReport()
        {
            string sReportPath = string.Empty;
            string sExtension = ".xls";

            try
            {
                sRep…
go to top image