从 SQL Server 报告 Web 服务调用返回数据
我正在生成一份包含版本号的报告。 版本号存储在数据库中,并作为报告生成的一部分进行检索/增量。
唯一的问题是,我通过 Web 服务调用来调用 SSRS,该调用将生成的报告作为字节数组返回。
有什么方法可以从生成的报告中获取版本号吗? 例如显示一个对话框,内容如下
您生成了状态报告,版本号 3
我尝试传递输出参数并将其设置在存储过程中。 当我在 sql Management Studio 中执行它时它被修改,但在 Reporting Studio 中却没有。 或者至少我似乎无法绑定到修改后的执行后值(使用表达式=Parameters!ReportVersion.Value
)。
当然,在调用 SSRS Web 服务并将其作为参数传递给报告之前,我可以自己从数据库获取/增加版本号,但这可能会导致并发问题。
总的来说,storedproc 访问/生成版本号并将其返回给 ReportingEngine 似乎更简洁,ReportingEngine 将生成带有版本号的报告并将更新的版本号返回给 WebService 客户端。
有什么想法/想法吗?
I am generating a report that contains the version number. The version number is stored in the DB and retrieved/incremented as part of the report generation.
The only problem is, I am calling SSRS via a web service call, which returns the generated report as a byte array.
Is there any way to get the version number out of this generated report? For example to display a dialog that says
You generated Status Report, Version number 3
I tried passing in an output parameter and setting it inside the storedproc. Its modified when i execute it in sql management studio, but not in the reporting studio. Or atleast i can't seem to bind to the modified, post execution value (using expression =Parameters!ReportVersion.Value
).
Of course, I could get/increment the version number from database myself before calling the SSRS webservice and pass it along as a parameter to the Report, but that might cause concurrancy problems.
On the whole, it just seems neater for the storedproc to access/generate a version number and return it to the ReportingEngine, which will generate the report with the version number and return the updated version number to the WebService client.
Any thoughts/Ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
因为我还不能添加评论...
只是把它扔掉。 也许将报告呈现为 XML(到 XML 文档对象)并通过 XQuery 或 XPath 提取版本号。
当然,这可能会扰乱您的整个“版本控制”方案,因为您将渲染报告两次。 也许添加一个参数来指示是否增加版本号?
Since I can't add a comment yet...
Just throwing this out. Maybe render the report as XML(to a XML document object) and pull your version number out via XQuery or XPath.
Of course that would probably bugger up your whole "versioning" scheme as you would be rendering the report twice. Perhaps add a parameter that indicates whether or not to increment your version number?
作为解决方法,您可以创建一个子报告来执行此操作。 不要将版本作为输出变量返回,而是将其作为结果集中的列返回。
希望这有帮助,
比尔
As a workaround, you could create a sub-report to do this. Instead of returning the version as an output variable, return it as a column in a resultset.
Hope this helps,
Bill