I'm new to report builder and I'm trying to something like this:
Part A:
serialNum,serialNum,serialNum,serialNum,serialNum...
Part B
serialNum,serialNum,serialNum,serialNum,serialNum...
.
.
for all the parts in an invoice
Another choice would be in columns
Part A
serialNum serialNum serialNum serialNum serialNum
serialNum serialNum serialNum serialNum serialNum
Does anybody how to achive this or something similar with Report Builder?
Create a tablix (white color) with the a row group on part values with two rows.
On the first row you will display the part value
Create a tablix (blue color) with a column group on serial values. Delete the row group and hide the detail.
Now drag the tablix(blue color) with the column group on the 2nd row of the tablix (white color) with the row group.
Related
In rdl report i am showing total column as sum aggregation, i want to highlighte highest of that total.
This is a generic answer that makes lots of assumptions. As you question does not contain enough info for a definitive answer but hopefully this will give you enough that you resolve your problem.
To recreate this do the following (and then adapt to suit your specific situation)
Create a new report.
Add a datset and use the following query as the dataset query
-- create some sample data
DECLARE #t TABLE(Customer varchar(10), Product varchar(10), Quantity int)
INSERT INTO #t VALUES
('Dave', 'Hammer', 6), ('Dave', 'Saw', 6),('Dave', 'Hammer', 1),
('George', 'Drill', 3),('George', 'Hammer', 6),('George', 'Saw', 6),('George', 'Hammer', 1),
('Mary', 'Drill', 3),('Mary', 'Hammer', 6),
('Jane', 'Saw', 6),('Jane', 'Hammer', 1),('Jane', 'Drill', 3)
-- return the sample data plus a total per customer
SELECT *
, CustomerTotal = SUM(Quantity) OVER(PARTITION BY Customer)
FROM #t
This give use the following results
Next add a Matrix control to the report.
Drag the fields to the matrix as shown here
Customer to "Rows"; Product to "Columns"; Quantity to "Data"
You should now have a matrix with some row and column groups shown underneath.
next we need to add a total column so right-click the "Product" column group select "Add Total => After"
Finally, we need to test if the value in the total column matches the largest CustomerTotal in our dataset. If it does match then change the textbox color property to "Red".
We can use this expression in the textbox color to do this..
=IIF(
Sum(Fields!Quantity.Value) = MAX(Fields!CustomerTotal.Value, "DataSet1"),
"Red",
"Black")
What this does is take the total quantity in the current scope (the entire row) and compare it to the highest CustomerTotal with the scope "Dataset1" which is the entire dataset. If the two match, set the vlue to "Red", else set it to "Black"
With a bit of a tidy-up the final output looks like this.
new to SSRS
I have table with column 1 is Department, and column 2 is The calculation
For example sum of the cost...
I have used the expression below to sum the cost
but I want to exclude the department that are null, but its no joy..
=Sum(IIF(Fields!ReturnOrder.Value = "1" + IsNothing(Fields!Department.Value) = 1, Fields!Cost.Value, 0))
column 1 is still showing the null department. I do not wish to show this...
I just want to have a column 1 showing the department names, that does not show the null rows.. and column 2 sum of cost where return value = 1
please help
To make your expression work the way you have it, you need to change the plus to an AND for logical operations and leave the ISNOTHING as a Boolean (without the = 1):
=Sum(IIF(Fields!ReturnOrder.Value = "1" AND NOT(IsNothing(Fields!Department.Value)), Fields!Cost.Value, 0))
I'm not sure what the ReturnOrder is for but left your condition in.
The expression you are looking for is
=Sum(IIF(Fields!ReturnOrder.Value = "1" AND IsNothing(Fields!Department.Value) = False, Fields!Cost.Value, 0))
Tip: In case your value is decimal instead of 0 use Cdec(0) to avoid errors.
To avoid displaying null departments I would suggest filtering your SQL query.
You can also do it by filtering the tablix
Expression: IsNothing(Fields!Department.Value)
Type: Boolean
Operator: Equal =
Value: False
Doing so will hide Null departments and your expression can be simplified to
=Sum(IIF(Fields!ReturnOrder.Value = "1", Fields!cost.Value, 0))
The best way is to alter your query:
SELECT *
FROM [YourTable]
WHERE [Department] IS NOT NULL;
You can also select the details row, click the Properties tab, and enter a formula in the "Hidden" property
=IIF(IsNothing(Fields!Department.value), True, False)
This says, "if department is null, hide this row, otherwise show it". The first method is better because less data is returned to your report. The second method requires that all rows are returned, and the report has to sort through which ones to show.
Select the detail row (click the three lines), select the Properties tab, and replace "False" with that formula:
I have a Dataset Query in SSRS as follows
SELECT * FROM TableName
WHERE Account_Code LIKE #Department+'%'
This is so that the SSRS report is able to provide a drop-down of specified available departments based on the first letter of the Account Code(s) in the Account_Code table.
I have set the #Department parameter in SSRS Report Builder with specified available values as shown below...
However, I need Department 3 to be based on two criteria (i.e. with an Account_Code beginning with 'C' or 'D'). Entering the expression 'C OR D' in parameter properties does not work. Do I need to re-think the dataset query itself or can this be done in SSRS parameters with just my LIKE #Department clause?
You could set the third value to [c-d]. See the example below.
DECLARE #Department varchar(10)
SET #Department = '[c-D]'
CREATE TABLE #Test (Account_Code char(2))
INSERT INTO #Test(Account_Code) VALUES
('CA'),
('CB'),
('DA'),
('DB'),
('AZ'),
('AY'),
('BZ'),
('BY')
SELECT *
FROM #Test
WHERE Account_Code LIKE #Department + '%'
DROP TABLE #Test
I have a dataset which brings in distinct values of a column 'A' of table 'B' and these form the select values for a parameter 'Param_A'. In addition to this I have a main dataset which brings in data from table 'B' and contains the column 'A' as 'Field_A'.I do not want to alter the main dataset and hence I am using a tablix filter to filter out the result set of the main dataset. The tablix filter is supposed to be performing the below functionality :
Expression:
Fields!Field_A.value in (Parameter!Param_A.value) or Fields!Field_A.value is NUll
Boolean Operator :
"="
Value:
True
But I am unable to use the operator 'in'. It gives me an error.Could you please help me out with this?
I used the 'inStr' Operator which eliminated the possibility of using 'in' operator:
iif(InStr(Join(Parameters!Project.Value,","),Fields!project_name.value)>0,
true,false)
This helped me!
I'm creating a debtor invoicing report which has two parameters.
Parameter 1: This is a single value parameter called #booking_date. I filter the results(main dataset) by adding this into the query as a query parameter.
Eg. WHERE BookingDate = #booking_Date
Parameter 2: This parameter has two specified values - Yes or No. The parameter is called #live_run and the default value is 'No'. Basically, when this parameter has the default value of 'No', it does not limit/effect the results in any way. On the other hand, when this parameter has a value of 'Yes', it should limit the results by only displaying the bookings where the invoice has been paid off. There is a field I can use for this called Booking_Paid_off as follows - WHERE Booking_Paid_Off = 1.
I have parameter 1 in place, but I am unsure how to bring in Parameter 2 because it will be based on two conditions, do I need to use an If statement or a case statement? Do I need to create a new dataset for the second Parameter? I only want to limit the results with Parameter 2 ONLY if Parameter 2 has a value of Yes, otherwise I want the results to stay the same.
You have many options. You can switch out the Dataset entirely based on the parameter or use an IF inside the dataset to determine which query to run or simply check the parameter in your WHERE clause.
I recommend the latter.
SELECT
Field1,
Field2
FROM
Table1
WHERE
(
(#live_run = 'Yes' and Booking_Paid_Off = 1)
or (#live_run <> 'Yes')
)