How can I share a Data Source between multiple projects in Microsoft SQL Server 2005 Reporting Services and keep Visual Studio “Preview”?

前端 未结 2 972
我寻月下人不归
我寻月下人不归 2021-01-02 09:01

I have a solution that contains multiple reporting projects (one per target deployment folder - I think this is the only way to achieve this effect, at least until I abandon

相关标签:
2条回答
  • 2021-01-02 09:57

    Woody,

    What we have tended to do is:

    1. On the server have a folder called "DataSources", which is hidden from the users. In there will be all of the data sources.

    2. For each reporting project in VS there will be a folder, also called "DataSources", but this time it will only contain the data source for this report.

    As long as the folder structure is the same (i.e. report and data source have the same corresponding folder level on server and in VS) this seems to work for us.

    0 讨论(0)
  • 2021-01-02 10:01

    A technique (dirty trick?) I am playing with now is to copy my data source (.rds) into each project, close Visual Studio, then in the underlying files/folders:

    • Delete the copied .rds from my report projects (leaving only the one copy in my Data Sources project)
    • In each report project's project file (Foo.rptproj), change the text of the Project.DataSources.ProjectItem.FullPath element from My Shared Data Source.rds to ..\Data Sources\My Shared Data Source.rds

    This way all reporting projects reference the same underlying file on the filesystem, so they share a single data source definition, but each project also kind of has a "local" shared data source, so Visual Studio is kept happy.

    Regarding source control: there is still only one copy of the .rds checked in, so we're not polluting the code base with lots of icky duplicates; the changes to the .rptproj files can be checked in, so we're not forcing developers into unnatural source-control gymnastics (selective partial commits etc.) to maintain a sane master copy.

    Each reporting project will try to deploy this data source, though I've forbidden the overwriting of existing data sources on the server, so it's not too big a deal . . . and I suppose if I intended to overwrite the server's data source definition, it wouldn't really matter whether I overwrote it once or ten times with the same .rds.

    Disclaimer: this is still an experiment. I don't have experience using this technique in practice yet, so I can't go so far as to actually recommend it.

    0 讨论(0)
提交回复
热议问题