Print several tables with different information

7 posts, 0 answers
  1. Gerardo
    Gerardo avatar
    11 posts
    Member since:
    Dec 2012

    Posted 05 Feb 2013 Link to this post

    Hi Team Telerik!

    I am working with one report that need print several tables with different information, respective to some query,  I need print the tables, i´m try use htmlTextbox but the table tag not is supported...

    I´m trying from code c#, because from there I send parameters with other information to the .Trdx file
    Some solution?

    Regards
  2. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 08 Feb 2013 Link to this post

    Hi Gerardo,

    The htmlTextBox item is meant to display styled text, not html structures as lists and tables. There are dedicated items used to perform this actions as table, crosstab and list items. You can create your report definition in the Standalone Designer in trdx format, then deserialize the trdx in code, change the needed items data sources, then pass the report to a ReportViewer control. Please, check the attached sample report.

    If you need further help on this, please provide us with more details about your scenario and code.

    Greetings,
    Stef
    the Telerik team

    HAPPY WITH REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

  3. DevCraft banner
  4. Gerardo
    Gerardo avatar
    11 posts
    Member since:
    Dec 2012

    Posted 27 Feb 2013 Link to this post

    Hi, sorry that until now I answer, yes is a example excellent, but in your example repeat the same table with same information, is possible that are repeat many tables with different information for down? 
  5. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 04 Mar 2013 Link to this post

    Hello Gerardo,

    Yes you may add more than one table andd feed each table with different DatraSource. Also you may apply filtering based on concrete value, report parameter or field's current value.

    Greetings,
    Stef
    the Telerik team

    See what's new in Telerik Reporting Q1 2013. Register for the March 4 webinar to witness the impressive new visualizations in Telerik Reporting. Just for fun, 10 webinar attendees will be randomly selected to win a Telerik T-shirt and a $50 Gift Certificate to ThinkGeek. Register now! Seats are limited!

  6. Gerardo
    Gerardo avatar
    11 posts
    Member since:
    Dec 2012

    Posted 06 Mar 2013 Link to this post

    Hi Stef

    Are you can help me with some example? with the same example but that can generate other tables with different information dynamically, so that replicate one table many times with different information a way that every table replicated has own datasource.

    Thanks

    Regards

  7. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 11 Mar 2013 Link to this post

    Hello Gerardo,

    It is not getting clear what the scenario is. Where do the table items repeat? - in one section or for different processing sections you want a table with a different DataSource? What is the criteria how many table items will be there?  What is the difference in the assigned DataSource - the same data with filters or totally different data?

    Keep in mind that the Detail section serves as a template which is repeated for each record in the assigned report's DataSource. In addition, it is not recommended to change items definition once the processing has begun, so the best practice will be to have all needed Table items definitions before that moment. If you need to create a Table item definition dynamically, just use the designer at first and check the generated code in the *.designer.cs file, then reuse.

    Let us know the requested details in order to provide you more accurate suggestions.

    Regards,
    Stef
    the Telerik team

    Telerik Reporting Q1 2013 available for download with impressive new visualizations. Download today from your account.

  8. Brian
    Brian avatar
    17 posts
    Member since:
    Jun 2011

    Posted 05 Apr 2013 Link to this post

    Just an FYI if you're using the AutoGenerateColumns sample provided and your using version 7.0 of reporting that you'll need to explicitly and uniquely name each column group created.  If you do not the value for the first column will appear under all other columns in the row. 

    //create two HtmlTextBox items (one for header and one for data) which would be added to the items collection of the table
    Telerik.Reporting.HtmlTextBox textboxGroup;
    Telerik.Reporting.HtmlTextBox textBoxTable;
     
    //we do not clear the Rows collection, since we have a details row group and need to create columns only
    this.table1.ColumnGroups.Clear();
    this.table1.Body.Columns.Clear();
    this.table1.Body.Rows.Clear();
    int i = 0;
    this.table1.ColumnHeadersPrintOnEveryPage = true;
    foreach (DataColumn dc in ds.Tables[0].Columns)
    {
        Telerik.Reporting.TableGroup tableGroupColumn = new Telerik.Reporting.TableGroup();
        // Give each group a unique name.
        tableGroupColumn.Name = "cg" + i;
        this.table1.ColumnGroups.Add(tableGroupColumn);
        this.table1.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Unit.Inch(1)));
     
        textboxGroup = new Telerik.Reporting.HtmlTextBox();
        textboxGroup.Style.BorderColor.Default = Color.Black;
        textboxGroup.Style.BorderStyle.Default = BorderType.Solid;
        textboxGroup.Value = dc.ColumnName.ToString();
        textboxGroup.Size = new SizeU(Unit.Inch(1.1), Unit.Inch(0.3));
        tableGroupColumn.ReportItem = textboxGroup;
     
        textBoxTable = new Telerik.Reporting.HtmlTextBox();
        textBoxTable.Style.BorderColor.Default = Color.Black;
        textBoxTable.Style.BorderStyle.Default = BorderType.Solid;
        textBoxTable.Value = "=Fields." + dc.ColumnName;
        textBoxTable.Size = new SizeU(Unit.Inch(1.1), Unit.Inch(0.3));
        this.table1.Body.SetCellContent(0, i++, textBoxTable);
        this.table1.Items.AddRange(new ReportItemBase[] {textBoxTable, textboxGroup});
    }
Back to Top
DevCraft banner