Home » Asp.netRSS

Programmatically Generated Reports (RDLC) ASP.NET C#

Good Day,
 
I been looking for a day now and I couldn't find a good source of information.

I have a one of a kind report wherein the RDLC file including all controls are programmatically generated (system generated)  by one of my asp.net page. All fields and its values to be displayed on the RDLC file are coming a stored procedure. On my stored procedure I'm using a temp table for example #MyTable and its columns can adjust programmatically/automatically base on date range. BTW I'm using C# code to generate the RDLC file and preview it on the report viewer of a page.

Sample:

Date Range: 01/01/2008  to 12/31/2009 

My temp table may look like below

AssetCode, Description, Class,  Jan2008, Feb2008, Mar2008 --> until column reach Dec2009

AAAA00001, AAAAAAA,FF, 0.00, 0.00,1,00.00 --> some month#### column may not or may contain value base on my formula.

AAAA00002, BBBBBBB,FF, 0.00, 1.00,1,00.00 --> some month#### column may not or may contain value base on my formula.

AAAA00003, CCCCCCC,CE, 1.00, 1.00,1,00.00 --> some month#### column may not or may contain value base on my formula.

I have no problem in retrieving all data on SQL Server using temp table and showing it on a system generated rdlc file even if I'm using Datasets.

My only problem is I can't programmatically sum all month#### columns and group all of it by Class.

Any idea or good reference I can use on how I can resolve my problem?

If I can make this work I assure that I will post a working sample on the internet to help other Dotnet developers.

Thanks in advance,

 Zed 


 

13 Answers Found

 

Answer 1

If you want  generate reports  on fly, Yo must be write  RDL (Report definition Language) , I have created one library for it. You can download library and sample in URL :

http://adrenalinautebo.com/GTameReport.zip

Thanks

Gabriel Tame

 

Answer 2

Thanks for your help.

The sample codes you provided is similar to what I'm working on. However it appears that I can't see the actual codes on how you were able to create the RDL file.

BTW I was able to create the RDL on-the-fly and populate it with data coming from a temp table by using stored procedure which is located on my DAL (Dataset).

My only concern is I can't programmatically  sum the dynamic column (monthYYYYY) which is created also on-the-fly.

I was also looking for a code on how to add prgrammatically a textbox on the page header of the RDL file.

Thanks,

Zed

 

Answer 3

At long last I was able to figured out and solved all of my problems.

I added a code that programmatically  add a footer, create table rows, cells and populate selected columns with necessary formula.

Thanks,

Zed 

 

 

Answer 4

Hi RapzaDudey, could you please upload an example of how do you solve your problem please? i'm having the same issue, and i would be very thankful if you share with us your solution.

 

Thanks!! 

 

Answer 5

Hello,

May I ask what exactly you want to achieve? Can you provide details of your problem?

Regards,

 Zed

 

Answer 6

hi Rapza

i am also working on the same problem however coul'nt find any solution to it

I am trying to create a rdlc  report in visuostudio2005 using c# i returned a dataset on the user selection however number of columns are not fixed so want to know how to bind the ds to the rdlc report on the runtime and how to add the columns to the rdlc report on the runtime

 

Answer 7

Hello,

Sorry for the late reply. I'm currently working on it to become an article which will be posted here or on any dotnet website forum.

I'm not so sure for if its good to call the article Creating Dynamic Reports on Runtime. The article consist of the following:

* Creating Dynamic Column, Data on runtime.

* RDLC/RDL file created during runtime.

* How to create Page Header, Page Footer, Body of the Report, Inserting Table/Matrix, Insert Report Control Object such Textbox, Label, Formula, Handling report properties on runtime.

* How to merge all items above then preview/display the programmatically  generated report within an ASPX page that contains Report Viewer Control.

Thanks,

 Rapza,

 

Answer 8

Hai RapzaDudey,

Have you find the solution ebcause  i also facing same type of problem. If found then please let me know.

 

Answer 9

RapzaDudey:

Hello,

Sorry for the late reply. I'm currently working on it to become an article which will be posted here or on any dotnet website forum.

I'm not so sure for if its good to call the article Creating Dynamic Reports on Runtime. The article consist of the following:

* Creating Dynamic Column, Data on runtime.

* RDLC/RDL file created during runtime.

* How to create Page Header, Page Footer, Body of the Report, Inserting Table/Matrix, Insert Report Control Object such Textbox, Label, Formula, Handling report properties on runtime.

* How to merge all items above then preview/display the programmatically  generated report within an ASPX page that contains Report Viewer Control.

Thanks,

 Rapza,

you did not provide yet the info. please send example code that you have done. it will solves our problem and will save our time

Please RapZa,

regards,

Irfan 

 

 

Answer 10

Hi,

The solution is simple.Use Matrix Instead of table in rdlc. For more information about using Matrix visit the following URL : www.gotreportviewer.com

                                    

Kowsik

Karthalingam 

 

 

Answer 11

Hi Zed, can you provide me the sample code of your program. It will be a lot of help for me. I need the same thing to be done.

regards

 

Answer 12

GabrielTame:

If you want  generate reports  on fly, Yo must be write  RDL (Report definition Language) , I have created one library for it. You can download library and sample in URL :

http://adrenalinautebo.com/GTameReport.zip

Thanks

Gabriel Tame

Al salamo 3lycom

Please ,this file is not found, can any one post it again

Thanks alot :)

 

 

Answer 13

You may want to take a look at:

www.rptgen.com

 

Thanks

 

 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter