how to suppress fields in crystal reports using vb6.0

crystalsoft
crystalsoft used Ask the Experts™
on

how to suppress fields in crystal reports using vb6.0 code
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
I am not sure that you can.

What is it you are trying to do?

Do you want the field suppressed for the report or just individual records?

One way to do this is to pass parameters into the report and suppress based on the value.
Another way os to use formulas for the data rather than fields and change the formulas from VB to display the field or nothing as you need.

mmlcc

Author

Commented:
field is from database
There is condition like
If Combo1.text = "BULK" Then

    If Val(Text26.text) > "0" Or Val(Text26.text) > "0.00" Then
        CrystalReport1.Formulas(25) = "ToPayFRT = " & Val(Text26.text) & ""
   Else
        CrystalReport1.Formulas(26) = "PaidFRT = " & Val(Text27.text) & ""

    End If

on both condition filed always displaying (Printing)

i want to suppress or hide if
If Combo1.text = "BULK" Then

hope you understand my problem

Thanks
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
Do you need the formula for anything else?

What is it displaying?

mlmcc
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

Author

Commented:

in crystal report i added a field from database

and in vb print code i added following condition

If Combo1.text = "BULK" Then
     '' My Code
else
     '' my code
   '' and i dont want to print that field ( I want to suppress that field) here

this field i want to suppress on particular condition.
and field name is (B_Detail.TotAmt(Number) )

Hope you understand

Senior Consultant
Most Valuable Expert 2011
Top Expert 2013
Commented:
How about adding another formula to the report
Use the new formula to conditionally suppress the field

You can set the new formula through code

If Combo1.text = "BULK" Then
     '' My Code
     CrystalReport1.Formulas(xx) = "False"
else
     '' my code
    CrystalReport1.Formulas(xx) = "True"

mlmcc

Author

Commented:

Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial