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

First Column repeating after update from Q2 2012 to Q1 2013

3 Answers 40 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Benin
Top achievements
Rank 1
Benin asked on 11 Apr 2013, 08:16 PM
I have a report that builds up dynamic columns based on user selection. I wrote the code for this by referring this link:
http://www.telerik.com/ClientsFiles/247146_AutoGenerateColumns.zip
provided in one of the threads.
The report was working fine until I upgraded to Q1 2013. After the update the report renders with the value of the first column as the value for all other columns all though the column headings are rendered correctly. Please find attached screenshots for both the versions. The code given in the link which is  windows forms project is working fine after update. I am doing this in asp.net and the only thing I did was update it after which the problem occurs.
On another note, My client is about to the buy the license. I was wondering if we can use any of the versions (Q2 2012 or Q1 2013) after the license is bought. Because if we cant use Q2 2012 and if there s no fix for the above issue then there is no point in buying the license.

3 Answers, 1 is accepted

Sort by
0
Benin
Top achievements
Rank 1
answered on 12 Apr 2013, 08:15 AM
private void table1_ItemDataBinding(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.Table processingTable = (sender as Telerik.Reporting.Processing.Table);
            processingTable.DataSource = summaryTable;
 
 
            //create two HtmlTextBox items (one for header and one for data) which would be added to the items collection of the table
            Telerik.Reporting.HtmlTextBox textboxGroup;
            Telerik.Reporting.TextBox textBoxTable;
 
 
            this.table1.ColumnGroups.Clear();
            this.table1.Body.Columns.Clear();
            this.table1.Body.Rows.Clear();
            int i = 0;
            this.table1.ColumnHeadersPrintOnEveryPage = true;
 
            
            KeyValuePair<string, string> rollingColumn = new KeyValuePair<string, string>();
            foreach (KeyValuePair<string, string> column in columnNames)
            {
              
             DataColumn dc = summaryTable.Columns[i];
 
            Telerik.Reporting.TableGroup tableGroupColumn = new Telerik.Reporting.TableGroup();
            this.table1.ColumnGroups.Add(tableGroupColumn);
            this.table1.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Unit.Inch(1)));
 
            textboxGroup = new Telerik.Reporting.HtmlTextBox();
            textboxGroup.Style.BorderColor.Default = Color.Wheat;
            textboxGroup.Style.BorderStyle.Default = BorderType.Solid;
            textboxGroup.Style.VerticalAlign = VerticalAlign.Middle;
            textboxGroup.Style.BackgroundColor = Color.Gray;
            textboxGroup.Style.Font.Size = Unit.Pixel(12);
            textboxGroup.Value = column.Value;
            textboxGroup.Size = new SizeU(Unit.Inch(1.5), Unit.Inch(0.3));
          
            textboxGroup.CanGrow = true;
            tableGroupColumn.ReportItem = textboxGroup;
 
            textBoxTable = new Telerik.Reporting.TextBox();
            textBoxTable.Style.BorderColor.Default = Color.Wheat;
            textBoxTable.Style.BorderStyle.Default = BorderType.Solid;
            textBoxTable.Style.VerticalAlign = VerticalAlign.Middle;
            textBoxTable.Size = new SizeU(Unit.Inch(2), Unit.Inch(.3));      
            textBoxTable.CanGrow = true;
            textBoxTable.Value = "=Fields." + column.Key;           
            textBoxTable.Format = "{0:P2}"; //"{0:N2}";
            textBoxTable.Style.Font.Size = Unit.Pixel(11);
 
            this.table1.Body.SetCellContent(0, i, textBoxTable);
            this.table1.Items.AddRange(new ReportItemBase[] { textBoxTable, textboxGroup });
            i++;
               
            }
         
 
        }
 
    
           

This is the code that I am using.
I checked the following statement:
textBoxTable.Value = "=Fields." + column.Key;   
The value is getting assigned correctly. (Its working fine with Q2 2012 also). So can any one point out what the issue is here?
0
Benin
Top achievements
Rank 1
answered on 13 Apr 2013, 08:18 AM
On a closer look at the ColumnGroups list in  the table of the report i found something odd when comparing the two versions. Please take a look at the screenshot attached.
0
Accepted
Peter
Telerik team
answered on 16 Apr 2013, 04:09 PM
Hi Benin,

You can fix the issue by manually giving names to the column groups. 

TableGroup tableGroupColumn = new TableGroup();
//add this
tableGroupColumn.Name = i.ToString();

Generally our suggestion is to avoid changing the report items definitions when the processing has already started. Instead you can change the report definition in the report constructor.

Kind regards,
Peter
the Telerik team

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

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