Hi,
I am using Telerik report Q1 2012.
I put a textbox(fields is "dg1_desc") in a tableGroup, which is in a crosstable. As in the attachment file, now there are too many columns are displayed in the same row and i want to separate them in multiple rows. e.g. 4 columns per row. How to achieve that?
Please advice! Thanks a lot!
here is my code:
//
// crosstab1
//
this.crosstab1.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Telerik.Reporting.Drawing.Unit.Cm(2.9260406494140625D)));
this.crosstab1.Body.Rows.Add(new Telerik.Reporting.TableBodyRow(Telerik.Reporting.Drawing.Unit.Cm(0.59999996423721313D)));
this.crosstab1.Body.SetCellContent(0, 0, this.textBox25);
tableGroup4.Name = "dg2_desc1";
tableGroup3.ChildGroups.Add(tableGroup4);
tableGroup3.Name = "Group1";
tableGroup3.ReportItem = this.tb_dg1;
tableGroup2.ChildGroups.Add(tableGroup3);
tableGroup2.Name = "Group2";
tableGroup1.ChildGroups.Add(tableGroup2);
tableGroup1.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.dg1_desc")});
tableGroup1.Name = "ColumnGroup";
this.crosstab1.ColumnGroups.Add(tableGroup1);
this.crosstab1.Corner.SetCellContent(0, 1, this.textBox15);
this.crosstab1.Corner.SetCellContent(0, 2, this.textBox16);
this.crosstab1.Corner.SetCellContent(0, 3, this.textBox17);
this.crosstab1.Corner.SetCellContent(0, 4, this.textBox18);
this.crosstab1.Corner.SetCellContent(0, 5, this.textBox19);
this.crosstab1.Corner.SetCellContent(0, 6, this.textBox20);
this.crosstab1.Corner.SetCellContent(0, 7, this.textBox21);
this.crosstab1.Corner.SetCellContent(0, 8, this.textBox22);
this.crosstab1.Corner.SetCellContent(0, 9, this.textBox23);
this.crosstab1.Corner.SetCellContent(0, 10, this.textBox24);
this.crosstab1.Corner.SetCellContent(0, 0, this.lb_RPT_H_51);
this.crosstab1.DataSource = null;
this.crosstab1.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
this.textBox25,
this.tb_dg1,
this.textBox15,
this.textBox16,
this.textBox17,
this.textBox18,
this.textBox19,
this.textBox20,
this.textBox21,
this.textBox22,
this.textBox23,
this.textBox24,
this.lb_RPT_H_51,
this.textBox3,
this.tb_org1,
this.tb_org2,
this.tb_org3,
this.tb_org4,
this.tb_org5,
this.tb_org6,
this.tb_org7,
this.tb_org8,
this.tb_org9,
this.tb_org10});
this.crosstab1.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Cm(0D), Telerik.Reporting.Drawing.Unit.Cm(0D));
this.crosstab1.Name = "crosstab1";
tableGroup15.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.org10")});
tableGroup15.Name = "org101";
tableGroup15.ReportItem = this.tb_org10;
tableGroup15.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
new Telerik.Reporting.Data.Sorting("=Fields.org10", Telerik.Reporting.Data.SortDirection.Asc)});
tableGroup14.ChildGroups.Add(tableGroup15);
tableGroup14.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.org9")});
tableGroup14.Name = "org91";
tableGroup14.ReportItem = this.tb_org9;
tableGroup14.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
new Telerik.Reporting.Data.Sorting("=Fields.org9", Telerik.Reporting.Data.SortDirection.Asc)});
tableGroup13.ChildGroups.Add(tableGroup14);
tableGroup13.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.org8")});
tableGroup13.Name = "org81";
tableGroup13.ReportItem = this.tb_org8;
tableGroup13.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
new Telerik.Reporting.Data.Sorting("=Fields.org8", Telerik.Reporting.Data.SortDirection.Asc)});
tableGroup12.ChildGroups.Add(tableGroup13);
tableGroup12.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.org7")});
tableGroup12.Name = "org71";
tableGroup12.ReportItem = this.tb_org7;
tableGroup12.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
new Telerik.Reporting.Data.Sorting("=Fields.org7", Telerik.Reporting.Data.SortDirection.Asc)});
tableGroup11.ChildGroups.Add(tableGroup12);
tableGroup11.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.org6")});
tableGroup11.Name = "org61";
tableGroup11.ReportItem = this.tb_org6;
tableGroup11.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
new Telerik.Reporting.Data.Sorting("=Fields.org6", Telerik.Reporting.Data.SortDirection.Asc)});
tableGroup10.ChildGroups.Add(tableGroup11);
tableGroup10.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.org5")});
tableGroup10.Name = "org51";
tableGroup10.ReportItem = this.tb_org5;
tableGroup10.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
new Telerik.Reporting.Data.Sorting("=Fields.org5", Telerik.Reporting.Data.SortDirection.Asc)});
tableGroup9.ChildGroups.Add(tableGroup10);
tableGroup9.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.org4")});
tableGroup9.Name = "org41";
tableGroup9.ReportItem = this.tb_org4;
tableGroup9.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
new Telerik.Reporting.Data.Sorting("=Fields.org4", Telerik.Reporting.Data.SortDirection.Asc)});
tableGroup8.ChildGroups.Add(tableGroup9);
tableGroup8.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.org3")});
tableGroup8.Name = "org31";
tableGroup8.ReportItem = this.tb_org3;
tableGroup8.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
new Telerik.Reporting.Data.Sorting("=Fields.org3", Telerik.Reporting.Data.SortDirection.Asc)});
tableGroup7.ChildGroups.Add(tableGroup8);
tableGroup7.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.org2")});
tableGroup7.Name = "org21";
tableGroup7.ReportItem = this.tb_org2;
tableGroup7.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
new Telerik.Reporting.Data.Sorting("=Fields.org2", Telerik.Reporting.Data.SortDirection.Asc)});
tableGroup6.ChildGroups.Add(tableGroup7);
tableGroup6.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.org1")});
tableGroup6.Name = "org11";
tableGroup6.ReportItem = this.tb_org1;
tableGroup6.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
new Telerik.Reporting.Data.Sorting("=Fields.org1", Telerik.Reporting.Data.SortDirection.Asc)});
tableGroup5.ChildGroups.Add(tableGroup6);
tableGroup5.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.year_no")});
tableGroup5.Name = "year_no1";
tableGroup5.ReportItem = this.textBox3;
tableGroup5.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
new Telerik.Reporting.Data.Sorting("=Fields.year_no", Telerik.Reporting.Data.SortDirection.Asc)});
this.crosstab1.RowGroups.Add(tableGroup5);
this.crosstab1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Cm(28.526042938232422D), Telerik.Reporting.Drawing.Unit.Cm(1.2000000476837158D));
this.crosstab1.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.None;
this.crosstab1.StyleName = "Normal.TableNormal";
//
// tb_dg1
//
this.tb_dg1.Name = "tb_dg1";
this.tb_dg1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Cm(2.9260413646698D), Telerik.Reporting.Drawing.Unit.Cm(0.60000002384185791D));
this.tb_dg1.Style.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(131)))), ((int)(((byte)(169)))));
this.tb_dg1.Style.BorderColor.Default = System.Drawing.SystemColors.ActiveBorder;
this.tb_dg1.Style.Color = System.Drawing.Color.White;
this.tb_dg1.Style.Font.Name = "Arial";
this.tb_dg1.Style.Font.Size = Telerik.Reporting.Drawing.Unit.Point(9D);
this.tb_dg1.Style.Padding.Bottom = Telerik.Reporting.Drawing.Unit.Cm(0.10000000149011612D);
this.tb_dg1.Style.Padding.Left = Telerik.Reporting.Drawing.Unit.Cm(0.20000000298023224D);
this.tb_dg1.Style.Padding.Right = Telerik.Reporting.Drawing.Unit.Cm(0.20000000298023224D);
this.tb_dg1.Style.Padding.Top = Telerik.Reporting.Drawing.Unit.Cm(0.10000000149011612D);
this.tb_dg1.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center;
this.tb_dg1.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
this.tb_dg1.StyleName = "Normal.TableGroup";
this.tb_dg1.Value = "=Fields.dg1_desc";
//
I am using Telerik report Q1 2012.
I put a textbox(fields is "dg1_desc") in a tableGroup, which is in a crosstable. As in the attachment file, now there are too many columns are displayed in the same row and i want to separate them in multiple rows. e.g. 4 columns per row. How to achieve that?
Please advice! Thanks a lot!
here is my code:
//
// crosstab1
//
this.crosstab1.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Telerik.Reporting.Drawing.Unit.Cm(2.9260406494140625D)));
this.crosstab1.Body.Rows.Add(new Telerik.Reporting.TableBodyRow(Telerik.Reporting.Drawing.Unit.Cm(0.59999996423721313D)));
this.crosstab1.Body.SetCellContent(0, 0, this.textBox25);
tableGroup4.Name = "dg2_desc1";
tableGroup3.ChildGroups.Add(tableGroup4);
tableGroup3.Name = "Group1";
tableGroup3.ReportItem = this.tb_dg1;
tableGroup2.ChildGroups.Add(tableGroup3);
tableGroup2.Name = "Group2";
tableGroup1.ChildGroups.Add(tableGroup2);
tableGroup1.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.dg1_desc")});
tableGroup1.Name = "ColumnGroup";
this.crosstab1.ColumnGroups.Add(tableGroup1);
this.crosstab1.Corner.SetCellContent(0, 1, this.textBox15);
this.crosstab1.Corner.SetCellContent(0, 2, this.textBox16);
this.crosstab1.Corner.SetCellContent(0, 3, this.textBox17);
this.crosstab1.Corner.SetCellContent(0, 4, this.textBox18);
this.crosstab1.Corner.SetCellContent(0, 5, this.textBox19);
this.crosstab1.Corner.SetCellContent(0, 6, this.textBox20);
this.crosstab1.Corner.SetCellContent(0, 7, this.textBox21);
this.crosstab1.Corner.SetCellContent(0, 8, this.textBox22);
this.crosstab1.Corner.SetCellContent(0, 9, this.textBox23);
this.crosstab1.Corner.SetCellContent(0, 10, this.textBox24);
this.crosstab1.Corner.SetCellContent(0, 0, this.lb_RPT_H_51);
this.crosstab1.DataSource = null;
this.crosstab1.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
this.textBox25,
this.tb_dg1,
this.textBox15,
this.textBox16,
this.textBox17,
this.textBox18,
this.textBox19,
this.textBox20,
this.textBox21,
this.textBox22,
this.textBox23,
this.textBox24,
this.lb_RPT_H_51,
this.textBox3,
this.tb_org1,
this.tb_org2,
this.tb_org3,
this.tb_org4,
this.tb_org5,
this.tb_org6,
this.tb_org7,
this.tb_org8,
this.tb_org9,
this.tb_org10});
this.crosstab1.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Cm(0D), Telerik.Reporting.Drawing.Unit.Cm(0D));
this.crosstab1.Name = "crosstab1";
tableGroup15.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.org10")});
tableGroup15.Name = "org101";
tableGroup15.ReportItem = this.tb_org10;
tableGroup15.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
new Telerik.Reporting.Data.Sorting("=Fields.org10", Telerik.Reporting.Data.SortDirection.Asc)});
tableGroup14.ChildGroups.Add(tableGroup15);
tableGroup14.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.org9")});
tableGroup14.Name = "org91";
tableGroup14.ReportItem = this.tb_org9;
tableGroup14.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
new Telerik.Reporting.Data.Sorting("=Fields.org9", Telerik.Reporting.Data.SortDirection.Asc)});
tableGroup13.ChildGroups.Add(tableGroup14);
tableGroup13.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.org8")});
tableGroup13.Name = "org81";
tableGroup13.ReportItem = this.tb_org8;
tableGroup13.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
new Telerik.Reporting.Data.Sorting("=Fields.org8", Telerik.Reporting.Data.SortDirection.Asc)});
tableGroup12.ChildGroups.Add(tableGroup13);
tableGroup12.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.org7")});
tableGroup12.Name = "org71";
tableGroup12.ReportItem = this.tb_org7;
tableGroup12.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
new Telerik.Reporting.Data.Sorting("=Fields.org7", Telerik.Reporting.Data.SortDirection.Asc)});
tableGroup11.ChildGroups.Add(tableGroup12);
tableGroup11.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.org6")});
tableGroup11.Name = "org61";
tableGroup11.ReportItem = this.tb_org6;
tableGroup11.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
new Telerik.Reporting.Data.Sorting("=Fields.org6", Telerik.Reporting.Data.SortDirection.Asc)});
tableGroup10.ChildGroups.Add(tableGroup11);
tableGroup10.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.org5")});
tableGroup10.Name = "org51";
tableGroup10.ReportItem = this.tb_org5;
tableGroup10.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
new Telerik.Reporting.Data.Sorting("=Fields.org5", Telerik.Reporting.Data.SortDirection.Asc)});
tableGroup9.ChildGroups.Add(tableGroup10);
tableGroup9.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.org4")});
tableGroup9.Name = "org41";
tableGroup9.ReportItem = this.tb_org4;
tableGroup9.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
new Telerik.Reporting.Data.Sorting("=Fields.org4", Telerik.Reporting.Data.SortDirection.Asc)});
tableGroup8.ChildGroups.Add(tableGroup9);
tableGroup8.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.org3")});
tableGroup8.Name = "org31";
tableGroup8.ReportItem = this.tb_org3;
tableGroup8.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
new Telerik.Reporting.Data.Sorting("=Fields.org3", Telerik.Reporting.Data.SortDirection.Asc)});
tableGroup7.ChildGroups.Add(tableGroup8);
tableGroup7.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.org2")});
tableGroup7.Name = "org21";
tableGroup7.ReportItem = this.tb_org2;
tableGroup7.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
new Telerik.Reporting.Data.Sorting("=Fields.org2", Telerik.Reporting.Data.SortDirection.Asc)});
tableGroup6.ChildGroups.Add(tableGroup7);
tableGroup6.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.org1")});
tableGroup6.Name = "org11";
tableGroup6.ReportItem = this.tb_org1;
tableGroup6.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
new Telerik.Reporting.Data.Sorting("=Fields.org1", Telerik.Reporting.Data.SortDirection.Asc)});
tableGroup5.ChildGroups.Add(tableGroup6);
tableGroup5.Groupings.AddRange(new Telerik.Reporting.Data.Grouping[] {
new Telerik.Reporting.Data.Grouping("=Fields.year_no")});
tableGroup5.Name = "year_no1";
tableGroup5.ReportItem = this.textBox3;
tableGroup5.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
new Telerik.Reporting.Data.Sorting("=Fields.year_no", Telerik.Reporting.Data.SortDirection.Asc)});
this.crosstab1.RowGroups.Add(tableGroup5);
this.crosstab1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Cm(28.526042938232422D), Telerik.Reporting.Drawing.Unit.Cm(1.2000000476837158D));
this.crosstab1.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.None;
this.crosstab1.StyleName = "Normal.TableNormal";
//
// tb_dg1
//
this.tb_dg1.Name = "tb_dg1";
this.tb_dg1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Cm(2.9260413646698D), Telerik.Reporting.Drawing.Unit.Cm(0.60000002384185791D));
this.tb_dg1.Style.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(131)))), ((int)(((byte)(169)))));
this.tb_dg1.Style.BorderColor.Default = System.Drawing.SystemColors.ActiveBorder;
this.tb_dg1.Style.Color = System.Drawing.Color.White;
this.tb_dg1.Style.Font.Name = "Arial";
this.tb_dg1.Style.Font.Size = Telerik.Reporting.Drawing.Unit.Point(9D);
this.tb_dg1.Style.Padding.Bottom = Telerik.Reporting.Drawing.Unit.Cm(0.10000000149011612D);
this.tb_dg1.Style.Padding.Left = Telerik.Reporting.Drawing.Unit.Cm(0.20000000298023224D);
this.tb_dg1.Style.Padding.Right = Telerik.Reporting.Drawing.Unit.Cm(0.20000000298023224D);
this.tb_dg1.Style.Padding.Top = Telerik.Reporting.Drawing.Unit.Cm(0.10000000149011612D);
this.tb_dg1.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center;
this.tb_dg1.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
this.tb_dg1.StyleName = "Normal.TableGroup";
this.tb_dg1.Value = "=Fields.dg1_desc";
//