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!

Multiple Command Parameters

Status
Not open for further replies.

mmusick

Programmer
Aug 12, 2003
13
0
0
I’m new (10 days) to crystal reports V10 and need some help on the following. I have two Oracle tables that I built the following command to use as the record source for my report:
SELECT F1 as Idate,
F2 ,
F3 ,
'TEXT1' as type
FROM a
WHERE F5 in ('67','43','64','49')
AND F6 in ('20','56','10’,'62')
AND F3 = 'T1'

UNION
SELECT F1 as Idate,
F2,
F3,
'TEXT2' as type
FROM b
WHERE F3 = 'T1'
ORDER BY F1

I inserted a cross-tab into the report which has column Idate (for each week), row of type, and summarized field of F3 which is dollars. It is providing me with what I expected.

I’ve read through multiple posts dealing with parameters, not understanding too much. I would like to be able to have command parameters for F3, F5, and F6. The option to allow multiple fields as input for F5 and F6 does not exist within the command parameter.

Any help would be greatly appreciated.
 
Consider exposing this as a Stored Procedure if possible, and passing the parameters to the SP, which could then be referenced anywhere.

-k
 
Just as a side note, if you don't need to remove duplicates from the result set, use UNION ALL rather than UNION.

UNION ALL avoids a very time consuming duplicate removal phase, which UNION must go through...

hth,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
You could also create a UNION view over the data and use thsi as the source for your report, much the same as a stored procedure.

HTH

Gary Parker
Systems Support Analyst
Manchester, England
 
Thanks to everyone for your suggestions. I'll try them today.
 
The report is now accepting parameters (don’t have to create 6 copies of basically the same thing). I have another question:

I’m also trying to graph the information, in essence the same as the cross-tab. As I stated, the cross tab has column Idate (for each week), row of type, and summarized field of F3 which is dollars. Example below:

Week 1 Week 2 Week 3 Total
Type 1 T1$ T1$ T1$ T1Total$
Type 2 T2$ T2$ T2$ T2Total$
Total Week1$ Week2$ Week3$ $$$

Currently the graph only has two bars for each week, but I would like to also include the total for the week as another bar. Any suggestions?

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top