Dynamic Report column size

6 posts, 0 answers
  1. Con Raducanu
    Con Raducanu avatar
    3 posts
    Member since:
    Mar 2009

    Posted 09 Jul 2009 Link to this post


    I am creating dynamic report based on this example.
    Create Dynamic Textbox

    It works fine except the column alignment problem.

    Do you have any property that set the column width automatically?
    i.e. It takes the maximum item text length and aligns the columns automatically.

    I am trying to set the size of each text based on the text size but columns are still not aligned properly.

    Do you have any example i can follow for this?

    Thanks for you support



  2. Steve
    Steve avatar
    10940 posts

    Posted 09 Jul 2009 Link to this post

    Hi Con Raducanu,

    Your question has already been answered in the other thread you've opened. Please, see our answer there for more information.
    We kindly ask you to use just one support channel to contact us. Posting the same questions numerous times slows down our response time because we will need to review and address two tickets instead of one.

    Thank you for your understanding.

    Kind regards,
    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. Chris Bender
    Chris Bender avatar
    1 posts
    Member since:
    May 2010

    Posted 19 May 2010 Link to this post

    I need to know the answer to this as well, but I cannot find where else it was asked.  Can you provide a link to where this was answered, or post it here as well?
  4. Steve
    Steve avatar
    10940 posts

    Posted 20 May 2010 Link to this post

    Hello Chris,

    Here is the answer from the other thread:

    "There is no longer need to use this approach, which was 2 years ago, when there was no other way to align items and handle non fixed number of rows coming from your datasource.
    Now you can use the table item that was introduced in the Q1 release this year. The Table item can display dynamic data by rows and/or columns that extends greatly the flexibility of the report.
    The most important part of the Table item (the Table, the Crosstab and the List items are actually the same Table item with different initial settings) are the Row and Column group hierarchies. The groups in the RowGroups hierarchy define rules how the rows of the Table will be repeated, while the groups in the ColumnGroups hierarchy are responsible for the columns. So the leaf groups in the RowGroups (leaf group has no child groups) defines the rows in the Table Body while the leaf column groups define the columns of the Table Body.

    Depending on the grouping criteria, we have:
    • dynamic groups - have any Grouping expression, ex. group1.Grouping.Add(new Grouping("=Fields.Country")). For the dynamic groups, the corresponding row/column will repeat for every record of the grouped data.
    • static groups - no grouping criteria at all. For the static groups the corresponding row/column is rendered only once.
    • detail groups -have a single empty grouping, ex. group1.Grouping.Add(new Grouping()). Usually you have only one row -or- column detail group. For a detail group the corresponding row/column is repeated for every row of the Table's data source. You may think of the detail TableGroup as the Report's Detail section.

    Since we have Row and Column group hierarchies this means that one group may contain one or more child groups and you may have one or more root groups.

    Depending on the configuration you may create:
    • a simple static grid for ordering items by rows/columns. Use only static groups for the rows and columns.
    • regular (vertical) table -  the data records are displayed by rows. Define one detail group for the Row hierarchy and static column groups to define the columns.
    • master-detail table - define one or more levels of nested row groups and if needed add a detail group to the end: [County] - [City] - [Detail]
    • horizontal table - the data records are rendered by columns. Define one detail column group and put some static row groups to define the Table Body's rows.
    • cross table/pivot table - Define dynamic groups in both Rows and Columns hierarchies; use aggregates for the body cells.

    As you can see the flexibility of the Telerik Reporting's Table item is significant compared to most of the similar components that usually offer only one of the mentioned configurations: only grid that render the data source records by rows or pivot/crosstables that require both row/column groups."

    Kind regards,
    the Telerik team

    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 Public Issue Tracking system and vote to affect the priority of the items.
  5. Rajiv
    Rajiv avatar
    4 posts
    Member since:
    Jul 2014

    Posted 25 Jul 2014 in reply to Steve Link to this post

    The answer that Steve posted is how to create hierarchies. It doesn't answer how to fit all columns to fit it to print on one page.. Please let me know if we know how to setup the size of the entire table (meaning reducing the font size dynamically) to fit it to print on one page. 
  6. Stef
    Stef avatar
    3610 posts

    Posted 29 Jul 2014 Link to this post

    Hello Rajiv,

    The page scaling in printed PDF files exported from the viewer has been changed in a previous version of the product. You can control this behavior via the ViewerPrintScaling option in the PDF Device Information Settings. For more information, see this thread. Thus you can use the Fit setting of the machine's printer. The setting will be applied for exported into PDF reports and directly printed documents.

    To avoid the initial splitting of the report's content between pages, you can set the report's PageSettings.PaperKind to Custom and then provider proper PaperSize settings to fit the content on a single page. the mentioned properties can be controlled also via bindings, and report parameters or other expression that can evaluate the required sizes for a physical page.

    I hope the above information helps you.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top