Crystal Report Formula Field

I want the following in a Crystal report, let me know if they are possible:

  • Hide / show specific field based on input parameter
  • Change the contents of a specific field in the page title and in the information sections based on the input parameter.

I am using Visual Studio 2008 and C # 3.5

Thank you in advance

+4
source share
2 answers

Both are possible.

To hide / show a specific field based on a parameter value:

  • create your own parameter;
  • right-click on the field you want to hide / show and select Format Field ... in the menu;
  • select the "General" tab in the format editor;
  • press the x-2 button to the right of where “Suppress” is indicated - this calls the formula editor for the suppression condition (the checkbox to the left of where it says “Suppression” unconditionally suppresses this field);
  • enter a condition to hide the field - for example. if your parameter is called HideField and you want to hide the field if the parameter is set to "Y" then enter {?HideField} = 'Y'
  • click the "Save and Close" button in the formula editor, and then click "OK" in the format editor.

To change the contents of a specific field in the page title and in the information sections based on an input parameter, create a Crystal formula:

  • create your own parameter;
  • create a formula in the form if {? parameter name } = ' true value ' then { value1 } else { value2 }
  • insert the formula in the page title and detail the sections of your report where you want to see parameterized content.
+4
source

This is how you hide the field - without condition - in the crystal report

Right Click Field Name in Crystal Reports Design

  • Select the "Format" field ...

  • Click the General tab

  • Uncheck the Suppress box

Now the field is hidden!

+1
source

All Articles