Is this possible? how else can I achieve what I want if it's not?
My report has 3 groups, I want to display the count of records in my details section and it should consider the groups. I created a count formula like Count({FieldToCount},{GroupField1}), this works fine but it only considers 1 group while I have 3.
Related
I am writing a report on Crystal Reports 2013. I'm doing multiple groupings on the report and basically, I want a field to be displayed on the first instance of the second group.
Below illustrates what I'm trying to do:
Group 1 a
Group 2 a
Display
Group 2 b
Not Display
Group 2 c
Not Display
Group 1 b
Group 2 a
Display
Group 2 b
Not Display
etc…
Any ideas on how this can be done?
Put this in the suppresion-formula of the field
(Replace {Table.FirstGroupCol} with the column you used to group Group1:
Not (OnFirstRecord Or (Previous({Table.FirstGroupCol})<>{Table.FirstGroupCol}))
This will only display the field on the first record or if the previous value of the column used for Group 1 is different from the current one.
What I would like to do is either suppress a group or (if possible) write this in to a selection record.
The goal would be to display all records in the group if any one of the records in the group meet the requirements.
For example if my group has three records and my requirement is that one of the records have a specific value in one field. Then display all three records in that group. Otherwise, if none of the three have that value then suppress the group.
I know where I need to put the formula and I thought the following would work but instead it only gave me the records that met the requirement not the others that accompany it.
Placed in the suppress group formula field:
if {table.field} <> "1" then true else false
Any thoughts on this?
Looks like I got it figured out. Here's what I did:
Create a Formula Field to check if the value exists in the record as follows:
if {table.field} = "X" then 1
Create a Summary Field of the formula field just created and sum the total for the formula field effectively counting how many records in that group have the value sought after.
Go to Section Expert for the desired group and Suppress using the following formula.
if Sum ({#Formula}, {table.field_2}) < 1 then true
I have a crystal report in C# windows application.
Three groups are there in the report.
I need to display count for each group.
For Eg:
1. Group1.1
1. Group2.1
1. Group3.1
1.ItemDetails1
2.ItemDetails2
2. Group3.2
1.ItemDetails3
2.ItemDetails4
2. Group 2.2
1. Group3.3
1.ItemDetails5
2.ItemDetails6
2. Group3.4
1.ItemDetails7
2.ItemDetails8
2.Group1.2
like this?
I tried running total,
Field To Summarize as Group1 field,
Type as distinct count
Evaluate- for each record
Reset- On change of group
but its showing 1 everywhere.
Can anyone help?
Try Never Reset. When you reset using the field that you count, you will always get an answer of one.
I am facing formatting problem in generating SSRS report. I am having two groups in my report, one group is on list and other on tablix.
The first group with list contains only a textbox which display say AccountNo, while the other group has the entire table which displays the account details (AcctNo, AcctName, Type etc.).
I want to merge this two groups together, such that on each page I can see the both the groups, i.e., textbox the one with AcctNo and other with the table with acct details.
I am getting the first group on different page followed by the other group.
Can anyone suggests me how to merge these two group together on one page?
if possible in the table, the easiest way would be to create a parent group for the two groups, so both groups would have the same parent group
I want to create multiple groups in ireport, and the data should display in a group-wise manner.For Eg:
First the Group1 data should be printed completely, then,
Group1:
Module Data
After this i want to print the Group2 data completely
Group2:
Category data
I am using the Result Set datasource.
Can Someone help me in this?
Jasper reports will work exactly in this manner as long as your query results are ordered properly.
For example, let's say you are grouping by a field called "MY_GROUP" and it has values "GROUP A" and "GROUP B". In your report you will create a group for field "MY_GROUP". In your query, make sure you have MY_GROUP as the first field in your ORDER BY clause. You can also accomplish this in iReports by adding the "MY_GROUP" field as your the first field in the Sort Options section of the Report query.
Now that you have added your group and are ordering properly your results will come out like this:
Header - GROUP A
Detail - GROUP A
Footer - GROUP A
Header - GROUP B
Detail - GROUP B
Footer - GROUP B
Exactly as you wish. My guess is that you were not properly ordering your query results. This could result in having multiple groupings for GROUP A, GROUP B, etc. all interspersed.
If groups in iReport don't keep all the data together, use subreports. When Jasper gets to a subreport, it runs the whole subreport and puts the whole thing into the report. You could have something like:
Subreport 1 - Group 1
Group 1 first record
Group 1 second record
Group 1 third record
...
Group 1 last record
Subreport 2 - Group 2
Group 2 first record
Group 2 second record
Group 2 third record
...
Group 2 third record
It's exactly as Tom said. Jasper Reports Groups do not order the data retrieved from the query, they just take it in the order it comes.
In order to display the information in a group-wise manner, you have to add an ORDER BY to the query so the rows the report receives are already ordered.
So there is an issue that happens when you use multiple group headers. The first header behaves like expected ordered by Column Value A only on unique values. The 2nd header using Column Value B will print on every row despite being non-unique values.
In theory you should be able to use ORDER BY:
ORDER BY ValueA, ValueB
to properly display the report assuming you are using sql, plsql, etc... However, in my case that did not happen, though for others it seems to work.
Use subreports to attach the minor differences via unique reports. You create a root report with empty details. Then you create Unique reports to serve as sub reprots. Finally, you use the subreport element to link the values into the root report. Though that is a good bit of work and may cause repeat code.
A hacky way I used was: A mixture of "Print When Expressions" with logical boolean expressions with 2 group headers and a column header.
Boolean Expressions:
$F{QUERY}.equals(Query1) && ($P{P_Typequery}.equalsIgnoreCase("QueryA") && $P{P_parameter} == null)
and
$F{QUERY}.equals(Query1) && ($P{P_Typequery}.equalsIgnoreCase("P_QueryA") && $P{P_parameter} != null)
with two group headers and a column header. The column header will not repeat for every row so you assign one of the booleans expressions to it's "print when" so it does not always print. The first group header will not repeat for every row and works. The 2nd group header is used for the times you DO want it to repeat for every unique value since it always prints for every row, and you use the other boolean on it's "print when". Hope it helps