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

I think there is a bug in the TextBox rendering

5 Answers 225 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Janus Pedersen
Top achievements
Rank 2
Janus Pedersen asked on 03 Aug 2009, 11:55 AM
Hi
I thing there is a bug in the TextBox Rendering.

I I make a small report using 4 TextBox`s like this.

Box1    Box2    Box3    Box4

in the detail sektion and bind data to it. It will work fine if the data is small.  But if I put some large data in Box1 so it will be in 4 lines and box2, box3 and box4 is just one line. The Box4 will move and alle the that will move a littel . In all the TextBox`s I use

 textBox = new TextBox  
                          {  
                              Value = tekst,  
                              Height = new Unit(0.2, UnitType.Cm),  
                              Dock = DockStyle.Left,  
                              Width = new Unit(4, UnitType.Cm),  
                              Style =  
                                  {  
                                      VerticalAlign = VerticalAlign.Middle,  
                                      Font =  
                                          {  
                                              Size = new Unit(8, UnitType.Point),  
                                              Name = "Verdana" 
                                          }  
                                  },  
                              Multiline = true 
                          }; 
For the Box 3 use use 

HorizontalAlign

 

.Right; to set the text to the right. This is the price

 

 


Eks.

SfB-
undergruppe
Komponent SfB-
hovedgruppe
Budgetpris
(73)3                                                Eftersyn for                               (7) Inventar                                           100,00 
                                                         ridser og
                                                         skrammer - (
                                                         22)

                                                         3.001.S1f.s4d
Naturlig ventilation                            Eftersyn                                    (6) El- og                                            512.345,00

The error in the rendering is that that the Budgetpris colums numbers wil be moved so all the digit will not stand under the next colum. See the Eks.

The 100,00 and the 512.345,00 is not standing so eacht digit is standing the right place. All the first digit shoud be stand the most right and so. I you put in a line from the "s" in Budgetpris and down to the numbers it shoud be a normal line.

I hopy thare is a hack for this else I hopy Telerik will correct this error in the next version of Telerik Reporting.

Janus S. Andersen
Denmark

5 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 04 Aug 2009, 01:36 PM
Hello Janus,

