RDL report - Row Group without a Group expression - reporting-services

I'm working on converting an RDL report to an RDLC. The RDL contains a row group. However, the row group doesn't appear to actually be grouping on a field.
As seen here, a group expression doesn't appear to be specified.
However, in the Sorting tab, there's a "Sort by" specification, shown here.
Looking at the XML in the RDL file, here's the row group:
<TablixMember>
<Group Name="table8_Details_Group">
<DataElementName>Detail</DataElementName>
</Group>
<SortExpressions>
<SortExpression>
<Value>=Fields!Dated.Value</Value>
</SortExpression>
</SortExpressions>
<TablixMembers>
<TablixMember />
</TablixMembers>
<DataElementName>Detail_Collection</DataElementName>
<DataElementOutput>Output</DataElementOutput>
<KeepTogether>true</KeepTogether>
</TablixMember>
So, my question is: Why would a row group be added to a report, which doesn't group rows on a field? It appears that the only purpose of this row group is to sort rows based off of the "Dated" field. Am I missing something? It strikes me as odd that a "row group" would be added to a report, which doesn't group any rows, and only sorts them.

This is normal. Even the detail row of a report tablix has a group associated with it. It just doesn't group anything. If you change that, the display of the details will be affected, and probably not in the way you want, either.
The sort setting is just that, it tells the report how to sort the detail rows. There is nothing wrong here.

Related

Why is an existing field that has not changed be suddenly considered to have an invalid data type?

I am modifying a legacy SSRS report (rdl file); I've added four columns to it, and am supplying those values by means of a new data source (Stored Procedure).
However, now when I try to run the report via the "Preview" tab, I get:
An error occured during local report processing.
The Group expression used in grouping 'table1_Group1' returned a data type that is not valid.
" [ a second err msg identical to the one above ] "
There is indeed a Row Group named "table1_Group1", and its properties look like this:
I don't know why NewBiz is suddenly a problem; nothing has changed about it, and there was no complaint concerning it previously.
"NewBiz" does (still) appear in the filed list in the "Dataset Properties" pane (both Field Name and Field Source are "NewBiz"); the data source (stored proc) does return it. So...?!?
NOTE: The "table1_Details_Group" beneath "table1_Group1" has no Group Expression, and thus seems to have no raison d'etre; unless I'm misunderstanding something about its role/purpose.
UPDATE
Alan Schofield raised the question over whether the dataset fields "are in the order expected."
So I examined that under a fine-toothed microscope. This is the last part of the data source/stored procedure, which returns the values:
select CY.CSDirector, CY.Category, CY.Segment, CY._Unit,
CU.New, CU.Assumed, CU.Existing, CU.Organic,
CY.NumUnits, CY.NumUnitsLast, CY.MonthSales, CY.MonthSalesLast,
CY.MonthPerc, CY.YTDSales, CY.YTDSalesLast, CY.YTDPerc,
CY.ProjSales, CY.YTDProjSales, CY.YTDBudgetPerc, CY.NewBiz
from #CombinedYears CY
left join #CategorizedUnits CU on CU.Unit = CY._Unit
And this is what I see in the Report Data pane for the data surce:
So the first possible discrepency is in that "_Unit" is seen as "ID_Unit" for some reason in the Dataset. Why would that be? Does SSRS automatically convert "" to "ID"? If this is a known gotcha, it is as yet unkown to me.
After that all Dallas breaks loose, as the order of fields diverge radically. Why? Shouldn't the Refresh have ordered them alike? How can I get them to straighten up and fly right, or manually change the order so that they match?
NOTE: I'm not sure if this should even matter - should it? Are the field values populated based on position rather than by field name? IOW, must they match up, positionally?
UPDATE 2
This woke me up to the fact that there are up/down arrows; I'll try that...
UPDATE 3
I changed the order of the fields in the list to match those returned from the stored procedure, but it made no difference - I still get the same err msg when I try to generate the report.
UPDATE 4
In the rdl file the group expression that is supposedly problematic is this:
<TablixRowHierarchy>
<TablixMembers>
<TablixMember>
<KeepWithGroup>After</KeepWithGroup>
<RepeatOnNewPage>true</RepeatOnNewPage>
<KeepTogether>true</KeepTogether>
</TablixMember>
<TablixMember>
<Group Name="table1_Group1">
<GroupExpressions>
<GroupExpression>=Fields!NewBiz.Value</GroupExpression>
</GroupExpressions>
</Group>
<TablixMembers>
<TablixMember>
<KeepWithGroup>After</KeepWithGroup>
<KeepTogether>true</KeepTogether>
</TablixMember>
<TablixMember>
<Group Name="table1_Details_Group">
<DataElementName>Detail</DataElementName>
</Group>
<TablixMembers>
<TablixMember />
</TablixMembers>
<DataElementName>Detail_Collection</DataElementName>
<DataElementOutput>Output</DataElementOutput>
<KeepTogether>true</KeepTogether>
</TablixMember>
<TablixMember>
<KeepWithGroup>Before</KeepWithGroup>
<KeepTogether>true</KeepTogether>
</TablixMember>
</TablixMembers>
</TablixMember>
<TablixMember>
<KeepWithGroup>Before</KeepWithGroup>
<KeepTogether>true</KeepTogether>
</TablixMember>
</TablixMembers>
</TablixRowHierarchy>
...to be more specific, this:
<Group Name="table1_Group1">
<GroupExpressions>
<GroupExpression>=Fields!NewBiz.Value</GroupExpression>
</GroupExpressions>
</Group>
Why would that be a problem? NewBiz is a value contained in the result set, and it has two values by which it could be grouped (-1, signifying "New", and 0, signifying "Existing").
So why the err msg?
That field itself is represented in the rdl file like so:
<Field Name="NewBiz">
<DataField>NewBiz</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
UPDATE 5
And now it's working, with now change to the code...this happens too often with this old technology, and I don't know whether to be more relieved or irritated when something that doesn't work all of a sudden starts working WITH NO CODE CHANGES. Why!?? Arghhhh!!! Gleeeep!!! (that last was a happy sound, more-or-less equating to the polar opposite of argh).
I had a similar problem. I had a chart being fed by a 3-column query, one of which was an aggregate (ID Code, Sum(Count), and Day - in that order). What I did to fix it was to put the field I was grouping by earlier in my query (i.e. Day, ID Code, and Sum(Count)), that seemed to do the trick. It seems kind of stupid... but there it is.

