How to Remove 「Total」 row in SSRS report? - sql-server

I am new to SSRS.
In report, I have One table layout result where its first row (there is a bug in total) and last row is having total of all the fields. (Like shown in below image)
Given 「Total」 in first row, which I want to remove from the Report simply. I have its source file and I tried already so many ways but I am not getting its solution.
Edited
Design View of the same is here
Row Groups Panel is looking like:
Group Properties:
Expression 1(top left most):
=Iif(Fields!LineCaption.Value="","TOTAL", Fields!DispOrder.Value & ". " & Fields!LineName.Value)
Expression 2(below of top left):
=Iif(Fields!LineCaption.Value=""," ", Fields!AddupInfo.Value)+ " "

Thank you to All Commentators for commenting and giving your precious time in my problem with suggestions.
But I have found my own way solution.
By creating condition on Row_Group Visibility option while it loads the data from server.
As「Total」field was getting calculated in Row_Group only. So in Visibility option, I checked for first Row that "If first row is not Line_Name(My field name) then Hide that Row".
Maybe this is not the accurate answer but this was the only option for me to add.

You can do it via the context menu in the matrix view, not in the "Row Group" are:

Related

Xtrareport DevExpress Keep Table together with the first record

I have some data that I want to be displayed the following way and I cannot find how to do it:
For example this would be the keep together case:
But I don't like that I have a lot of blank spaces when data is too much, so I would like the following to happen if possible.
When the colNames and the first row can fit in the remaining space put them there.
Or if more can fit after the first row, put all of them there and split where it is possible if necessary.
Basically I want a 'Keep together' option for the columns and first row, and everything else can be splitted at any point.
If anyone wants to achieve the same functionality do the following:
Put the table column names inside a GroupHeader and set its GroupUnion property to WithFirstDetail.
Put the table rows in the Detail next to the GroupHeader.
By doing this the WithFirstDetail property, as the name suggests, will try to keep the header with the first record, or move to the next page. Therefore achieving the behavior described above.

Hide Columns Based on parameter value not working in SSRS

I have a SSRS report which have N number of Columns. I need to hide Certain columns based on a parameter "jobcode" . I have tried below expression in Column Visibility Pane,
=iif(Parameters!JobCode.Value=1,"False","True")
While Executing the report I got below Error,
"The Hidden Expression used in the tablix 'Tablix1' returned a
datatype that is not valid"
I have tried like below,
=iif(Parameters!JobCode.Value=1,0,1)
But, got the same error. Can Anyone help me to find out answers for below queries
How to achieve the above requirement in ssrs?
If I need hide column based on multiple parameter values, say 0 and 1, How to do it?
Thanks for the help.
If JobCode = 0 , Show
=IIF(CInt(Fields!JobCode.Value) = 0,true,false)
Try this.
Follow these steps:
Right click in your column>Column Visibility>Show or hide based on an expression
Expression, use that:
=Parameters!parameter_name.Value<>1

SSRS Only repeat some header rows

I have a report in SSRS that starts with three header rows and then has a total row. I want the three header rows to repeat on each page, but not the total row.
For the three header rows, I have their property settings at:
KeepWithGroup - After
RepeatOnNewPage - True
and the total row at:
KeepWithGroup - None
RepeatOnNewPage - False
When trying to preview the report, I get the following error message:
The tablix 'table1' has an invalid TablixMember. The TablixMember must
have the same value set for the RepeatOnNewPage property as those
following or preceding the dynamic TablixMember. (Expected Value:
"True"; Actual Value: "False")
I've experimented with other settings, but I can't seem to get this to work. I have a group and detail set immediately following the total row, which is listed as static in the Row Groups listing. I also have the same total row at the end of the report.
Any help or suggestions would be appreciated.
This is likely a hacky way to deal with it, but I found a solution that worked for me.
I added a hardcoded column to my dataset, and added that value (now present on every row) as the parent group. This allowed me to list global totals at the top of the report without interfering with how SSRS wanted to display the tablix header.
Again - I'm sure this is a contravention of how SSRS is supposed to operate, but it worked perfectly for me in my situation.
It appears that if it is created using a Matrix rather than a Table, you can add a Total Row to your outer group, then use the option "Repeat header columns on each page" in Tablix properties.
See here
My workaround, I have added both the headers ( you can add on the bases of requirement) in first row and then set below properties.
KeepTogether= True,
KeepWithGroup=After,
RepeatOnNewPage= TRUE
Before:
After:

