Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filling dataset with SP with relational info
Message
From
09/11/2010 12:09:30
 
 
To
09/11/2010 10:27:11
General information
Forum:
ASP.NET
Category:
Databases
Environment versions
Environment:
VB 9.0
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01488565
Message ID:
01488605
Views:
32
>>>>I am writing a module in my app to use DevExpress XtraReports. It seems they like datasets with relational information. Soooo
>>>>
>>>>In my Strataframe business objects I tend to use stored procedures that return multiple tables. If I have a single parent record with 5 child tables, I will pass the pk of the parent as the param to my sp and fill 6 BOs on one trip to the server. Sometimes I'll fill the parent with one sp and then all the children from another.
>>>>
>>>>If I have a set of parents I will usually do everything in one sp so the result set of the parents can be used create the collection of foreign keys to pull all the related children ( the framework takes care of dynamically filtering the chlidren on navigating the parent )
>>>>
>>>>I can use these business objects with XtraReports, but my understanding is the master-detail stuff is more easily handled with datasets.
>>>>
>>>>I don't really need the business objects for the XtraReports and it seems regular datasets will be easier but I see that when I use the Visual Studio 2010 add new datasource wizard and select the sp that returns multiple tables only the schema of the first table makes it into the treeview. Is this to be expected and should I just have a separate stored proc for each table or is there a trick to returning multiple tables and having the schema builder see the structure so that the structure is there for building the report?
>>>>
>>>>If this isn't viable I'll probably stick to my BOs and just copy into the datasets, but getting structures into the datasets at design time may be a PITA
>>>>
>>>>Any suggestions, guidance appreciated. I can see advantages to pulling all the data on one trip but I need the structures at design time to build the reports.
>>>>
>>>>TIA
>>>
>>>Does the report tool work with entity classes? In VS, you can use an entity class to design your reports (the class or dataset or connection or something that matches just has to exist at design time) and then at runtime pass the same name and structure to the report as either a dataset or list or entity class - as long as it matches the same structure and column names and types it works. I tested this numerous times but I haven't worked with DevExpress XtraReports....
>>
>>I have to admit I am very ignorant about entity classes besides some superficial reading. Xtrareports works with anything implementing iList, but datasets seem the simplest for a beginner. My problem is that there are going to be a massive number of reports of really varying structures (converting a vfp app where there are over 100 remote views driving the reports ) The data will be fetched from sprocs and in order to design the reports i don't want to have to build the datasets myself at design time. Was very pleased to see I could create a datasource from a sproc in VS, but the hurdle I am running into is the thing about only seeing one select statement in the sproc where I want to return multiple selects, each to their own datatable.
>>
>>As I think about it, I would not be surprised if I needed a separate sproc for each table and if I can't do the multiple table pull from one sproc - that maybe some strataframe jiggery pokery that is not native to .NET ???
>>
>>So basically the problem is that since I have to write the sprocs anyway, I don't want to have to manually write datasets or entity classes as well for each sproc.
>
>http://www.devexpress.com/Support/Center/p/Q240375.aspx
>http://www.devexpress.com/Support/Center/p/Q101853.aspx
>
>Not sure any of those will actually suit your purpose, but they are interesting and have examples.
>
>Have you tried either of their forums? There seems to be some discussion on it on the strataframe forum:
>http://forum.strataframe.net/Topic27650.aspx
>http://forum.strataframe.net/Topic15189.aspx

Yes, didn't see the second link but had seen the others. I guess what I am having a hard time with conceptually is how to lay out the reports at design time without manually creating the dataset schema. I like the idea of pointing the data explorer at the sproc, but it doesn't want to pick up the structure of any but the first table.

I'm probably asking the question in-artfully, but I posted on the SF forum just now to see if anyone had insight as to how I can leverage what SF does well without adding complexity to the DevExpress preferred way of doing things.

I guess in the non-SF context, my basic question is : How can I fill a multitable relational dataset from a single sproc and see the structure at design time?


Charles Hankey

Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy

Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.

-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin

Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.
Previous
Reply
Map
View

Click here to load this message in the networking platform