Binding a report to DataTables with different schemas

Stimulsoft Reports.WEB discussion
Kamyar
Posts: 15
Joined: Fri Oct 08, 2010 4:25 pm

Binding a report to DataTables with different schemas

Post 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
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Binding a report to DataTables with different schemas

Post by Alex K. »

Hello,

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

Thank you.
Attachments
855.SampleReport.mrt
(19.17 KiB) Downloaded 445 times
Kamyar
Posts: 15
Joined: Fri Oct 08, 2010 4:25 pm

Binding a report to DataTables with different schemas

Post 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Binding a report to DataTables with different schemas

Post 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.
Kamyar
Posts: 15
Joined: Fri Oct 08, 2010 4:25 pm

Binding a report to DataTables with different schemas

Post 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Binding a report to DataTables with different schemas

Post by Alex K. »

Hello,

Please see sample project in attachment.

Thank you.
Attachments
857.DynamicCreateReport.zip
(15.46 KiB) Downloaded 315 times
Kamyar
Posts: 15
Joined: Fri Oct 08, 2010 4:25 pm

Binding a report to DataTables with different schemas

Post by Kamyar »

Thank you Aleksey.
That was exactly what I was looking for.
Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

Binding a report to DataTables with different schemas

Post by Andrew »

Hello,

Have a nice day!

Thank you.
Kamyar
Posts: 15
Joined: Fri Oct 08, 2010 4:25 pm

Binding a report to DataTables with different schemas

Post 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!
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Binding a report to DataTables with different schemas

Post by Alex K. »

Hello,

Do I understand you correct that the issue is solved?

Thank you.
Post Reply