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

Sample DDR

1 Answer 97 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 10 Aug 2007, 05:26 PM
Hi,

Here is some sample code that ought to work (IMHO). Can you explain why it does not?

Thanks!!

Tom

        DataSet ds = new DataSet();  
        ds.Tables.Add();  
        ds.Tables[0].Columns.Add("a");  
        ds.Tables[0].Columns.Add("b");  
 
        ds.Tables[0].Rows.Add("a1", "b1");  
        ds.Tables[0].Rows.Add("a2", "b2");  
        ds.Tables[0].Rows.Add("a3", "b3");  
 
        Telerik.Reporting.TextBox tb = new Telerik.Reporting.TextBox();  
        Report1 r = new Report1();  
 
          
        r.DataSource = ds.Tables[0];  
 
        tb.CanGrow = true;  
        tb.Value = "=a";  
        tb.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(1.625, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.5, Telerik.Reporting.Drawing.UnitType.Inch));  
        tb.Name = "a";  
        tb.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.625, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.25, Telerik.Reporting.Drawing.UnitType.Inch));  
        tb.Style.BackgroundColor = System.Drawing.Color.White;  
        r.Items.Add(tb);  
          
 
        tb = new Telerik.Reporting.TextBox();  
        tb.CanGrow = true;  
        tb.Value = "=b";  
        tb.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(3.625, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.5, Telerik.Reporting.Drawing.UnitType.Inch));  
        tb.Name = "b";  
        tb.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1.625, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.25, Telerik.Reporting.Drawing.UnitType.Inch));  
        tb.Style.BackgroundColor = System.Drawing.Color.White;  
        r.Items.Add(tb);  
 
        telerik.Report = r; 

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 13 Aug 2007, 02:03 PM
Hi Tom,

The problem is that you are adding the TextBoxes directly to your report. What you should do is add the TextBoxes to the DetailSection (for example). You can create a simple report with the designer and explore the generated InitializeComponent method in order to see how items are added to sections and sections are added to the report.

For more information on creating reports, please review the provided documentation. We are certain that it will help you get started.

 
Sincerely yours,
Rossen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Tom
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or