This is a migrated thread and some comments may be shown as answers.

Example needed for building table at runtime

3 Answers 278 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Glenn
Top achievements
Rank 1
Glenn asked on 04 Feb 2014, 04:47 PM
Hey guys,

I'm stuck on how to do this.  I've tried designing a report and then looking at the code in the Initialize but it's not working out for me.  So I'm asking for an example on how to build the table at runtime and adding it to the Report's detail section.

I have all this working in Q2 2012 version but when upgraded to Q3 2013 nothing works.  I am aware that the grouping has changed.  The only reason we've upgraded from 2012 to 2013 was to get rid of the haunting "Out of memory" exception error.

Glenn

3 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 07 Feb 2014, 12:00 PM
Hello Glenn,

We have created a sample report definition with code for table generation in the report constructor. It uses the sample AdventureWorks database, so you will need that in order to run the report. Please find the sample report in the attached file.

Regards,
Nasko
Telerik

New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

0
Glenn
Top achievements
Rank 1
answered on 07 Feb 2014, 04:50 PM
Hi, thanks Nasko for the response, but what I was looking for was how to create it dynamically.  I was able to go to the code behind and cut the information for creating a table; however, I need to do this dynamically based on the Columns in the DataTable.  I did this with Q2 2012 release but upgrading to Q3 2013 it's now broken.

I know the change is on the grouping but I can't seem to get it right so I was looking for an example on how to do it with the Q3 2013 build.

I'm looking for something like looping thru the DataTable.Columns collection to build the textboxes, add them to a Telerik.Reports.Table.  Where I can't seem to get a handle is the grouping.

In the release we had I have a Report with Headers/Footers defined and at run-time I added dynamically created reporting tables to the detail section.




Glenn
0
Nasko
Telerik team
answered on 12 Feb 2014, 12:38 PM
Hello Glenn,

If you have done this with Q2 2012 release, than you should be aware of the following changes and fix them in your code:
  1. The following obsolete types were removed: Telerik.Reporting.Data.Filter, Telerik.Reporting.Data.FilterOperator, Telerik.Reporting.Data.Grouping, Telerik.Reporting.Data.SortDirection, Telerik.Reporting.Data.Sorting. To fix this replace all of the Telerik.Reporting.Data namespace with just the Telerik.Reporting namespace.
  2. TableGroups' names should be unique in a table. To avoid setting the same name for each group you should explicitly set a unique name for each TableGroup group that you add. For example:
    myTableGroup.Name = "TableGroup" + i.ToString();
    where i is unique in the scope of the table.

Regards,
Nasko
Telerik

New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

Tags
General Discussions
Asked by
Glenn
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Glenn
Top achievements
Rank 1
Share this question
or