Grand totals in Telerik Reporting - telerik-reporting

I'm trying to put together what I had thought would be a fairly simple report using Telerik Reporting, and I'm having a problem.
The data source is a DataTable containing outergroupid, innergroupid, number1, and number2, sorted by outergroupid, innergroupid.
I want a report laid out like this:
Outer Group 1
Inner Group 1.1 12 14
Inner Group 1.2 11 17
Outer Group 1 Totals: 23 31
Outer Group 2
Inner Group 2.1 22 24
Inner Group 2.2 21 37
Outer Group 2 Totals: 43 61
Totals: 66 92
And all of this is pretty easy, except the final grand total.
I created a group on outergroupid, and added a header with the id, and a footer with id, "Totals:", and Sum() on the numeric fields, and that handled the subtotals fine.
My problem: if I add a grand totals line in the report footer, I get a page break between the detail and the report footer - which I can't have. I've fiddled with KeepTogether, and it doesn't seem to have made a difference.
My next try was to create a global group within the detail. I'd figured that if I introduced a group with no grouping expression, it's GroupFooter would process after everything. It didn't.
So, what I need is either a way to keep the report footer from breaking onto another page, or a way to create a group that groups on everything.
Any ideas?

Solution 1 (on a 'traditional' report): add a fake group on top the real group. With a condition e.g. like "1=1".
Note: do not use the footer for this.
Solution 2: use a table item (a.k.a crosstab). On a table item, you can easily have totals and grandtotals.
The table item (with its details, totals and grandtotals) will be on the same report's section. E.g. on the report's Detail section.

You must create a report to have 2 grouping ,first you already have , A second is group that upper level than your current group,and then that group you must set data for grouping(fake data column from Databse ) at whole report , at last on report set show group footer then set content you want to.

For easy designing you can use a table object or it applies to normal report too.
Add a row group on the detail section and then add a parent row group of the 1st group by allowing the wizard (if comes any) to add their header and footer rows.
Now after all rows (in detail section) add a new row (for grand total). Any aggregated value added in this new row shall a grand total and will be shown on the same page.

Related

SSRS Report - Badges

Is there an easy way to do a page of badges in an SSRS report? I am looking at 2 across and 3 down per page based on a list. I have built one so far of a single column using a list box but the problem is that it is not advancing to the next record and shows me the same record over and over until I get to the end of the count of total records in the dataset so I know I am doing something wrong. I am using Visual Studio 2017
I use a matrix when I am making a grid with boxes that go across and down.
First I add a ROW_NUMBER to the query to have the order in which to show the records. I subtract 1 so the values start with 0.
SELECT *, ROW_NUMBER()OVER(ORDER BY EFF_DATE) - 1 ROW_NUM
FROM BLAH_BLAH...
Then in SSRS, add 2 Calculated Fields to the dataset with the ROW_NUM.
The first is named ROW. It will have an integer with the row that the record will end up in.
=INT(Fields!ROW_NUM.Value / 2)
The second is COLUMN that will give the a column number.
=Fields!ROW_NUM.Value MOD 2
Then in the matrix, set the grouping based on the calculated fields.
COLUMN GROUP
Group and Sort by COLUMN
ROW GROUP
Group and Sort by ROW
The 2 can be changed to use whatever number of columns is needed.

Calculate Min and Max for aggregation in SSRS report

My SSRS report have a dataset that will return the following result. The result set for some reason may not be changed. Note that Category - SubCategory pair might not be distinct.
Category Sub-Category Value
-----------------------------
A A1 100
A A2 120
A A2 60
B B1 80
B B2 90
B B2 70
I want to show the max value and main value for each of the SUM(category, subCategory) in report matrix, as exactly the format as follows (except the comment in bracket):
Max | 180 (two A-A2 rows)
Min | 80 (B-B1)
How can I define the matrix and write the expression? If make a group on these two columns, The matrix will show four rows regardless of what expression I set.
I tried to run your use case on my local SSRS.
On Left hand side I have original Data and on Right hand side I have the desired result you expect.
What you need is grouping as below
Expression for sum as below
Put a tablix into your report. Then at Row Groups (bottom) click on the (Details) and chose Add Group > Parent Group. Click the Add group header and chose your Sub-Category. Do the same with your Category. Your Row Grouping hierarchy should be now Category > Sub-Category > Details.
Now you see the brackets on the left in your tablix, they indicate the level. If you use now the following expression with their group name on the specific level, you will get what you want.
'At the Category group level header
=Sum(Fields!Value, "CategoryGroupName")
'At the Sub-Category group level header
=Sum(Fields!Value, "SubCategoryGroupName")
I got the way to make it. The solution is as follows:
Make a row parent group called row. Let the group group by a constant.
Make a child group category under the row group which is grouped by Category.
In matrix cell which is inside the group, Add this expression: =Min(Sum(Fields!Value.value), "Category"), "row"). that's the reason why I make a constant group, because I want to make the nested aggregate function legal.
This expression will return all values identical within the Category group. Now add another row outside of these row groups. Pick a cell and enter =ReportItems!ThatTextBox.Value.
Hide the row which consists your groups.
Do the same for MAX value (Start from adding an adjacent group, grouping by constant)

