cancel
Showing results for 
Search instead for 
Did you mean: 

conditional text formatting

Former Member
0 Kudos

Hi,

Based on some selection I want to print text conditionally on report.

For Ex:

If there are records available based on parameter selection .I would like to print 'End of Report ' in black font in report footer section.

But if there are no records available then print 'No Record Found' in red font color .

I am using below formula: (the formula is placed in report footer section)

IF (Count ({PDOC_PRO_INDENT_TRACKING_A.REQUISITION_NO}) <> 0 )

    Then '************************ End of Report ************************'

     ELSE 'No Record Found'

Thanks ,

Karan Sheth

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Karan,

Here's an easy way to do this:

1) Create two Report Footer sections

2) Create a formula with this code and place it on Report Footer a:

IF (Count ({PDOC_PRO_INDENT_TRACKING_A.REQUISITION_NO}) <> 0 )

Then '************************ End of Report ************************'

else "";

Change the font color of this formula field to Black

3) Create another formula and place this on he Report Footer b:

IF (Count ({PDOC_PRO_INDENT_TRACKING_A.REQUISITION_NO}) = 0 )

Then 'No Record Found'

else "";


Color this formula field in Red


4) Go to the section expert > select Report Footer a > Check the option 'Suppress blank section'. Do the same for Report Footer b.


-Abhilash


Former Member
0 Kudos

Hi Abhilash,

Thanks ...nice work around but is it possible in one section itself.

Thanks,

Karan Sheth

abhilash_kumar
Active Contributor
0 Kudos

Yes, drag and drop the first formula field > Choose it black > Right-click > Format Field > Click the formula button beside Suppress and use this code:

currentfieldvalue = ""

Drag and drop the second formula field on top of the existing field > right-click > Repeat the same step as above.

-Abhilash

former_member205840
Active Contributor
0 Kudos

Hi Karan,

Yes it is possible.

Place your formula in report footer

IF (Count ({PDOC_PRO_INDENT_TRACKING_A.REQUISITION_NO}) <> 0 )

    Then '************************ End of Report ************************'

     ELSE 'No Record Found'

now right click on formula go in Format Field-- Font-- then click on formula editor of Style then give below condition to make your text bold

If {formula} = '************************ End of Report ************************' Then CrBold

To make no records found in red color .. again right click on your formula and go in Format Field--Font--Color formula editor and give below condition.

If {formula} ="No Records Found" Then Crred.


-Sastry

Former Member
0 Kudos

Hi,

Thanks for the help...

Thanks,

Karan Sheth

Answers (0)