|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi
I'm really confused about how to create a report in Crystal reports (VS.NET 2005.) I have all my typed datasets (.xsd) in a project, and the data access layer to fill the datasets in separate project. In another project (in the same solution) I have the windows forms containing a reports viewer, and in a third project I have my crystal reports. How can I bind the report to a dataset using my data access layer? Other controls let me bind them to a typed dataset, and then I can programmatically fill the dataset using the DAL, but crystal reports won't let me select anything outside of the current project. Thanks! |
|
#2
|
||||
|
||||
|
I think I have a suggestion, but I'll warn you that I won't be able to show you any code. This is mainly because what I did doesn't involve Crystal Reports, but rather the built-in reporting classes in .NET.
I needed to make a program for running reports that had the actual report definitions in their own assemblies, much like yours. These assemblies were plugins, pretty much. However, because they each might have a different typed dataset and could only reference the application and its libraries and not the other way around, those typed datasets had to be in the same assembly as the report definition. The app and its libraries couldn't know anything specific about the reports. Even the reports that shipped as standard are in a plugin assembly. When I run the report, the report object from the plugin calls the DAL layer on its own with a lightweight Command object and the typed dataset is filled with the data. The DAL neither knowing the SQL nor the specific type of the typed dataset. It then returns an object containing the report definition, datasource names, datasource objects, etc. for the viewer to incorporate into the LocalReport object in the app and display. I hope this little description helps. I might also be able to answer more specific questions about the design.
__________________
Joel B Fant "An element of conflict in any discussion is a very good thing. Shows everybody's taking part, nobody left out. I like that." .NET Must-Haves Tools: Reflector References: Threading in .NET |
|
#3
|
|||
|
|||
|
Thanks for your help, I think I understand how you got it to work. I see that the typed datasets do need to be in the same assembly as the reports though, which is annoying because I will have to have duplicate datasets (one for the application) unless I reference the ones in the reports assembly.
|
|
#4
|
||||
|
||||
|
That's not fun.
Found something for you: link. Check out the last answer; the one about subclassing. Maybe you can have the dataset in your app and reference that assembly with your report assemblies. |
|
#5
|
|||
|
|||
|
Quote:
Thanks! That has solved the problem. I can reference my existing datasets from Crystal Reports now. ![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > .Net Development > Crystal Report datasource problems |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|