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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get conditional data from Oracle database into Crystal Reports

Status
Not open for further replies.

ianoctdec

Programmer
Feb 6, 2003
190
CA
Can anyone help me to find out how can I get data from oracle db into crystal report passing a parameter from the crystal report to be used in the selection criteria.
For example: I want to build a summary data from table1 based on Date parameter, also building another summary data from table2 based on the same Date parameter, then I want to join the two summary data and return them to crystal reports.

What I did is I used two Crystal SQL Commands to generate the two desired summary data and joined them in crystal, but when I run the report it was unacceptably slow. I noticed when I use only one SQL comand the report's performance is very good, but it dramatically change when you joing the SQL command with any other object (table or another SQL command!.

So I want to build the two summary data and join them in oracle server side rather than in crystal.

Can anyone help me how can I achieve it in oracle?

I am using Crystal reports 10, and Oracle 8i

Dana;
 
Hi,
Create a view in the Oracle database to handle the join
- Use that as the report's datasource and pass the date params to it.

[profile]
 
Thanks for your quick reply, but I want to know: Do Oracle views accept parameters? If yes, how can I pass the parameter?

Thanks;

Dana
 
It's me again. Still didn't solve the problem.
I want to write a stored procedure in Oracle that will get me the output as follows:

Select SUM (Field1) as sum1, SUM (Field2) as Sum2, Field3, Field4 from Table1, Table2
where Table1.Date = {DateParameter} and Table1.Field0 = Table2.Field0
group by Field3, Field4

It is that possible? I didn't work with Oracle so far.

Thank you,
Dana




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top