My reports are paramaterized stored procedures, with no filtering at the report. No graphs or eye candy, just data, with 1 or 2 levels of grouping, with the data ordered in SP.
The user can chose which columns they wish to see - typically they choose the supplied defaults, but can choose from up to 100 additional optional columns.
The Tablix has logic to "hide" columns the user doesn't want to see.
The stored procedure part is fast, but the Processing Time at SSRS takes typically about 95% of the Total Time.
Any ideas on how to make SSRS process a set of columns (that could be different for each user) more quickly? Even hidden columns seem to be fully processed - is there any way to make SSRS more efficient at ignoring what it won't need?
Thanks for your thoughts.
SSRS 2016, Oracle 12G
I would use a matrix and have the optional columns returned as rows from the SP so instead of something like
ColumnA | ColumnB | Optional1 | Optional2 | Optional3 | Optional4
ABC DEF 5 10 15
GHI KJL 20 25
It would return something like
ColumnA | ColumnB | OptionalCol | Amount
ABC DEF 'Optional1' 5
ABC DEF 'Optional2' 10
ABC DEF 'Optional4' 15
GHI KJL 'Optional1' 20
GHI KJL 'Optional4' 25
In report you could use a matix with a column group grouped on OptionalCol
This might make the SP slightly slower but would mean SSRS only has to render enough columns for the data selected. It also makes the design a lot simpler as you don't have to worry about hiding columns.
Related
I'm not sure if SSRS is dumb, or I am (I'm leaning towards both).
I have a dataset that (as a result of joins etc) has some columns with the same values duplicated across every row (fairly standard database stuff):
rid cnt bid flg1 flg2
-------------------------------
4 2882 1 17 3
5 2784 1 17 3
6 1293 1 17 3
18 9288 2 4 9
20 762 2 4 9
Reporting based on cnt is straightforward enough. I can also make a tablix that shows the following:
bid flg1 flg2
------------------
1 17 3
2 4 9
(Where the tablix is grouped by Fields!bid.Value and the columns are just Fields!flg1.Value and Fields!flg2.Value respectively.)
What I can't figure out is how to display the sum of these values -- specifically I want to show that the sum of flg1 is 21 and the sum of flg2 is 12 -- not the sum of every row in the dataset (counting each value more than once).
(Note that I'm not looking for a sum of distinct values, as they may not be unique. I want a sum of one value from each bid group, because it's from a table join so they will always have the same value.)
If possible, I'd also like to be able to do a similar calculation at the top level of the report (not in any tablix); although I'd settle for hiding the detail row if that's the only way.
Obviously, Sum(Fields!flg1.Value) isn't the answer, as this either returns 51 (if on the first row inside the group) or 59 (if outside it).
I also tried Sum(Fields!flg1.Value, "bid") but this wasn't considered a valid scope.
I also tried Sum(First(Fields!flg1.Value, "bid")) but apparently you're not allowed to sum first values for some weird reason (and may have had the same scope problem anyway).
Using Sum(Max(Fields!flg1.Value, "bid")) does work, but feels wrong. Is there a better way to do this?
(Related: is there a good way to save the result of that calculation so that I can later also show a Sum of those totals without an even hairier expression?)
There are two basic ways to do this.
Do what you have already done (Sum(Max(Fields!flg1.Value, "bid")))
Sum the rendered values. To do this check the name of the cell containing the data you want (check it's properties) and then use something like =SUM(ReportItems!flg1.Value) where flg1 is the name of the textbox, which is not necessarily always the same name as the field.
I'm creating a report that shows how many sq ft my company worked during a time period and what's the cost per sq ft. I have this 2 Datasets
ServiceProviderSqFt
ServiceProviderID
ServiceProviderName
Total
Month
CostSqFt
ServiceProviderID
ServiceProviderName
Cost
So the matrix I created looks like this:
ServiceProvider | Expr(Months) | *Cost Per Sq Foot |
ServiceProvider | Sum(Total) |missing|
So, the word missing is where I'm having problems. I need to put over there the Cost for each provider, so It can looks like this:
Service Provider | Jan | Cost Per Sq Foot
Provider 1 | 250 | 1.10 |
Any thoughts?
Thanks in advanced
If you have to use 2 separate datasets, you can use the Lookup function. There are many resources on that out there. The best option with SSRS is to combine those datasets at the database level as subqueries so that you can work with just the one dataset in the report. Hopefully this points you in the right direction.
I have main report that has around 10 tablix and one sub report that has 2 charts. I want the each tablix grouped by same column, but every table uses different datasets. By using List control, we can group the tablix and set a page break between each group. For that, list dataset and tablix dataset must use the same dataset name.But I am not sure how to do that for multiple datasets. Could anyone please help me how to group multiple tablix based on same field value.Is it possible using list to do that? TIA
Attached for reference
. Each tablix uses different data sets.but the field names are same.If Service_line column has 10 rows, then I want to display in 10 pages(one page per service line).If I select page break at each tablix, first tablix splits by that field name,after that next tablix starts to split by that field name. I want to show A/R,cash,Adjustments in one page per service_line field and then next page the same tables but different service_line. So I thought Put in List all tables together and grouping at List level will solve the problem.Could you please help me on that? or if you have any other suggestions please let me know. I am not sure how to get this done. Appreciate your help.
If I understood you correctly, what you want to do is modify your data a little and use nested grouping.
Combine your datasets into one dataset using unions and label each row with column 'Category'that has value ('A/R', 'Cash', 'Adjustments')
for example your dataset might look something like this
CATEGORY | SERVICE_LINE | Total | ...
-------------------------------------
A/R | A | 100
A/R | B | 10
A/R | C | 1000
Cash | B | 50
Adjustments | B | 100
Cash | A | 5
Cash | C | 400
Adjustments | C | -100
Adjustments | A | 9999
after that you will create a 1 tablix (forget about the lists). And inside that tablix you will create a row group for Category and merge all columns and set value for the cell as [CATEGORY]. Also for this row group you want to set Page Break options as "Between each instance of a group". After that create a row below that contains all the column labels Service_line, Total, etc.
Now what you have to do is create one more row group as Adjacent Below and use Service_Line as group by attribute.
with some UI tweaking you can get it to look as you want.
I looked at this thread already but get #Error
SSRS Conditional Summing
Back Story:
I have a ssrs report to qa. Total calls value is going up based on orders value i.e. total calls value repeats if a sales person took 5 orders.
This should not be the case. Example:
left side is wrong right side is correct at employee level in grey.
abc | 500 | order-001
not
abc |500 | order-001
abc |500 | order-002
abc |500 | order-003
So i modified the SP to use Dense rank function.
Now within SSRS
At supervisor level I want to do a sum of total calls
=sum(IIF(Fields!Dense_Rank.Value=1 Or "NULL",Fields!TotalCalls.Value,0))
but this expression is evaluating to #Error at Supervisor level.
Finally, I wish to get a quick fix for this not re-invent the wheel or change the requirements.
Any help would be greatly appreciated.
Assuming Fields!Dense_Rank.Value refers to a column in your dataset called Dense_Rank (naming fields after t-sql functions is not generally advised, as this may lead to confusion), I think what you are trying to achieve is the following:
=sum(
IIF
(
(Fields!Dense_Rank.Value=1 Or Fields!Dense_Rank.Value Is Nothing),
Fields!TotalCalls.Value,
0
)
)
I am developing an SSRS report with the following dataset. There is a filter for 'Period'. It is a multi-select filter. Data is grouped by 'Account' field. I need to display Total Expense for each group (which was easy). I also need to display 'Budget' on the same group level. The problem is the budget data is redundant - see below.
Say for the first group (Account=100 AND Period=201301), Sum([Budget]) would generate 200, which is not true. I can use the Average function which helps if user selects only one Period from the filter. If they select multiple values (e.g. 201301,201302) then the average will be (100+100+150+150)/4=125, which would be wrong because it has to be 100+150=250. I don't want to average among all rows in the returned dataset.
ID Account Period Expense Budget
1 100 201301 20 100
2 100 201301 30 100
3 100 201302 10 150
4 100 201302 40 150
5 200 ...................
So, how do I write an expression to make this happen?
A dirty workaound would be to eliminate redundant values in the Budget column so I can safely use Sum([Budget]) w/o worrying about duplication. The updated dataset would look like this:
ID Account Period Expense Budget
1 100 201301 20 100
2 100 201301 30 NULL
3 100 201302 10 150
4 100 201302 40 NULL
5 200 ...................
Please advice for either approach. Thank you.
The most elegant way is to use the FIRST() aggregate function.
=FIRST(Fields!Budget.Value, "MyAccountGroupName")
There are some situations where this won't work. Then you need to move the logic to your query as you describe or you can get fancy with embedded code in your report.
I would follow your "dirty workaround" approach. You might possibly be able to achieve the result just inside SSRS with some fancy calculations, but it will be totally obscure.