ActiveReports - How to have a SubTotal in the GroupHeader - activereports

I need to have the group's subtotal in the header, rather than in the footer as is most commonly done.
I tried a few different settings for the SummaryRunning and SummaryType properties, but it either shows the same as the first detail row, or it's zero.
Is there a way to do this with these properties?

It should work in the GroupHeader with the exact same properties as you would use for subtotals in the GroupFooter.
ie
SummaryType = SubTotal
SummaryGroup = GroupHeader1
SummaryRunning = None
SummaryFunc = Sum
(replace GroupHeader1 with the name of your GroupHeader)

Related

Suppress value from display but still include in Group Header calculation

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.

Jaspersoft studio calculate variables before detail band

Jaspersoft studio 6.2.
The report below, there are 3 bands: title, detail, and summary. Detail is in the middle. Look at "Activated staff" on the top on title band, it used a variable (activatedstaffcount1) as expression. The variable sum all activated staff counts in the detail. However it shows null. The bottom one is in the summary band and used the same variable but it shows correct number. The middle section is the data (detail band). I want to show aggregated result before the display data(detail band), how can I do it?
Try to set also Evaluation time in the text field which contains that variable to the "Report".
If the text field is outside of the table - try to return value into the parameter back from dataset and display that parameter at the end of report evaluation.

How to sum running total field for each group in crystal report?

i have problem in crystall report,
Here is my code following many reference site in google,
// {#reset}
//place in group header
whileprintingrecords;
global numbervar Sum_Cumm_Sum:=0;
// {#increment}
//place in section detail
whileprintingrecords;
global numbervar Sum_Cumm_Sum:=Sum_Cumm_Sum+{#getIP};
// {#display}
//place in group footer
whileprintingrecords;
global numbervar Sum_Cumm_Sum;
Where getIP is Formula,
{#sumKN}/{#sumSKS}
and code in it is running total field with reset on change group,
{#sumKN} is running total field for field KN
{#sumSKS} = is running total field for field SKS
============================================================
I use all this code, but in Sum_Cumm_Sum:=Sum_Cumm_Sum+{#getIP}, I can't get the right value.
Here is my report view:
http://i.stack.imgur.com/CSmsB.png
To the extent I see as you placed in detail section your formula is working correctly, Now you want to see the summation of values in footer then you need to write saperate formula to sum index.... in footer section so that it sumarizes it saperatley.
Either use a manual running total OR a running-total field, not both. By the way, a running-total field only works in a footer section.
A better approach:
{#sumKN} - field is {table.KN}; summarize for all records; reset after change in group
{#sumSKS} - field is {table.SKS}; summarize for all records; reset after change in group
// place in `footer` section
//{#ratio}
// optional
// EvaluateAfter({#sumKN});
// EvaluateAfter({#sumSKS});
{#sumKN} / {#sumSKS}

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}