Can I pass the Order By clause from VB 6.0 to Crystal 8.5 OCX?

Can I pass the Order By clause from VB 6.0 to Crystal 8.5 OCX? Some one help me please....

Thanks in Advance

rchandr3Asked:
Who is Participating?
 
Ido MilletConnect With a Mentor Professor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
Pass a parameter value to control what a formula returns.  Sort on that formula.

Cheers,
- Ido

0
 
mlmccCommented:
You don't pass an order by clause but sort fields.

Public WithEvents cr_Generic_Report As CrystalReport

cr_Generic_Report.SortFields(1) = "{View.Field1}"
cr_Generic_Report.SortFields(2) = "{View.Field2}"

I believe you can pass as many as needed.  I have passed as many as 6.

mlmcc
0
 
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
mlmcc,

The problem with the direct approach is that there is no graceful way to recover from an incorrect value being passed in.

With the parameter approach, the formula can have a default field used if the parameter value makes no sense.

Cheers,
- Ido

0
 
mlmccCommented:
Agree until I need to sort on two fields or then someone want 4 fields.  I have to keep changing the report.

You still haven't added a comment to
http://www.experts-exchange.com/Databases/Crystal_Reports/Q_20772691.html

mlmcc
0
 
rchandr3Author Commented:
Thanks a lot mlmcc and ofcourse Ido...

Ido's idea was tried and it worked very well.... Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.