Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Crystal parameters to MS SQL

Status
Not open for further replies.

Djbell

IS-IT--Management
Apr 22, 2002
175
GB
Hi All

I am using the integrated Crystal Reports within VS Studio 2005.

I have 3 views in my MS SQL Server View1, View2, View3, View1 and View2 consolidate data in 2 tables, View3 combines the data in View1 and View2. My Crystal Report is based on View 3. After trying various permutations in my select statement within my report I realise that I have to do some filtering on my 2 base views (1 and 2), is it possible to pass Crystal Parameters 2 my 2 base views, so when the report runs and it asks me for the parameters it passes these back to the SQL views?

Cheers

Dj
 

I think you would need to create three new views - filtered versions of 1 and 2, and a replicated version of 3 that points to the two new ones.

However, this is almost certainly going to be a performance nightmare. Views aren't always the most efficient objects for reporting because they usually contain extraneous tables and fields, which slow down the query, and because conditions in your CR select statement won't usually get passed to the database.

Can you write either one new view to base the report on, or perhaps a stored procedure? I can't say for sure, but I would expect a huge decrease in execution time.

 
If View3 is just a facade remove it, include View1 and 2 and filter them using record selection formula.

Viewer and Scheduler for Crystal reports and SSRS.
 
Depending on the amount of data returned by the views and how much you want to filter out it might be more efficient to replace the views with Stored Procedures, for which you will be able to include parameters, and which are then available from the Crystal Report.

Cheers
Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top