Page 1 of 2

Binding a report to DataTables with different schemas

Posted: Sun Feb 27, 2011 12:07 am
by Kamyar
I'd like to develop a generic reporting engine which would be able to simply various sorts of DataTables with different column names and schema.
The problem is that I don't have a predefined schema for that DataTable. In other words, the report should be able to list a table with column1,column2,column3 columns and also be able to list a DataTable with column4,column5 columns.
I have attached a screenshot for clarification.
Is this possible?
Thank you.
Image

Binding a report to DataTables with different schemas

Posted: Mon Feb 28, 2011 3:21 am
by Alex K.
Hello,

You can place this DataSource twice on the page, and select the required fields for each one.

Thank you.

Binding a report to DataTables with different schemas

Posted: Mon Feb 28, 2011 4:20 am
by Kamyar
Aleksey,
Thank you for the reply. However, I think you misunderstood me.
The report don't have any knowledge about the data sources structure. Just like how a DataGridView can be bound to any DataTable without knowing its structure and AutoGenerate columns.
Actually, I want a report to work just like a GridView. Simply list all the rows and columns of a custom DataTable.
For example, suppose you want to have a report that can display Northwind's customers AND also can display a custom Datatable that you have just populated from another database.
In simple words, I want a report without any grouping, filtering, ... to just list any DataTable.
Thank you.

Binding a report to DataTables with different schemas

Posted: Mon Feb 28, 2011 6:29 am
by Alex K.
Hello,

Could you please clarify your task. Do you want to render a report from the report code without using the designer?

Thank you.

Binding a report to DataTables with different schemas

Posted: Mon Feb 28, 2011 11:43 pm
by Kamyar
Yes Aleksey,
I'd like to assign the db, render, and show the report from the report code. I'd appreciate it if you shed some light on this matter.

Binding a report to DataTables with different schemas

Posted: Tue Mar 01, 2011 2:03 am
by Alex K.
Hello,

Please see sample project in attachment.

Thank you.

Binding a report to DataTables with different schemas

Posted: Tue Mar 01, 2011 3:20 am
by Kamyar
Thank you Aleksey.
That was exactly what I was looking for.

Binding a report to DataTables with different schemas

Posted: Tue Mar 01, 2011 5:23 am
by Andrew
Hello,

Have a nice day!

Thank you.

Binding a report to DataTables with different schemas

Posted: Wed Mar 09, 2011 3:31 am
by Kamyar
Aleksey/Andrew,
Your code works great on winforms. Is there any limitations for using it on webforms? I just tried to use it in a web application project with no luck.
Thank you.
UPDATE:
Nevermind, I had forgotten to bind the report correctly. Thanks!

Binding a report to DataTables with different schemas

Posted: Wed Mar 09, 2011 5:43 am
by Alex K.
Hello,

Do I understand you correct that the issue is solved?

Thank you.