从 CakePHP 调用 SSRS 报告
我开发了一个 CakePHP 应用程序,它对我创建的一系列表执行基本的 CRUD 操作。 CakePHP 应用程序似乎运行得非常非常好,从长远来看我真的很想更多地使用它。
也就是说,我的需求涉及使用 SQL Server Reporting Services 针对数据运行报告。微软发布了一个PHP SDK来连接SSRS并显示报告。
我对设置 MVC 结构来实现我想要的目标的最佳实践方式并不乐观。
我可以设想设置一个包含报告列表的表和另一个包含必需/可选参数列表的表,并为该模型生成一个视图/控制器,该视图/控制器将向用户提供他们可以运行的报告列表,然后为reportexecute(或类似的)创建一个视图,该视图将接受用户的输入,然后使用我上面引用的SDK 调用SSRS。
这是解决这个问题的常用方法吗?我缺少更好的方法吗?我不想通过破解这部分来搞乱我可爱的 MVC 应用程序!
先感谢您!
I have developed a CakePHP application that does basic CRUD on a series of tables I've created. The CakePHP app seems to be working very, VERY well and I would really like to use it more in the long run.
That said, my needs involve using SQL Server Reporting Services to run reports against the data. Microsoft has released a PHP SDK to connect to SSRS and display reports.
I'm not positive about the best practices way of setting up the MVC structure to accomplish what I want.
I can envision setting up a table that contains the list of reports and another table that contains a list of required / optional parameters and generating a view/controller for that model that would present the user with a list of reports that they could run, then creating a view for reportexecute(or somesuch) that would take the user's input then call SSRS using the SDK I've referenced above.
Is this a common way to solve this problem? Is there a better way that I'm missing? I don't want to muck up my lovely MVC app by hacking my way through this part!
Thank you in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以只使用 SSRS Web 服务,它提供所有报告元信息作为正常的 SOAP XML 响应。使用 XML,您可以不受任何限制地做任何您喜欢的事情。
这是一个在 ASP .Net 应用程序中使用 Web 服务的示例,您应该能够轻松地使用它适应您的 PHP 要求。
You could just consume the SSRS web services which provide all the reporting meta information as a normal SOAP XML response. Using the XML you can then do whatever you like without any constraints.
Here's an example of consuming the web service in an ASP .Net application which you should be able to easily adapt to your PHP requirements.
我不做 MS,但是关于 SDK,您可以通过 Vendors 机制包含它,使用 App::import 包含必要的文件。但我相信你已经知道这一点了。
我?如果我觉得需要存储报告和选项以供以后使用,我可能会使用数据库表。我倾向于对表名和列名使用 CakePHP 约定。通过这种方式,您可以轻松地为其他 Cake 构建(非 MS)应用程序访问它,并且还可以更轻松地在 Cake 中编写 GUI。
I don't do MS, but regarding the SDK, you can include it via the Vendors mechanism, using App::import to include the necessary files. But I'm sure you already know this.
Me? If I felt there was a need to store reports and options for later use the I'd probably use db tables. My inclination would be to use CakePHP conventions for the table name and column names. This way you can easily access it for other Cake-build (non-MS) applications and also write the GUI more easily in Cake.