views:

313

answers:

3

Hi All,

Simple question... I have a VS 2005 solution that encompasses several reporting services projects. Currently, each project has it's own shared data source making changing the database target very tedious.

Is there a way to share the data source across the entire solution (i.e. all the projects in the solution will use the data source defined in one place?).

I thought I could create a project that just held one data source item and then make all of the other projects dependent upon that one, however, the shared date source in the new project does not appear in the other projects for me to select.

Help! I have looked around the web for info, but not much available. There must be a simple solution to this.

Thanks

A: 

This may not be what you're thinking, but when I'm writing an app consisting of several distinct applicaitons accessing the same data I usually take one of two approaches.

  1. write all of my data access logic into a Class Library project and reference it from the other projects.

  2. Write my data access logic into a Web Service library and add a web reference.

I usually go for option 2 if the data I am accessing is likely to be used in future development, such as accessing company-wide customer lists, etc.

David Stratton
A: 

According to this post by Paul Turley, it appears as if this is not possible. You'll have to copy the data source into each project. The good news is that if you deploy them to the same location, only one data source should exist on the server.

Michael McGuire
A: 

I am sorry I somehow overlooked your question when I posted the same.

Nonetheless, a technique I am using is described in an answer to it. It feels a little shady and underhanded but seems to be working so far:

  1. Make a new report project to hold your shared data source. I called mine Data Source.
  2. Copy your shared data source (let's pretend it's called My Shared Data Source) to that new project.
  3. If necessary, copy My Shared Data Source to each actual report project and link things up the way you want. But probably you're already set up like this.
  4. Close Visual Studio to make sure all changes are saved in the filesystem and to make sure it doesn't end up clobbering some of our next, "backstage" edits.
  5. In plain old Windows Explorer (or whatever), delete the My Shared Data Source.rds file from every project folder except Data Source's.
  6. Using a text editor or XML-file editor, edit each project's .rptproj file to change the text of the Project.DataSources.ProjectItem.FullPath element from My Shared Data Source.rds to ..\Data Source\My Shared Data Source.rds.

Now each project still has its own reference to a data source, but all those references happen point to the same underlying physical file, and thus they all share one data source specification.

Woody Zenfell III