Generate hyperlink from query

My query is not returning the literal cell value, but rather only the visual portion of it.
I've got a google spreadsheet with FirstSheet having my info and then with the use of a query on SecondSheet showing part of the information.
The first column of FirstSheet has a hyperlink for each row in column A such as:
=hyperlink("http://www.google.com/test","My Test")
SecondSheet has a query that pulls that column amongst others such as:
=query('FirstSheet'!A2:C;"select*",0)
The query result only returns the label of the hyperlink but not the link itself or the hyperlink formula. Meaning I see the same text on both sheets but on SecondSheet it's not a link. I hope this makes sense.
I've thought about different ways to accomplish this including some how creating a string from a query to give me what I want, but I'm not sure. Any help would be greatly appreciated.
I solved it by moving the query to B2, selected column A last, putting it into Col C, hid C. I'm then using C with a formula I created in col A and then just pasted that formula down to row 100.
=If (C2="","",hyperlink("http://www.google.com/"&C2,C2))
I would have liked this to be more elegant, but it's good enough for now.

DLookUp behavior in Form_Current with Label Captions

Access 2010 here.
Ok, Dlookups appear behave different based on where they are used. I have this Dlookup
inside a ClockNo_AferUpdate() subroutine that works well on new form entries to change a label's caption to what is found in the "Employees" DB under "EmployeeName" field based on the entered "ClockNo" in a ClockNo combo-box:
Me.LabelName1.Caption = DLookup("[EmployeeName]", "Employees", "[ClockNo] =" & Forms![InspectionEntryForm]!ClockNo)
The Employees database has four fields: AutoNumber-type "ID," Number-type "ClockNo," Text-type "Shift," and Text-type "EmployeeName."
Re-EDIT:
The RowSource for the ClockNo combo box as it sources from the Employees database:
SELECT DISTINCTROW [ClockNo], [EmployeeName] FROM [Employees] ORDER BY [ClockNo];
END Re-EDIT
What I am looking for is the same functionality in Form_Current() so browsing through older entries preserves the Label's caption based on the entered ClockNo. Unfortunately, simply re-using the above Dlookup gives a "Run-time error '3075': Syntax error (missing operator) in query expression '[ClockNo] ='."
Attaching the Dlookup as a control source to a text box does work O.K, but labels seem to be the best use here. I have mucked about with the Criteria section of the Dloopkup for some time without any real success.
End goal is to have a simple label next to a combo box that displays the employee's name based on their current and past ClockNo entries. The name is stored in a separate Employees database alongside their clock number and their shift.
This should be quite simple as both the ClockNo entry and the Label operate on the same form with the same database. Thanks for your input!
You have a combo box named ClockNo with this as its Row Source:
SELECT DISTINCTROW [ClockNo], [EmployeeName]
FROM [Employees]
ORDER BY [ClockNo];
I'm not sure why you want DISTINCTROW there. I would have suspected DISTINCT to be more appropriate. But I don't think it matters.
The important point is that the combo already includes [EmployeeName], so you shouldn't need to use DLookup to fetch [EmployeeName] again. Simply read the value from the second column of the combo's selected row.
Imagine your form includes a text box named txtEmployeeName. In the form's current event, you could do this:
Me.txtEmployeeName = Me.ClockNo.Column(1)
Notice the column index numbers start with 0, so the second column is .Column(1).
And you could do the same thing in the combo's After Update event.
Finally, you wanted to change a label's .Caption, but I showed you how to change a text box's .Value. If you can't make this technique work with the label, just use a text box instead. You can set the text box's Enabled property to No and adjust its other properties so that it is visually indistinguishable from a label.
Another approach could be simpler still. If you want to keep [ClockNo] as the combo's bound value, but are willing to display [EmployeeName] as the combo's selected value, you can set the width of the first column ([ClockNo]) to zero. You would still see both [ClockNo] and [EmployeeName] in the dropdown. If this is acceptable, you wouldn't need to bother with a label or text box.

Resources