Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Help! Datatable import of some kind possible?

Author  Topic 

daddynahoj
Starting Member

7 Posts

Posted - 2004-12-10 : 06:46:22
Hi everyone, nice to see that there exists a forum for Reporting Services talk! I'm just starting to learn how to use it, but I have a big problem:

I've previously been generating HTML reports that uses DataTables, which are built using a LOT of customized logic depending on (ASP.NET) SessionState info, dozens of SQL queries and so on. Now I want to transfer the info in these datatables to Reporting Services reports. Is this possible, perhaps by using custom code somehow? Or is RS limited to using pure SQL datasets?

Cheers,

Johan

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-12-10 : 12:18:24
You would need to transfer the data into SQL Server or some other dbms and then have RS read from that dbms. No you don't have to use SQL Server, but you can't use .NET DataTables. You could write your own data provider though.

Tara
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2004-12-10 : 13:14:45
You can write out a DataSet to an XML file and write code for your report to read it back into a DataSet that it can use. The problem with this approach is managing the file name(s) and cleaning them up afterwards. You'll also have to write error-handling code in case the XML does not exist when the report runs.
Go to Top of Page

daddynahoj
Starting Member

7 Posts

Posted - 2004-12-10 : 14:57:22
Thanks for the feedback guys. Doesn't look too good then, unless writing my own data provider is a good option?

But isn't it possible to use custom code to, say, call a .NET class that creates these datatables and then basically returns the datarows as strings? Perhaps in a nicer, more structured way?

Otherwise, could I generate the RDL XML programmatically and deploy the report in real-time when a user requests the report? Or would that be way too slow?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-12-10 : 15:01:32
If you call a .NET assembly from RS, one cell will need equate to one call to the assembly which will return one value.

Tara
Go to Top of Page

daddynahoj
Starting Member

7 Posts

Posted - 2004-12-13 : 04:40:58
tduggan: That's very disappointing. :(

So basically, if I need to post-process my SQL data before putting it into a Reporting Services report, I'm pretty much screwed ?
Go to Top of Page

jhermiz

3564 Posts

Posted - 2004-12-13 : 10:31:06
quote:
Originally posted by daddynahoj

tduggan: That's very disappointing. :(

So basically, if I need to post-process my SQL data before putting it into a Reporting Services report, I'm pretty much screwed ?



What do you mean post process ? IF you are looking to modify the data you can do that, then you can use that data as a data source in reporting services. I don't think you are screwed.

Jon
Go to Top of Page

daddynahoj
Starting Member

7 Posts

Posted - 2004-12-16 : 03:13:15
jhermiz:
Let me clarify. By post-processing, I meant that I in C# read data from SQL Server into a datatable, which I then loop thru to further modify and format the rows with this "raw" SQL data. I cannot do these modifications directly in my SQL queries, that's why I'm having problems with Reporting Services, which seems to only accept pure SQL datasets as a source.

The only solution I see so far is to, after my modifications, write the data back to SQL Server, in a temporary table or something. Then write new queries to read that data into Reporting Services. Not the prettiest solution, but doable.

Go to Top of Page

daddynahoj
Starting Member

7 Posts

Posted - 2004-12-16 : 08:11:25
I think I've found a possible solution:

I'll generate the main report (RDL) in C#, deploy it to the report server using the CreateReport() method described by MSDN here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsprog/htm/rsp_ref_soapapi_service_ak_79mc.asp


Using that technique, I can still reference existing sub reports, and I can loop thru my datatables as I wish since I'm coding the report from C#.

Has anyone tried this approach?
Go to Top of Page
   

- Advertisement -