So I have a report that has 2 details sections - a main details section (Details a) and a secondary details section (Details b). Details a should always be displayed and works fine.
However, Details b contains a few static text objects, a few line objects and one Formula Field which can be either "" (empty string) or have text in it.
If the Formula Field has text in it (i.e., != "") then I want the Details b section to be shown and if it is == "" then I want the entire Details b section to be suppressed.
I have added the following formula to the Details b Section Expert - {#CageCardNumbersConditional} = "" so that if the Formula Field is an empty string it SHOULD suppress the section but the section shows up whether the Formula Field has text in it or not. Also, I have tried checking the "Suppress Blank Section" checkbox and tried NOT checking the checkbox...both ways the section still shows up.
So I have tested the report with text in the Formula Field and without text in the Formula Field, with the "Suppress Blank Section" checkbox checked and with it unchecked, with the {#CageCardNumbersConditional} = "" formula and with the
`If {#CageCardNumbersConditional} = ""Then
true
Else
false;`
formula, and I have even removed all of the text objects and line objects from the section just to make sure that it wasn't them keeping the section from being suppressed...but in EVERY test the section is NOT being suppressed.
Any suggestions with what I'm missing?
Thanks, George
This is dependent on what, exactly, {#CageCardNumbersConditional} is doing, but try isnull({#CageCardNumbersConditional}) instead of {#CageCardNumbersConditional}="". It's possible {#CageCardNumbersConditional} is not doing what you think and is instead returning a null instead of the empty string, which are both distinct in CR.
Related
How do you suppress a text object in Crystal if a summarize field inside the text object is equal to 0?
Example of text object content:
I want the text object to only display when {Sum of RETOUR_INVOICE_LINE.AMOUNT_EUR} is zero.
It seems I can't select a summary field in the suppress formula editor.
Create a bool formula to be true or false using an if statement in the formula, then you can drop the new formula into the suppression for the field in question.
So a formula similar to this, lets call it fBool_IsZero
if {Sum of RETOUR_INVOICE_LINE.AMOUNT_EUR} = 0 then True else False
Then use fBool_IsZero in the suppression shown in your question.
As shown below, I have a value that I wish to include in group header 1 but suppress from being displayed in Group Header 2.
Is this possible?
As shown above the Group header #2 SAM includes a value that is suppressed in the report, but shown in the group header #1. However, I also need to group by SAM and the grouping column is shown in the report with suppressed values.
(shown below as Q1 Target)
Can I suppress 'BUDGET SAM' from appearing on the report, but still include the underlying value that accompanies it, so I can get the sum of its values and show it in my group header #1 (as q1 targets)
To give you an idea of the underlying data:
To detail what I have already tried:
Suppress formula on Group#2 SAM when it equals 'BUDGET SAM'
Selection expert to remove 'BUDGET SAM'
Both of which resulted in Q1 target appearing with zero sums.
Edit:
My Suppression formula (which did not give me the correct results)
IF {Command.SAM} = "Budget SAM" THEN TRUE
ELSE FALSE
Go to Section Expert Click on Group Header 2 or which you want to suppressed on that window, and then click Suppress Formula button and then write the formula like below:
GroupName ({DataSetName.SAM}) = 'BUDGET SAM';
and then click OK and its done.
I have a report having a section.Now i want to know whether the section got suppressed or not based on the logic i gave.
I just want show a message true when the section is suppressed false when it is not suppressed.
Please suggest how to do
Instead of suppress formula in section, add supress condition on each column present in the section. Then add one more formula in the same section which will print "true" or "false" based on your provided conditional logic. To that formula add suppress condition with logic exactly opposite to other columns suppress condition logic. I hope this helps.
Pratik is right in that you can't suppress a whole section and then have a true or false show up in it. Depending on how many sections (groups) you have, you can put your true/false logik in the group header (if you don't have one, create one) and then suppress the detail section which has your columns in it. That would be a little less work then having to suppress every field in the section.
Hope that helps,
Chris
I have a Crystal Report where I want to display only the first ItemNum row.
I used the following expression (?) to suppress subsequent records.
Previous ({ItemHistory.ItemNum}) = ({ItemHistory.ItemNum})
My problem is that when I use a parameter selecting only one ItemNum, the same ItemNum on the second page which I want to appear (because it belongs to a different storeroom) will also be suppressed.
I figured it out. I just added check to make sure supression of the ItemNum on the next page (new storeroom) is not performed.
Previous ({ItemHistory.ItemNum}) =
{ItemHistory.ItemNum}
and
Previous({ITEMHISTORY.STOREROOM}) =
{ITEMHISTORY.STOREROOM}
I have a fairly simple subreport that I want to suppress when there are no records selected for it. The problem is that I have a header and footer section of this subreport with static elements in it (text boxes, lines, etc.). I have set the section containing the subreport, the subreport itself and the sections within the subreport to all be surpressed when there are no records. Yet, the subreport shows up anyway. The data section with no data is indeed suppressed but the headers and footers seem to keep the subreport visible.
Any ideas? Oh, I'm running Crystal-Reports 2011. Thanks!
I just ran into this myself in CR2008. Here are the steps I did to make this work:
Go into your subreport (by that I mean have it open in its own designer window) -> go into 'Report Options' under the 'File' menu -> select 'Suppress printing if no records'
Now go back into your main report. Right-click on the subreport -> go to 'Format Subreport' -> hit the 'Subreport' tab -> check the 'Suppress Blank Subreport' checkbox.
If the subreport is the only thing in the main report section, go into that section in the 'Section Editor' by right-clicking on it -> check the 'Suppress Blank Section' checkbox.
EDIT: If your subreport does return records but it is just that none are displayed then try using shared variables. To do this you need to consider the logic you're using to display the records in the subreport in the first place. This is likely whatever logic found in the detail section suppression formula, but it will depend heavily on the format of your particular subreport.
Now, initialize a shared numbervar in your subreport's report header and then increment it each time a row is displayed using the aforementioned logic.
Back in your main report, you may be able to check the value of that variable to conditionally suppress the subreport's section. I say "may" because CR may not evaluate the subreport's variables prior to looking at the suppression formula, but give it a whirl. You'll want to use the whileprintingrecords; keyword in your section suppression formula to delay its evaluation. Good luck!
Have you tried using suppress formula?
Right click Format Field > Check Suppress > click Edit formula [x-2] button
Hard to follow everything in the post but if data is running into each other, then add a section and place your sub report in the section and make sure can grow is checked off.
If you have static data that you want to show, then you may want to create 2 sub reports, one with the static data and one with the dynamic data and suppress if blank.
Put subReport in a Section, then Right click on Section=> Section Expert
Then check true 'Supress Blank Section' in the common tab as mentioned in below picture.