suppress text object if field value is null in crystal - crystal-reports

I am trying to suppress the text value in crystal by right clicking on the text object, selecting suppress and hitting the x2 button and adding the formula
isnull(field)
When I look at the print preview the text is still there when the field value is null.

In the formula section, I changed the code from
isnull(field)
to
if {field} = "" then
true;

In Crystal Reports a placeholder will still be on-screen when you hover over a suppressed field. Since the field is NULL there really won't be a visual difference between NULL and suppressed fields.
~ Nathan

I can put my field in a section, right-click on the section (left margin of the editor) and select Section Expert... In the Section Expert, I ensure the correct section is selected, then I can check the box for "Suppress Blank Section".

Really all you needed was a pair of {} inside ()
Correct line of code to suppress anything in report if it's null is:
isnull({your_report_name.database_field_name})

Related

Suppress blank section

How do I suppress a blank section on my report? I have tried suppressing with
if Count({MyVariable}) > 0 then false else true
and
IF {OnLastRecord} = "" AND pagenumber=TotalPageCount
THEN TRUE
ELSE FALSE
What am I missing? It is hiding the data but not the header. Another table is hiding the data and that is a very long Subreport that should be hidden if there is no value.
It almost seems like this is a bug. I've tried suppressing everything. Shouldn't suppress blank section work?
To suppress a blank section check the Suppress Blank Section. This just works.
If you want to suppress a section that contains a sub-report that seems to be empty, there are several places you can check:
make sure Suppress Blank Section is checked for the section that contains only your subreport (otherwise it wont be an empty section)
make sure Suppress Blank Subreport is checked in the Subreport section of Format Editor of the subreport
within the subreport (open the subreport to edit, double click from your main report) go to File | Report Options and check Suppress printing if no records. This will suppress your subreport when there are no records - even if you have static elements, like text in the subreport header etc.
I had this problem the issue was the section had a box in it so was never blank. I found it worked if I put the formula in the "Suppress (No Drill-Down)" option for the section instead of in the "Suppress Blank Section" option.

Crystal Reports XI, disappearing field with zero balance

I have crystal reports XI, I am new to crystal reports and am not tech savvy, so please consider that in your reply. There is a section that does not populate at all when the value is zero. The whole section disappears on the generated reports. I need the section to show and I need the zero value to show. Any suggestions?
do a right click on that section(where the section name is), go to section expert and on the common tab see if you have something under Suppress(No drill-down) X-2 button(might be red). There should be a condition that is suppressing the section when the field takes 0 value. You can suppress that condition putting // in-front on it or just delete it. You may also check if Suppress Blank Section is checked, if so remove the check mark.

In Crystal Reports, how do I Suppress a Text Object if any row contains a certain value

In my report, I want to display a warning text object in the report header if a column value in any row contains a certain value.
"Warning, this report has problems"
How to I construct a suppression formula for the text object to accomplish this?
If there is some other way to hide/display it, that would be fine also.
How to I construct a suppression formula for the text object to accomplish this?
Right click the text object
Go to Common Tab
There is a Suppress checkbox to the right if it there is a button with a x2, click this button
In the formula editor write a formula that returns true if this "certain value" is in the row or false otherwise
Let's assume you are interested in the ocurrence of value "WarningValue" in the column "MyColumn" in the table "Result".
First, create a formula. Let's call it "MyFormula". It should be like this:
if not isnull({Result.MyColumn}) and {Result.MyColumn} = "WarningValue" then 1 else 0
Then put this formula in details session. You can suppress it.
Then click on the report header using the right button. In the context menu, select "insert section below". Put a text box with the message "Warning, this report has problems" inside this new section. Click in this section using the right button and select "section expert" in the context menu. Put the following formula in the "suppress" option:
sum({#MyFormula}) < 1
So if the report count at least 1 occurrence of the "WarningValue", it will not suppress that message.
Nick nailed it, but he left out one step.
Right-click the text object
Select "Format Text...", which opens the "Format Editor" dialog.
In the "Format Editor" dialog, go to Common Tab.
There is a Suppress checkbox. To the right [o]f it, there is a button with a x2. Click this button
In the formula editor, write a formula that returns true if this "certain value" is in the row, or false otherwise

How to remove comma from crystal report string and from integer field

How can I remove the comma (,) from crystal report fields?
I have a field name "year" which is having a value of 2012, but when I show that value in crystal report it includes a comma, becoming 2,012.
How can I show only 2012?
In the crystal report designer view:
Right mouse click on that field, and select Format object. Select Custom Style in the Style list, and click Customize. Untick Thousands Separator, and any other unwanted formatting.
Failing that, you could try selecting the field and deleting the "," value from the property ThousandSeperator in your properties window.
try this
for formula
ToText( ToNumber({variable1}), "#" )
Try below code,
Replace (ToText ({Tablename.Year_Field}, 0),"," ,"" )
I'm just guessing but I believe you have embedded your field name into another object such as a text field.
If this is the case, double click your text box in the design view, then select your text field you are having issues with. Right click and select "Text Formatting", under the Font tab click the 'Format Formula Editor' button (the one with the X-2) to the right of the Font drop down menu. Now all you have to do is close the formula editor, then cancel the Text Format window. NOW when you right click on your year field again you will have a new option to Format the field which was previously grayed out.
Alternatively, you can remove your year field from any other object it is nested in. This will give you access to all formatting options.
NumberVar cRed;
ToText (cRed,"#")
OR
ToText({some numeric field value},"#")
The "#" has to be enclosed in parenthesis, single or double.

How to skip blank pages in the report?

Using Crystal Report 8.5
How to skip blank pages?
I want to skip blank pages or blank field?
Need Formula Help.
You can check the check box in the Section Expert that says "Suppress Blank Section" to suppress the entire section
To suppress a field you can right click on the field and click Format Field and press the formula button (x+2) next to the suppress check box on the common tab and then enter your formula to use as the suppression logic. To this simply put in a function that would return a boolean value where a returned value of true would suppress the field and false would show the field. Remember that you don't need to check the suppress check box if you have a formula entered. Hope this helps.