I think there is a bug in the TextBox rendering

6 posts, 0 answers
  1. Janus Pedersen
    Janus Pedersen avatar
    34 posts
    Member since:
    Dec 2008

    Posted 03 Aug 2009 Link to this post

    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

    1  textBox = new TextBox  
    2                           {  
    3                               Value = tekst,  
    4                               Height = new Unit(0.2, UnitType.Cm),  
    5                               Dock = DockStyle.Left,  
    6                               Width = new Unit(4, UnitType.Cm),  
    7                               Style =  
    8                                   {  
    9                                       VerticalAlign = VerticalAlign.Middle,  
    10                                       Font =  
    11                                           {  
    12                                               Size = new Unit(8, UnitType.Point),  
    13                                               Name = "Verdana" 
    14                                           }  
    15                                   },  
    16                               Multiline = true 
    17                           }; 
    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

  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 04 Aug 2009 Link to this post

    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.
  3. DevCraft banner
  4. Janus Pedersen
    Janus Pedersen avatar
    34 posts
    Member since:
    Dec 2008

    Posted 04 Aug 2009 Link to this post

    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

  5. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 07 Aug 2009 Link to this post

    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.
  6. Janus Pedersen
    Janus Pedersen avatar
    34 posts
    Member since:
    Dec 2008

    Posted 07 Aug 2009 Link to this post

    Hi Steve
    I am trying to design a Table by runtime. My code is

    1     public class Test  
    2     {  
    3         public Test(int A, int B)  
    4         {  
    5             a = A;  
    6             b = B;  
    7         }  
    8  
    9         public int a { getset; }  
    10         public int b { getset; }  
    11     } 

    1         public TestRap()  
    2         {  
    3             InitializeComponent();  
    4             var o = new List<Test>();  
    5  
    6             for (var i = 0; i < 30; i++)  
    7             {  
    8                 o.Add(new Test(i, i + 5));  
    9             }  
    10             table1.DataSource = o;  
    11  
    12             var table_1 = new Table();  
    13             table_1.Body.Columns.Add(new TableBodyColumn(new Unit(15.7, UnitType.Cm)));  
    14             table_1.Body.Rows.Add(new TableBodyRow(new Unit(0.4, UnitType.Cm)));  
    15             table_1.Body.Rows.Add(new TableBodyRow(new Unit(0.4, UnitType.Cm)));  
    16             var t1 = new TextBox { Height = new Unit(0.5, UnitType.Cm), Width = new Unit(5, UnitType.Cm), Value = "a" };  
    17             table_1.Body.SetCellContent(0, 0, t1);  
    18             var t2 = new TextBox { Height = new Unit(0.5, UnitType.Cm), Width = new Unit(5, UnitType.Cm) };  
    19             table_1.Body.SetCellContent(1, 0, t2);  
    20             var tG_1 = new TableGroup();  
    21             tG_1.ReportItem = t1;  
    22             table_1.ColumnGroups.Add(tG_1);  
    23             table_1.DataMember = "";  
    24             var tG_2 = new TableGroup();  
    25             tG_2.Grouping.AddRange(new[] {  
    26             new Telerik.Reporting.Data.Grouping("")});  
    27             tG_2.Name = "Detail";  
    28  
    29             table_1.Dock = DockStyle.Top;  
    30             table_1.Items.AddRange(new ReportItemBase[] { t1, t2 });  
    31  
    32             table_1.Size = new SizeU(new Unit(15.7, UnitType.Cm), new Unit(0.9, UnitType.Cm));  
    33  
    34             table_1.DataSource = o;  
    35             detail.Items.Add(table_1);  
    36         }  
    37     }  
    38  

    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
  7. Milen
    Admin
    Milen avatar
    163 posts

    Posted 10 Aug 2009 Link to this post

    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.
Back to Top
DevCraft banner