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

Visual Basic to run Crystal Reports against Oracle DB

Status
Not open for further replies.

Pozzi

Programmer
Jun 28, 2002
10
0
0
GB
Hi,

I currently create reports from an Oracle Database by using Excel and VBA. These work fine and I have no problems with them to date.

I would like try and re-create one of these reports using Crystal Reports.

My end goal is have one EXE that would be passed a paramter, this would be used to determine which form was loaded and visable to the user. The user would then make all the required criteria selections and click on 'Run'.

The VB app would then run the appropriate report using the parameters as per the criteria set by the user.

Is this do'able?

As a test I tried to create a simple report directly in Crystal, but with only 70% success.

Here is the query when run through SQLPlusW with the results: -

Code:
SELECT AR.CODE, AR.DESCRIPTION, SUM(TA.QTY_WEIGHT), SUM(TA.DISCOUNT), SUM(TA.PRICE)
FROM
TB_ARTICLES AR, TB_TRANS_ARTICLES TA, TB_PROMOTION_ARTICLES PA
WHERE
PA.ARTICLE_ID = TA.ARTICLE_ID
AND AR.ID = TA.ARTICLE_ID
GROUP BY AR.CODE, AR.DESCRIPTION

Result: -

CODE DESCRIPTION SUM(TA.QTY_WEIGHT) SUM(TA.DISCOUNT) SUM(TA.PRICE)
90 Breezer Orange 13 -6 29.25
91 Breezer Watermelon 18 -8.25 40.5
93 Breezer Lime 1 -.75 2.25

When I tried this in Crystal I end up with an entry for each 'Breezer' and my SUM's where all the same value.

How can I re-create the above?

Also, when using Crystal through VB, am I right in thinking that I need to write the report first and then I call it at which time I pass any paramters?

Any help or advice on getting started would be appreciated.

Regards
 
So far I've been developing and running all my Oracle reports in the stand alone Crystal reports, but I've been reading this document about using a Field Definitions File (.ttx) and passing a recordset in VB to the CR viewer component on a VB form.

Have a look at this
The parts about creating the ttx file and the Section called "Passing an ADO recordset to the report via the RDC" are interesting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top