Filtering In Crystal Report (1 Viewer)

joblesscreature

New member
Local time
Today, 22:45
Joined
Jun 13, 2009
Messages
3
Hi

I am facing problem in generating the crystal report. I need to generate crystal report for the following:-

1. Sponsor Name
2. Sponsor Id
3. Amount Contributed

All the three fileds are fetched from the database directly.

I have used one selection formula for filtering the sponsor name based on the amount contributed. If the amount contributed is more than the given input then all the three fields should be displayed on the report.
But if the amount contributed is less than the given input then only sponsor name should be displayed with other two fields as blank.

Please suggest how to proceed. If somone could share code it would be of great help.

Thanks
 

Kempes

Registered User.
Local time
Today, 18:15
Joined
Oct 7, 2004
Messages
327
In this case you do not need a report filter. What you actually need is to suppress the other 2 fields where it meets your condition.

You will first need to create a parameter field and set the type to match your filter field.
Save it.

In design view, right click on the 1st of the 2 fields and go to format field.
Select the Common tab.
You will see a suppress option and a formula button.
Click on this formula button then put in your condition.
eg,

{amtcontributed} < {?yourparameterfield}

Save it and tick the suppress box.

Repeat this on the 2nd of your fields.

Now close the preview (if open) and re-execute the report. You should be prompted for a value.
By suppressing the field, it will not display if the record value is less than the input value.

Hope this helps

Kempes.
 
Last edited:

joblesscreature

New member
Local time
Today, 22:45
Joined
Jun 13, 2009
Messages
3
Hi Kempes

I tried generating the report as per you reply but still the records are not getting displayed according to my requirements.

I removed the report filter and kept it in the formula section next to supress button. In both the fields i.e. Sponsor Id and Amount Contributed i checked the Supress checkbox.

Still all the three fields are getting displayed even if the amount contributed is less than my parameter.

Could you please suggest some alternative for this.
 

Kempes

Registered User.
Local time
Today, 18:15
Joined
Oct 7, 2004
Messages
327
did you create the parameter and add that into the equation?

This does work if executed correctly. Follow the instructions step by step remembering to set the parameter field to the same type as your amt contributed field.

Post the code you have got on each suppressed field and let me know how you have set up the parameter, and what type the amt contributed is and we should be able to piece it together.
 

joblesscreature

New member
Local time
Today, 22:45
Joined
Jun 13, 2009
Messages
3
Hi Kempes

Thank you so much i was able to solve the problem. Now my crystal report is displaying the records properly.
 

Users who are viewing this thread

Top Bottom