How to display group SL number in group header section on Crystal Report - header

I have a report where I need to add a serial number for Group Title.
I require to generate this number in the report; let us consider it as Group Number (as we do Row Number in the detail section)

There's a built-in function that returns the current group's number. So you could just create a formula field with it:
GroupNumber
and place the formula field in your group header.

Related

How to Sum and Mulitply row of Specific Column in SQl Server

I have database with table units with column name Transformertype and Transformeramount and section.
I want to first multiply Transformertype and Transformeramount and then add them but only where Section column contain specific type of value like 'Pattika', 'Baheri' and 'Kahori'. and then display it into label.
My Query is
select
SUM(TransformerType*TransformerAmount)
from
units
where
(Section LIKE'%Pattika%')
And
(Section LIKE '%Baheri%' )
And
(Section LIKE '%Kahori%')
But this query not showing any result into my label. Help Require
SUM is an aggregate function. It will sum the total for each group.
I don't know if I understand 100% your query, but please comment here and I will glad to update my answer:
select
SUM(TransformerType*TransformerAmount),
section,
COUNT(*) as TotalSection
from
units
where
(Section LIKE'%Pattika%')
OR
(Section LIKE '%Baheri%' )
OR
(Section LIKE '%Kahori%')
GROUP BY Section

Serial Numbering an SSRS Table with Grouping And Headers

[Report Design]
Here is an Example for a report that I am working on.
It is grouped by "CostCenter" Field and above each group there is a header with the SUM of the "Betrag" Field.
I want to Number each Column in the Table with the Headers as well.
I tried using RowNumber(Nothing) or Row Number("DataSet") Or Running Value.
I get these results [Report View]
I think there should be a way or a Formula that connects both Fields in the Colmun Row Number or "Zeilennr" that results with a Correct Row Numbering for each Row
You can almost do this. The number would not work if placed to the left of the inner group, it needs to be at the same level as the details group but it will give you the correct number. I've only done very limited testing but it seems to work.
Go to the report's properties and then to the code tab.
Now add the following custom code function
Public rn as Integer
Public Function GetRn() AS Integer
rn = rn +1
return rn
End Function
Now in the text box where you want the number to appear use the expression
=Code.GetRn
All this does in increment the public variable by 1 then return it. It has no concept of the row it lies on, so if you did not include this on a group row, the numbers would remain sequential.
Here is a demo based on a small test report I had..
Design showing the position of the expression
Gives this result
Add the same expression to more text boxes...
Give these results...

SQL custom grouping expression based on the field value string Microsoft Visual Studio

I am having a table in BIDS with three columns (e.g. Team, Product Name, Count).
For the Column Product name, I want to apply grouping, that will check for particular string "laptop" and sum all the Product Names containing string "laptop" under Laptops. Values in Product Name may vary, but there is a certain pattern like XX.Laptop.1, YY.Laptop.2 and mix of combinations to laptop.
I need something that will render full list, but add a group over Tablix Group with use of custom expression =IIF(Fields!Product_Name.Value)LIKE "laptop", "Laptops")
Please kindly advice. Thank you
Much thanks Alejandro! here is the result I got after applying your suggestion.
RESULT
I need two additional questions:
If there is a second group I would like to use for grouping - how to add it? (eg. desktops)
How to add a sumary value for the group? Shall it be done over exprerssion?
Thank you
Try using this expression for setting the group by Product Name and to show the Product Name in the respective cell.
=IIF(InStr(Fields!Product_Name.Value,"laptop") > 0,"Laptops",Fields!Product_Name.Value)
If for a specific row the Product Name contains laptop it will group on "Laptops" otherwise it will group by the Product Name value for that row.
UPDATE: If you want to check for another word to create an additional group you can use:
=Switch(
InStr(Fields!Product_Name.Value,"laptop") > 0,"Laptop",
InStr(Fields!Product_Name.Value,"desktop") > 0,"Desktop",
true,Fields!Product_Name.Value
)
Let me know if this helps.

crystal reports top 1 for group

Hi I am trying to return the record with the highest date for each inidivdual in a database. The fields I am working with are {Entity.TaxID} which is the unique identifer for each individual. Each individual has multiple records and I am trying to show only the record with the largest {Tran.IssueDate}.
Does anyone know how to return only the largest {Tran.IssueDate} for a group of {Entity.TaxID}? Thanks
Create a group with {Entity.TaxID}.
Place the {Tran.IssueDate} in detail.
In group footer take Maximum {Tran.IssueDate}
To take maximum.
Right click on `{Tran.IssueDate}` and go to `Insert summary`... there take maximum.

How to aggregate details in Pentaho Report Designer (PRD) 3.9?

Very new to Pentaho Reporting,
I have a query grabbing columns categories, quantity, and gross. It returns about 200 rows.
Without changing the query, is there a way for the report to display the aggregates for each category (I have category as a group)? For example, All you can eat should only display a sum of the Amount and GrossValue columns.
Same for dessert (notice there are two group headers - why?)
You just need to get used to with pentaho report designer.
Refer information given at the end of this page simple report.
You can add one parameter in group footer and set its properties.
They provides properties like aggregation-type, which can be set as Sum or count and then it will show at the end of each group with sum or count of the rows as per the type you specified.