开发者

Crystal 2008 - Can I access the SQL statement programatically at runtime?

We've created a Crystal Report viewer application to house all of our company reports. It's built in such a way that any time we add, modify or delete a report, the viewer application itself does not need to change. The viewer app is completely driven by an XML configure file that tells it what reports are available, where they are, connection information etc. We want to keep it this way too. When we add a new report, we don't want to have to update everyone's viewer application.

The problem is that Crystal talks to our DB directly and we would prefer it didn't. Therefore, for each report, the viewer needs to query the database to retrieve the data each report needs. The pr开发者_运维百科oblem is that many of our reports allow the user to enter a large number of filter criteria. Ideally, what we would like to be able to do is to have Crystal prompt the user to enter their filter criteria, like it currently does, and then be able to somehow get the SQL statement it would send on to the DB, pass it on to the DB ourselves, and tell Crystal not to. the viewer would then supply the report with data.

Does anyone know if this can be done? An alternative we've considered is to have the viewer prompt the user for the filter criteria, and then build the SQL statement. However, then each report becomes a C# coding project with an update to the viewer. We're trying to avoid that.

Thanks.


Interesting approach. I have only ever done the opposite.

Normally people like to build their own reports using a Crystal client. The report connects to a datasource specified in the report itself.

Using .NET to query the reports needs, set parameters and formulas then view the report is a piece of cake.

Anyway, there are only two methods that I know of called "pull" and "push". Pull is what I just described above. Push is what you described as a solution that you considered but it would involve coding for each report.

I'm afraid what you are trying to do has never been done before. However, I would recommend the "pull" method. It has worked very well for me with a client with dozens of users and hundreds of reports.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