If we have understood your inquiry correctly, this behavior (namely Reporting items depending on each others' position) is by design and it works in that manner since Telerik Reporting v.1.x. It is certainly not a bug.
We have to point out that Telerik Reports are not Word documents where you place an item and it stays there for good. On the contrary -  a report's layout is based on a set of “rules” and those rules are consistently applied to data pulled from a data store. You can find more info on what a report is/is not in our WhitePaper.
In this line of thoughts, if you want to
guarantee that an item on the left side would not depend on an item on its right side, you can place them in separate containers i.e. panel items.
Even more clean solution for your scenario is to use our table item, which would take care of the layout for you.

Regards,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Janus Pedersen
Top achievements
Rank 2
answered on 05 Aug 2009, 12:13 AM
Hi Stive
Thanks for your ans. Read this from your link 

"
A report does not require every page be manually “designed”

 

(as you would do with a Word document).

 

 

 A report instead uses template rules and renders data according to those rules on every page

of the report.
"

That is the base of it. The Telerik Reporting Tool have been working before. It breaks in the newest version..

But I will translate my design to Table or CrosTab and try it.
 
The telerik is a tool to make tabel reports and more. My report is a table report, so I don`t see why it do not fit in?

I have try to use a TextBox inside a Panel but this is the same. It is not working 
Why is there a properti (in the TextBox) "Dev Express have the same prop. and it works like the names". Called
- CanGrow
- CanShrink
- Multiline

We have a lic. for both Telerik and Dev.Express and in the DevX there is a grid to take care of it. I have try to plot my data in DevX and it works fine. The colloms stay the right place.

Ok. Help me make a CrossTab in programing not by using the designer. A smal eks.. to use the CrossTab where there is just a constructer with all the code in.

Best Regards
Janus S. Andersen

Denmark

0
Steve
Telerik team
answered on 07 Aug 2009, 03:46 PM
Hello Janus,

If your goal is to create a table item programmatically, the easiest way to get there would be to first create the table in the report designer and use the code it generated for you in the InitializeComponent() as template.
The Table API is available in our documentation here.
As for the TextBox properties you've mentioned - they're working correctly. However having the items docked does not guarantee that all "boxes" would regain the height of box1 when it grows.
Please provide us with your problematic report with those boxes, explain what you expect to happen and we would try to explain (if not applicable) or offer a working solution.

Regards,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Janus Pedersen
Top achievements
Rank 2
answered on 07 Aug 2009, 10:39 PM
Hi Steve
I am trying to design a Table by runtime. My code is

    public class Test  
    {  
        public Test(int A, int B)  
        {  
            a = A;  
            b = B;  
        }  
 
        public int a { getset; }  
        public int b { getset; }  
    } 

        public TestRap()  
        {  
            InitializeComponent();  
            var o = new List<Test>();  
 
            for (var i = 0; i < 30; i++)  
            {  
                o.Add(new Test(i, i + 5));  
            }  
            table1.DataSource = o;  
 
            var table_1 = new Table();  
            table_1.Body.Columns.Add(new TableBodyColumn(new Unit(15.7, UnitType.Cm)));  
            table_1.Body.Rows.Add(new TableBodyRow(new Unit(0.4, UnitType.Cm)));  
            table_1.Body.Rows.Add(new TableBodyRow(new Unit(0.4, UnitType.Cm)));  
            var t1 = new TextBox { Height = new Unit(0.5, UnitType.Cm), Width = new Unit(5, UnitType.Cm), Value = "a" };  
            table_1.Body.SetCellContent(0, 0, t1);  
            var t2 = new TextBox { Height = new Unit(0.5, UnitType.Cm), Width = new Unit(5, UnitType.Cm) };  
            table_1.Body.SetCellContent(1, 0, t2);  
            var tG_1 = new TableGroup();  
            tG_1.ReportItem = t1;  
            table_1.ColumnGroups.Add(tG_1);  
            table_1.DataMember = "";  
            var tG_2 = new TableGroup();  
            tG_2.Grouping.AddRange(new[] {  
            new Telerik.Reporting.Data.Grouping("")});  
            tG_2.Name = "Detail";  
 
            table_1.Dock = DockStyle.Top;  
            table_1.Items.AddRange(new ReportItemBase[] { t1, t2 });  
 
            table_1.Size = new SizeU(new Unit(15.7, UnitType.Cm), new Unit(0.9, UnitType.Cm));  
 
            table_1.DataSource = o;  
            detail.Items.Add(table_1);  
        }  
    }  
 

This code dos not work help me out here.
I get this error
"
An error has occured while processing Table '':
Table Body has 2 rows but 0 are expected.
"

My goal is to create a program where a user can select some columns. In these columns can be created a filter and a block and a sorting. The report shows only those columns that are selected by the user and the data that meets the filter.

That I have made through simple textbokse panels mm. This is that some fields should be summed.

But now I would like to translate this into Tables.

The next I need is a Pivo table. This I believe is done via CrossTab. This element is like a table (I think and hope).

Janus S. Andersen
Denmark

P.s. Thanks for your help by now
0
Milen | Product Manager @DX
Telerik team
answered on 10 Aug 2009, 11:38 AM
Hi Janus,

The concrete reason for the thrown error in your code are the missing row groups (You create one - tG2, but you do not add it to the table). In general each row and each column in the Table/Crosstab items are defined by a corresponding Row/Column group. As my colleague Steve has already pointed, the easiest way to understand the Table API is to review what code the Table designer generates.

To create programmatically the table that you need, you need a static row group (to show column headers if you want to), a detail row group (which will produce rows from the datasource), and N static column groups (where each column group represents a column like A, B...).

Still the straightforward way of creating Table or Crosstab is to use the appropriate wizard item.

As for the textbox alignment in your original question: In Q2 2009 there is a bug fix for Docked/Anchored items with Middle or Bottom Vertical alignment i.e. vertical alignment was not respected when the items grew. To see how the items are layout, put borders or different background color on each of them. If still having problems, please send us a sample report reproducing the misalignment so that we can help you to correct it or log it to our issue tracking system if it is really a bug.

Thank you for your cooperation.

Greetings,
Milen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Janus Pedersen
Top achievements
Rank 2
Answers by
Steve
Telerik team
Janus Pedersen
Top achievements
Rank 2
Milen | Product Manager @DX
Telerik team
Share this question
or