Remove empty values from CSV in Reporting services

how i can remove empty value when i export my SSRS report into CSv format.
For example i got
PlayerId,F1,F2,Date,F3,F4
,,,,,
when my report is empty and i exported it to csv format
MyReport
Try to manipulate with visibility of rows. I reproduced your issue and solved it hiding rows if there is no data.
Right-click on row handle and select Row visibility:
and then set expression for Hidden property:
=Fields!PlayerId.IsMissing
Then, if value for this field will be missing, whole row will be hidden. If you need, you can make more complex expression, checking additional fields. If you need to hide rows only when exporting to CSV, you can do this:
=Globals!RenderFormat.Name = "CSV" And Fields!OrderId.IsMissing
In case of your file the element
<TablixMember>
<Group Name="Details" />
</TablixMember>
should be
<TablixMember>
<Group Name="Details" />
<Visibility>
<Hidden>=Fields!PlayerId.IsMissing</Hidden>
</Visibility>
</TablixMember>

SSRS Report Multiple Pages Tablix Order

I'm using ReportingService 2010 and im trying to get multiple reports into one file on sperate pages. The problem is the order of the pages.
At this point I have a table for each of my datasets on seperate pages. Export to Excel works great, but the order of the pages (Web View and Excel Worksheets) doesn't match the order of my Tablix elements of the rdl file.
Setup is like:
..
<DataSets>
Dataset Name="A"
Dataset Name="B"
Dataset Name="C"
</DataSets>
..
<ReportItems>
<Tablix Name="A_Tablix">...<PageBreak><BreakLocation>End</BreakLocation></PageBreak></Tablix>
<Tablix Name="B_Tablix">...<PageBreak><BreakLocation>End</BreakLocation></PageBreak></Tablix>
<Tablix Name="C_Tablix">...<PageBreak><BreakLocation>End</BreakLocation></PageBreak></Tablix>
</ReportItems>
...
But the pages seem to appear like random, and not in the order of the rdl file. Is there any element I'm missing? Or how do I have to order the Tablix elements of the code to get the same order in the Web View and Excel Worksheets?
I found the answer, after some experimentation...
The problem was, that the Tablix were overlapping. They started at Top 0 and Left 0. It works as expected, after I added an offset according to the desired position to the Top value like:
x*Height of Tablix

SSRS group header shows on all but last page

