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

Generating Report Table programatically

3 Answers 226 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Manish
Top achievements
Rank 1
Manish asked on 22 Mar 2013, 06:44 AM
Hello,

I am using itembinding event of report table and proramatically generating report table as below.

m_ReportTable.Body.Rows.Add(

 

new TableBodyRow(m_RowHeight));

 

 

 

TextBox dataCell = new TextBox { Value = "val" };

 

dataCell.Size =

 

new SizeU(m_RowHeight, m_RowHeight);

 

m_ReportTable.Body.SetCellContent(0, 0, dataCell);

 

 

TextBox dataCell2 = new TextBox { Value = "val2" };

 

dataCell2.Size =

 

new SizeU(m_RowHeight, m_RowHeight);

 

m_ReportTable.Body.SetCellContent(0, 1, dataCell2);

 

 

Panel p = new Panel();

 

p.Items.AddRange(

 

new ReportItemBase[] { dataCell, dataCell2 });

 

m_ReportTable.RowGroups[0].ReportItem = dataCell2; //added one defauld row group at initialization

m_ReportTable.Items.AddRange(

 

new ReportItemBase[] { dataCell, dataCell2 });

I'm confused with group structure. After rendering, this is showing only "Val2" as i added it in ReportItem of row group. How do i add two cell items in one row group? Also what about column groups, can i relate column group to row cells of perticular column?

Please help or let me know if more information is needed.

Regards,
Manish

 

3 Answers, 1 is accepted

Sort by
0
Manish
Top achievements
Rank 1
answered on 22 Mar 2013, 07:33 AM
Actually i got this by designer code..i need not to add extra row group except one default row group, just column groups, tablebodycolumns and setcellcontent and add items into report.items. Thank you.
0
Stef
Telerik team
answered on 27 Mar 2013, 08:32 AM
Hello Manish,

It is not clear from your description what is the final Table structure you look for. Using the designer to verify your code is the right way. Use the group explorer and the context menu, to add rows and columns groups, then take the ready structure from the designer.cs. In addition there are Merge Cells and Rotate Layout options in the Table item context menu transforming the item layout, which options are not exposed as specific properties.
On your questions about the rows and columns groups, please check these help articles elaborating on the Table item structure:

Let us know if you have further questions.

Greetings,
Stef
the Telerik team

Telerik Reporting Q1 2013 available for download with impressive new visualizations. Download today from your account.

0
Manish
Top achievements
Rank 1
answered on 28 Mar 2013, 04:15 AM
Hi Stef,

It is resolved now. I got help from auto generated designer's code.

Thanks,
Manish
Tags
General Discussions
Asked by
Manish
Top achievements
Rank 1
Answers by
Manish
Top achievements
Rank 1
Stef
Telerik team
Share this question
or