如何将数据源视图和基于它的报表模型的源更改为不同的数据库?
我有许多报表部署到 SQL Server 2005 Reporting Services 服务器上。它们都是使用相同的报告模型 (SDML) 开发的,该报告模型引用相同的数据源视图 (DSV),该数据源视图指向一个主要填充虚拟数据的测试数据库。现在,我想让这些报告使用我们的真实数据从实时数据库中提取数据。这两个数据库具有完全相同的结构。
在我看来,如果我可以更改数据源视图中引用的数据源,那么我可以重新部署报表模型,并且基于它的所有报表也将引用正确的数据。我可以在 Business Intelligence Development Studio 2005 中看到,设计模式下的数据源视图属性列表中有一个选项可以更改数据源。所以我改变了数据源,认为这可行。但是,当我在数据源视图中更改数据源后尝试重新部署报表模型时,我收到许多错误消息,如下所示:
错误 1 实体“地址”的表属性引用了表“dbo_address” ,它不在主要数据源中。 Events.smdl 0 0
我还需要在这里做些什么吗?报表模型或数据源视图中的某些内容应该更新?还有其他方法可以完成我需要做的事情吗?
编辑1:
我尝试在部署报表后更改服务器上报表模型的数据源,这似乎工作得很好。这并不完全是我想做的,但它确实有效。谢谢大家。
I have a number of reports deployed to a SQL Server 2005 Reporting Services server. They were all developed using the same Report Model (SDML) that references the same Data Source View (DSV) that points to a test database filled with mostly dummy data. Now, I would like to make those reports pull data from the live database with our real data instead. The two databases have exactly the same structure.
It seems to me, that if I could just change the Data Source being referenced in the Data Source View, then I could redeploy the report model, and all the reports based on it would also reference the correct data. I can see in Business Intelligence Development Studio 2005 that there's an option in the Data Source View property list in Design mode to change the Data Source. So I changed the Data Source, thinking that would work. However, when I try to redeploy the report model after changing the Data Source in the Data Source View, I get a number of error messages like this one:
Error 1 The Table property of the Entity 'Address' refers to the Table 'dbo_address', which is not in the primary data source. Events.smdl 0 0
Is there something else I need to be doing here? Something in the Report Model or Data Source View that should be updated? Is there another way to do what I need to?
Edit 1:
I tried changing the datasource of the report model on the server after the reports were deployed, and that seemed to work pretty well. It's not exactly what I wanted to do, but it works. Thanks everyone.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
对我来说最有效的策略是将“测试”共享数据源部署到服务器,然后通过报表管理器界面对其进行编辑以指向“生产”数据库(更改连接字符串)。当然,确保覆盖数据源在部署时设置为 false。
此外,测试中的数据库架构必须与生产中的数据库架构相同。
The strategy that has worked best for me is to deploy the "test" shared datasource to the server then edit it via the Report Manager interface to point to the "production" database (changing the connection string). Making sure of course Overwrite Datasources is set to false on deploy.
Also, your database schema must be the same in test as it is in production.
我对报表模型没有太多经验,但通常 SSRS 不喜欢您对数据源进行更改,并要求您刷新所有数据集(如果您这样做)。
或者,只需更改报表服务器本身上的数据源定义。
I don't have as much experience with the report models but generally SSRS doesn't like it when you make changes to the datasource and asks you to refresh all the datasets that you have if you do.
Alternatively, just change the datasource definition on the report server itself.
听起来您正在更改 dsv 引用的数据源。相反,为什么不尝试更改数据源的连接字符串。在内部,DSV 使用 GUID 来标识各种表和字段,我怀疑通过创建新的数据源,GUID 将会更改,这就是您看到这些错误消息的原因(因为错误消息将内部使用的 GUID 映射到它的“友好名称”)。
It sounds like you're changing the data source that the dsv references. Instead, why don't you try to change connection string of the data source. Internally the DSV uses GUIDs to identify the various tables and fields, I suspect that by creating a new data source the GUIDs will change and that is why you're seeing these error messages (as the error message is mapping the internally used GUID to it's "friendly name").
我使用的设置对于每个环境都有一个名称相同的数据源 (.rds) 文件,位于报告部署到的同一文件夹中。它只是一个连接字符串...
我的经验与 zalzaw 相同 - 如果更改数据源,您必须刷新与报表关联的所有数据集,同时根据数据源的变化指向新的环境。这是非常乏味的 - 您转到 Business Intelligence Development Studio 2005 中报表的数据选项卡:
重复步骤,直到所有数据集都已刷新。
确保数据库(和存储过程)同步。如果一个表存在于 Dev 中但不存在于 Test 或 Prod 中,那么一切都是毫无意义的......
The setup I use has an identically named Data Source (.rds) file for each environment, in the same folder the reports are deployed to. It's just a connection string...
My experience has been the same as zalzaw's - if you change the Data Source, you have to refresh all the datasets associated with the report while pointing at the new environment based on the data source changes. It's very tedious - you go to the Data tab for the report in Business Intelligence Development Studio 2005:
Repeat steps until all datasets have been refreshed.
Make sure that the database(s) (and stored procedures) are in sync. It's all for naught if a table exists in Dev but not in Test or Prod...