Special grouping in a list needed

9 posts, 1 answers
  1. Wadigzon
    Wadigzon avatar
    58 posts
    Member since:
    Feb 2013

    Posted 24 Jul 2013 Link to this post

    Hello there, I have this report that is basically a table with 64/128 elements that I want to show its headers every 8 items as shown in preview_old.jpg, the design mode for the report can be found at design_old.jpg.

    The problem is this report breaks into two pages(or more) when I do the html preview, I do not want that, as this report is part of a report book, and creates "ghost" extra report(s) in the list of reports in the report book. Most of my other reports are made with list objects so they do not break in many pages at html preview, ONLY when I do the print preview, which is just fine.

    The map of objects for the current report is shown in map_old.jpg

    Find the desired report's output at desired_preview.jpg (I did some image editing to get this)

    I would like to use a list object of some sort to accomplish something similar, so that the html preview (or just interactive preview) DOES NOT break into multiple pages. 

    How do I do that?.


  2. Wadigzon
    Wadigzon avatar
    58 posts
    Member since:
    Feb 2013

    Posted 26 Jul 2013 Link to this post

    Is anybody taking a look at this request? thanks!
  3. DevCraft banner
  4. Stef
    Admin
    Stef avatar
    3053 posts

    Posted 26 Jul 2013 Link to this post

    Hi,

    This is a quote of the answer of your support ticket on the same question:
    "Using a single Table item will cause the report to be rendered in a single page in Interactive preview. You can find attached a sample report definition illustrating the suggested. Notice there is a row group defining the size of the group(per how many rows to have headers and empty row below the group), the rest is styling of items to achieve the desired layout."

    I hope this helps.

    Regards,
    Stef
    Telerik

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

  5. Wadigzon
    Wadigzon avatar
    58 posts
    Member since:
    Feb 2013

    Posted 26 Jul 2013 Link to this post

    This certainly can help, I have the sample and it runs. The question I have is regarding the creation of this strange table.

    1) It looks as if the first column (with [Fields.ID] has all the rows merged. How do I merge rows? I don't see that option.

    2) it looks as if there's an extra third row. Should I add an extra row at the bottom of the original 2-row table?. is it inside the group? or outside the group?.

    could you give the steps to build such a table? 

    regards,
  6. Wadigzon
    Wadigzon avatar
    58 posts
    Member since:
    Feb 2013

    Posted 26 Jul 2013 Link to this post

    I tried to do it myself, copycatted your sample, as shown in designer_copy.jpg (it looks the same as your example)
    but when I click on Preview I get this message 
    "Object reference not set to an instance of an object."

    I also did the DataTable/GetData Data Source hookup as shown in the Sample.

    what am I doing wrong?
  7. Wadigzon
    Wadigzon avatar
    58 posts
    Member since:
    Feb 2013

    Posted 30 Jul 2013 Link to this post

    Ok after playing with the sample, this is how you do it.. I will write it here to have it as a reference

    1) Drag a table on the designer. It will be a 3 column x 2 rows table originally. 1st row will be headers, 2nd row will be data.

    2) Make sure you have the GetData function on the report class that will feed the table as a DataTable object like this:
    public DataTable GetData()
    {
        var table = new DataTable();
        table.Columns.Add("ID", typeof(int));
        table.Columns.Add("Day Plan");
        for (int i = 0; i < 128; i++)
            table.Rows.Add(i, "Some day plan" + i.ToString());
         return table;
    }

    3) Now hook up this function with the DataSource property of the table. Add an ObjectDataSource to the report and go to the wizard and point to this function.

    4) Right click on the data row (2nd) and do "Insert Row" > "Outside Group - Above"

    5) Right click on the same data row (now the 3rd) and do "Insert Row" > "Outside Group - Below"

    6) On the group explorer, go to (Detail), click on the "..." button and do "Add Group" > "Parent Group", click on New, and select "= Fields.ID" from the drop down (it will be there if you hooked the data source), click on OK

    7) Delete the 1st Row (Header row), right click and do "Delete Rows"

    8) Click on the 1st Column, 1st Row, and press click delete, that will remove the text.

    9) Using shift, click on the cells of the 1st column, right click and do "Merge Cells"

    10) Put the desired text title on the (2nd column, 1st row), (3rd column, 1st row), .... and so on.

    11) Put the desired data fields on the (2nd column, 2nd row), (2nd column, 2nd row), .... and so on

    12) You might delete the last column as you only have two fields to show on this sample.

    13) Merge cells (c:2, r:3), (c:3, r:3)

    14) Hide 1st column (Fields.ID), change Visible property from True to False.

    15) Edit Grouping on the Group explorer, click on "..." on the Grouping column, change "=Fields.ID" to "=Fields.ID/8"

    16) Adjust cells sizes. Compile. and try it (click Preview)
  8. Answer
    Stef
    Admin
    Stef avatar
    3053 posts

    Posted 31 Jul 2013 Link to this post

    Hello,

    Here are the steps to create the Table item definition from the example:
    1. Define some data and wrap it with data source component(ObjectDataSource component in the example);
    2. Add a Table item with two columns (ID and DayPlan). Notice you do not need header cells, only two cells for the specified fields;
    3. Select the Table item and open the Group Explorer
    4. Add parent group to the Detail - the grouping expression determines the size of the groups. The following expression =Fields.ID/8 determines a group of 8 records, where Id is a consecutive number starting from zero. The expression can be adjusted according to your data.
    5. Select the newly added TextBox item for the parent group, right click and in the Context Menu select Insert Row -> Inside group - Above, then Insert Row -> Outside group - Below;
    6. Style the Upper row as header, e.g. gray background color, then style the middle row to have borders around items in it.
    7. Finally hide the item in the parent group by setting its Visible property to false and its ColumnWidth to small value.

    I hope this points you into the right direction.

    Regards,
    Stef
    Telerik

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

  9. Percy
    Percy avatar
    1 posts
    Member since:
    Dec 2015

    Posted 04 Mar in reply to Stef Link to this post

    Hi,

    I'm have a table list.

    var table = new DataTable();

                table.Columns.Add("Level1");
                table.Columns.Add("Level2");
                table.Columns.Add("Level3");
                table.Columns.Add("Grade");
                foreach (var gradedC in getUserProfileResponse.UserCV.AllGradedCompetences)
                {
                    if (gradedC.InCV)
                    {

    table.Rows.Add(gradedC.TjanstomradeNamn, gradedC.KompetensomradeNamn, gradedC.SpecialistkompetensNamn, gradedC.Betyg);
                    }
                    
                }
                var table1 = new DataTable();

    this.GetData = table;

    See the image For grouping parent and Child

    Here the result:

    IT och Systemutveckling
    Certifieringar IT (3 och över = certifierad)
    Microsoft - 70-316 Developing      3
    Microsoft - 70-483 Programming in C# 3

    Databaser
    MS SQL Server 3

  10. Stef
    Admin
    Stef avatar
    3053 posts

    Posted 08 Mar Link to this post

    Hello Percy,

    Based on your screenshot, there row groups in table8 (Table item, where the Level2 grouping is not dynamic as the grouping lacks an '=' sign that turns it into expression and 'Level2' will be taken as a static string value. For more details, please check Understanding Detail and Grouped Data.

    If you need further help, please elaborate on the used data and the current and the desired result on preview.

    Regards,
    Stef
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
DevCraft banner