Suppress value from display but still include in Group Header calculation - crystal-reports

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.

Related

Flag formula field in Page Header based on results

I am trying to flag a Y or N value in the page header if one or more specific values exist in the report result set. (Located in the details section)
It should check to see if "16" exists in the result set. I tried using a running total in the group footer, then setting the formula field in the header to display Y if the count is > 0. But the field only works on the page which contains the 16 in the details section. So if 16 only appears on Page 2, the Page 1 header will incorrectly say N. The field should be Y if 16 appears on any page.
SQL queries aren't possible in formula fields, so is there some way to make this work without one?
I would place this formula "Has16" in your details section and suppress it:
{Table.Field} = "16"
Then place a second formula in your Page Header:
IF SUM({#Has16}) > 0 THEN "Y" ELSE "N"
This will display correctly even on pages that don't contain a 16.

Crystal Reports - Hide Page Header on First Page

I have a report that needs to show a report header on page 1, and a different header on subsequent pages.
This seems simple enough; if I add pagenumber=1 and goupnumber=1 to the suppress formula for the second header, it will only be shown after the first page. However, the report is also supposed to reset the page count several times in a single group, thus leaving several pages that match those criteria.
Is there another field in Crystal reports that could have a unique value for the first page? Or is there another way I might go about solving this?
You have to specify in the Selection Expert - Suppress Formula the following formula:
PageNumber = 1
In the Supress Formula try this Formula
Drilldowngrouplevel = 1 ;
or
PageNumber=TotalPageCount
You have to specify in the Selection Expert - second header - Suppress Formula the following formula:
PageNumber <> 1

Crystal Reports: Suppression is hiding records on the next page

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}

Suppressing subreport with no data and a header

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.

Crystal Reports section not supressing (CR for VS2008)

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.