I have had some trouble getting group headers to show on each page, but the steps to achieve this are well documented on here and elsewhere online, but I have a new problem.
I have a group header that appears on each page except for the last one.
My report is set like this-
<group on IDs>
<group on description>
<group on desc_num>
<static>
<static>
<static>
<group on other>
<static> -- this is my header causing trouble
<group on other_num>
<static>
in my dataset query, i have something like this:
Select 'Description', ROWNUM desc_num, x,y,z, null null etc...
UNION
Select null null null null etc... 'Other', ROWNUM other_num, a, b, c
In my report, i use the group by description to group together all from the first part of the query, and then i group by desc_num so that i can do a keep together so my static rows stay together. I do the same for other.
Each ID can have many descriptions each containing multiple groups of details. They can also have many "others" containing multiple groups of details. The description and other groups can contain several pages worth of data.
For my heading for the other group, I have the advanced properties set to True, After, True for KeepTogether, KeepWithGroup, and RepeatOnNewPage which allows it to show on each page of the other groups.
This works perfectly, except that the other header will not appear on the last page. For one specific id, there are 3.5 pages of "description" group, followed immediately (no page break) by 6 pages of "other" group. The word "Other" shows appropriately at the beginning of the other group halfway down page 4 and at the top of each following page except for on page 10, which only contains a half page.
This header has similar result when there are less pages, it always does not show on the last full page of "Other" group members.
If anyone has any ideas or advice for this, i would greatly appreciate it.

How to create totals row for grouped columns

If have an rdlc-report with grouped columns within a tablix (table). I want to add a footer row that spans all dynamically created columns and shows a total for all columns together.
How can I tell to a cell that it should span all created columns created by the group?
|-------|-------|-------|
| col 1 | col 2 | col 3 |
|-------|-------|-------|
| Column-Group Total |
|-----------------------|
Please note, calculating the total is not my problem. I'm only searching for a way to tell report viewer to merge cells that are created automatically through a column-group for a specific row.
Update
Sadly, up to now, I have not found a solution to this. Moreover the same question I also have encountered in a report where I had to add totals of a row-group in a merged column.
|------|-------|
|row 1 | |
|------| Row- |
|row 2 | Group |
|------| Total |
|row 3 | |
|------|-------|
I find this a quite common way of showing totals. Is this not possible in either way or am I missing something obvious?
Update2
Here a screenshot of what I mean:
In the middle there is a group. This creates at runtime n columns. What I want to do is the "spanning category total" to span all dynamically created columns. This means, that the columspan of the cell is n. There is only one cell and in this cell I will show the total of all categories. It's quasi the same as report viewer creates automatically at the top of the group.
Don't know if you've found an answer to this, yet, but if not...
Usually, totals are expected in the last column for data grouped in columns and the last row for data grouped in rows...
However, depending on the scope, and the level of grouping you have, you might be able to achieve what you want by embedding your tablix into an outer tablix, and then adding a row to the outer tablix that sums the data there.
I have used multiple data regions within rectangles and lists to manipulate all kinds of layouts. You just have to play around with scopes, and possibly adjust your output data (sums/averages by groups in stored procedure) if those scopes just aren't cooperating. Let me know if it solves your problem.
As I know, rdlc are report files you edit on Report Wizard or visual studio as opposed as rdl that are report files being developed on BIDS.
I don't know if this will work on rdlc files because I only use BIDS, but I think its worth the try:
on the row groups tab (botton left) right click on your group and
select add total -> after, it will add a total row.
temporarily copy the sum cell (the total) to some other place on the
report (because the next step would erase it if you dont)
using SHIFT, select cell by cell on the row you want to merge (don't
select the row itself)
right click it and select merge cells
paste the sum cell you copied away on step 2
Result (I hope you can see):
EDIT:
answering your question, yes I'm sure it can be done because I did it several times and also you saw on the print screen.
I'm pasting the XML for my row, I think the secret is on the <ColSpan>8</ColSpan> tag. I do have 8 columns on my report.
<TablixRow>
<Height>0.25in</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Textbox Name="textbox18">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Sum(Fields!myField.Value)</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>9pt</FontSize>
<Format>'$'#,0.00;('$'#,0.00)</Format>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>textbox16</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>White</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<ColSpan>8</ColSpan>
<rd:Selected>true</rd:Selected>
</CellContents>
</TablixCell>
<TablixCell />
<TablixCell />
<TablixCell />
<TablixCell />
<TablixCell />
<TablixCell />
<TablixCell />
</TablixCells>
</TablixRow>
Since it looks like you have a dynamic column group, you will probably put into the columns:
Fields!ColHeading.Value |Total
Fields!DataValue.Value | =SUM(Fields!DataValue.Value)
If you prefer the graphical interface, right click on the total's value field and click on Expression. In the popup, expand the Common Functions and click on Aggregate and in the Item window, double click on Sum. Type in or click the data field and you will get something like this:.
Hit Ok, and you are good to go!