SSRS report that outputs the number of invoiced lines with a group by - sql

I've never used SSRS before so I'm not too familiar with its capabilities. I need to make a report that is grouped by Division Code, and then counts the number of invoices that are the same (by Invoice Number), and displays that in a column (I called it Invoice Lines). I'm trying to get something that looks like this:
And this is what I have so far, I know that the Invoice Lines value should be an expression, though I am not sure what expression to use or how to get it to work. When I created the report, I put all the fields in the details section and the Division Code in the group by section using the report wizard, but I'm not sure if that's right either as its not displaying anything when previewed:
Image added of trying count expression from comment:

If you have grouped it by invoice number, then just an =count(Fields!Invoice_no.Value) should do the trick. Just ensure that this expression is on the grouped column header and not on the details line itself.

Related

Trying to count records in SSRS from different data sets

I have an SSRS report that combines 5 reports into one. Each report is populated from a different stored procedure. The first page is a summary that is to provide a record count from each report. I've created fields in the stored procedure that provides the counts for each individual report: phycount and nonphyscount. I'm trying to create a table similar to this:
Active comes from one data set, Initial comes from another, Recert comes from another, etc.
I've been playing around with the Lookup and LookupSet but I'm just getting errors, plus I'm not sure if that's even the right direction.
Does anyone know how to do this?
Lookup and Lookupset are more for getting specific values out of a dataset. Very useful but not necessary for what you're trying to accomplish.
You can use aggregate functions SUM and COUNT to accomplish what you want to do. The cool thing about these functions is you can actually embed IIF statements inside of them.
I'm not sure exactly how your datasets look and are named but it would be something like this...
SUM(IIF(Fields!Type.Value = "PhyCount", 1, 0), "Active")
The sum function goes through every row of your dataset and sums the values you pass to it. The iif statement checks to see if the type field in the dataset is "PhyCount". If so, it returns 1, if not, 0. Since this will happen for every row, your SUM function will return a count of each row with status active.
edit: "Active" after the iif statement specifies the name of the dataset.
EDIT AGAIN: This solution apparently does not work in SSRS 2008.

Make a Crystal Report selective over the data that it shows

I have many reports in a project, each showing different data about different things. I have shown the user the project, and his main feedback was this:
I like the reports, however I notice that in a lot of them, the tables show all of the columns that meet the report criteria (what the report is showing), even if they are empty. Can you change them so that if a column is empty, it is not displayed, as this takes up needless space?
Is there a way I can achieve this? For example, if the report is Sales by Customer x by Suppliers, and one supplier has no data for this customer, I don't want that supplier to be shown. Is there a way I can get the report to only display columns if they contain data?
To clarify, the effect I am after is, if the report below was shown, the column Arris Rail (144) 75x75 1.282m would not be displayed.
Right click on crostab > Cross-tab expert > customise style
set option Suppres empty columns
I think you need to replace "-" value to null or empty

Breaking the SSRS report depending on the Multi Value Parameter

I am working on a SSRS report with a Multi Value Parameter which contains list of names. I have written an expression for the title that works like "Result for SELECTED NAME". It also have an option of (Select All) which displays all the results with title as "Result for MULTIPLE NAME". It is working fine up to this part.
Now I have to modify the report like, If i select multiple values, the report should break into pages with each selected name on different page with title for that individual parameter value(name) as "Result for SELECTED NAME".
Please help me. Thank you.
You can place the entirety of your current report (excluding headers/footers) into a List object. I assume youa re returning the selected values from the parameter (like Manager Name) as part of your DataSet. Assuming this is the case
Create a new list
Insert the contents of your report into the rectangle of this List
Right click the List Row Header and Select Row Group -> Group Properties
Set the Group to Group on
=Fields!ManagerName.Value
This approach will take a simple table like this
And break it into a list like this
Then you can just set the Tablix Properties of the List to Add a Page Break After to checked
Hopefully this is helpful. If you have further questions on this then please let me know
I worked on it and found a way to make it happen. I first created the row group for Names. Then applied the page break for each instance option. Then deleted that group column (Only deleted column but not group). Then added that group in a static column on the top, and wrote an expressions to show that group itself as a title using concatenation.
But here I faced another problem, when there is no data for the selected name, the title row isn't displayed in the preview as it also a column in the table.

How to sum calculated fields coming from nested list

In a report I have 2 nested list and the last one has a table inside.
I can easily sum values in the table and have them in the total field.
Inside the nested list I do special calculation with table total value.
I would like to be able to sum all these calculated values in the outer list.
What I need is a way for the nested list to expose its results to the outer list and a way to aggregate them. I don't want and probably cannot do the calculation again in the outer list, I want to sum the results coming from the inner list.
It seems a simple task but I spent the entire morning surfing for a solution !!
Sometimes instead of clicking here and there for a more formal way of adding a solution to thing I many a times find that it could be done in a simple fashion also..
what I mean by this that you can do like following
Right Click tablix row and insert new row below
Now at the cell where you want this aggregated sum total, you can simply use your existing expressions, that you are using in the previous cells, in this new cell where you want to display the results Something like this :
=Sum(Fields!Total1.Value, "DATASET1") + Sum(Fields!Total2.Value, "DATASET2")
See if it works for you, coz I always do like the same !

Assigning a value to a variable at the same time an expression is evaluated. Multiple statements on the same expression line? [duplicate]

In a report table there is this formula to calculate a subtotal for an invoice. This is the formula:
=Sum(Fields!LineTotal.Value)
The textbox is called TextBoxSubTotal. I would like to display this in another part of the report such as in the header area where I display that subtotal, tax, shipping charge and also a total due.
Can you tell me how to display this value in TextBoxSubTotal in other parts of the report?
Have you tried creating a report variable? Create a new variable and put the invoice calculation into the expression for the new variable. Then reference the report variable from the two textboxes.
The source for the two textboxes would look something like this:
=Variables!TestVariable.Value
http://msdn.microsoft.com/en-us/library/dd255208(SQL.105).aspx