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

Print several tables with different information

6 Answers 90 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Gerardo
Top achievements
Rank 1
Gerardo asked on 05 Feb 2013, 04:43 PM
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

6 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 08 Feb 2013, 11:40 AM
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!

0
Gerardo
Top achievements
Rank 1
answered on 27 Feb 2013, 03:21 PM
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? 
0
Stef
Telerik team
answered on 04 Mar 2013, 10:02 AM
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!

0
Gerardo
Top achievements
Rank 1
answered on 06 Mar 2013, 03:56 PM
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

0
Stef
Telerik team
answered on 11 Mar 2013, 05:39 PM
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.

0
Brian
Top achievements
Rank 1
answered on 05 Apr 2013, 12:14 PM
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});
}
Tags
Report Designer (standalone)
Asked by
Gerardo
Top achievements
Rank 1
Answers by
Stef
Telerik team
Gerardo
Top achievements
Rank 1
Brian
Top achievements
Rank 1
Share this question
or