SSRS - how to create a double entry table

I need to create a report which is something similar to a Pivot Table.
The report would be something like below, with more towns
I C S Total
Town1 1 2 3 6
Town2 7 1 1 9
Town3 2 3 1 6
Total 10 6 5 21
In Crystal reports, there is an integrated function called Cross table
(see pictures below)
I'm looking for a similar function in SSRS, if there is any. I parsed the internet but I could not find anything that is relevant
Thanks!
You need a matrix to do so
Select the row, once the matrix created, like the image below and click on the row group and look at the group properties
You then choose the row for which you want to do the grouping like the image below
Repeat the operations for the column group.
You will need to add additional row and columns for the total.
I will do that for the row. You click the row to highlight it and then click on insert rows. You then choose Outside group below like in the picture below
Repeat the operations for the column group.
To have total, please put the following formula in your row and column created outside of the group SUM(COUNT(Fields!name_of_your_field.Value)) and you have the double entry table.
Let me know through the comments if you have any issues, I'll happy to help.

How to add SSRS page break after 65536 rows, counting group header/footer

I have an SSRS report which is failing to export to excel when the row count is greater than the Excel 2003 limit of 65536
The report already has a grouping level with a group footer.
I have tried to add an extra grouping level with a page break on the expression
=ceiling(rownumber(nothing)/65536)
However, this counts the detail rows, but does not take into account the group footer. So the rownumber evaluates to 53000 while the actual number of rows has exceeded 65536.
The following expression
=ceiling(RunningValue(Fields!myfirstgroup.Value, CountDistinct, Nothing) + rownumber(nothing) / 65536 )
will give me the actual row count including the group footers, but SSRS will not allow a group on a running value expression.
How can I force a page break after 65536 rows to allow an export to Excel? I had hoped to accomplish this in the report definition, and avoid adding a calculated page number in the query .
Any help much appreciated
* UPDATE - Sample data *
ItemDescription , Location , Quantity
Red lorry , M25 , 5
Red lorry , M6 , 2
Yellow lorry , M1 , 3
Report has a grouping on ItemDescription with a total for that item, so it will show
ItemDescription , Location , Quantity
Red lorry , M25 , 5
Red lorry , M6 , 2
Total for Red Lorry,7
Yellow lorry , M1 , 3
Total for Yellow Lorry,3
This means from my 3 rows of data, I have 5 report rows including detail and footer rows. SSRS can tell how many details rows are in my dataset, but I need to take the footers into account for a page break.
Hi this link might help you. I had similar sort of issue, a few years back.
SSRS Page break on Tablix with Rownumber ,just one row group and no group expression given by default
=Floor((RowNumber(Nothing)-1)/2000)
was the suggested answer
Create a group with the following expression:
=CInt(Ceiling(RowNumber(nothing)/65000))
The 65000 give you a little extra room for any headers or footers. Next, do a Page Break on this group "Between each instance of a group" and "Also at the end of a group" and you will successfully beat the excel file limit issue.
This is what we normally use without any issue. I don't think any one will notice if you don't specifically use all 65,536 rows.

SSRS - Matrix Column Subtotals

I'm trying to create a report which has some interesting subtotals which I'm struggling with. Here's what I'm looking to create:
Col Group A (Currency)
Col Group B (Branch)
Row Group A (Account Group)
Row Group B (Open/Close Balance) Amount
Here's an example of what my data could look like:
CAD CAD USD
Main Div A Div B
Account Rec Open 100.00 50.00 25.00
Account Rec Close 123.00 50.00 35.00
Account Pay etc
What I'm trying to accomplish is blank columns after each Col Group without any page breaks. In this example after the CAD currency I'd like to have 4 blank columns to make some calculations (in some cases related to another dataset in the report). Is this possible?
Are you just looking to add some more columns to the Currency group, i.e. in the Designer this will look like:
With the end result like:
I've only added two columns here to keep the image from getting too complicated, but you can add as many as you like.
To do this, I just specified that a Group Footer be included when creating the Currency group, then added another column to the right of the footer row that was created.
Is this the sort of thing you're after?