Building a rdl report for CRM - reporting-services

I'm creating my first report for CRM 2011 using SQL Server Business Intelligence Development Studio and i've managed to do a decent amount but as I move into the more complex parts i'm becoming stuck, and I was wondering if someone would be able to help me with a few questions I have:
I'm using fetchXml to get the data from CRM for some accounts that the report is for, I need to include some data from a child entity but can't include them in the same way that I can for a parent entity to accounts. So for this I'm assuming I need to use a separate fetch query, but how do I pass the ID of the account the report is looking at into the second fetch query as a parameter?
Once I've got the names of all the child items with the fetchXml, whats the easiest way to display them all in a numbered list?
EDIT: For 1 and 2 I found that I can use a subreport with the child data in it. Using a list item I can show all in a bulleted list and I can pass the parameter through from the main report to the subreport
I'm listing the account's address on the report but since they might or might not have the lines 2 and 3 fields completed i'm unsure of how to display it without either missing off some of the address or leaving big gaps. I've tried creating different text boxes with the different combinations of line 1, 2 and 3 and then make only one visible with the use of expressions but the iif statement always returns false. Is there an easier way to do this?
EDIT: I've found out how to do this using a number of different text boxes containing the different combinations and hiding them using the visibility rule. What was initially confusing though is that the rule is for if the box should be hidden, rather than if it should be shown
When I add a field onto the report it always has a "First()" statement on it. Is this required or will it limit my report in any way?
EDIT: This doesn't seem to have an effect on the report as the record to run it against is always selected beforehand, so the First() statement doesn't restrict any data
If anyone could help me with any of these questions at all then that would be greatly appreciated.
Thanks

I've found the answers to my questions, i've put them in the original post.

Related

flatten results onto one line in report builder

report example
i have a report that displays client contact details, but annoyingly for each different contact type it displays the results on a separate line! Can anyone advise if it possible to show the results on one line using an expression or some sort of filter, not using SQL.
as you can see from the image Miss S has both a mobile (MBL) and telephone (TEL) number but they show on different rows, if in my program i were to add an email address then it would add a third line, is it possible to flatten the results down to one row?
regards
You'll need to remove the Contact Type column from the tablix as this won't be valid once you put all the contact details on the same row.
Once this is removed, you will then need to edit the row group (under the main design window) and group by the first 5 columns only. There may already be grouping set, if so check that contact type is not in the group by list, if it is remove it.
Alternative
After saying all this, I can't help but think this report would be a whole lot easier, assuming the data was structured correctly (it may already be), to use a matrix control. That way all this and the answer to your previous question (asked recently) would be automatic. I won't go into detail but if you are interested, create a new question and show the output from your dataset query, the query code itself and the desired output. optionally, accept this answer ! :)

Reporting Services - Report reutilization

I have designed and tested a report and it's working fine.
After some refinements, we manage to reduce it so it takes only 1/8 of a page, so at 2 per "row" we can fit 4 rows in a regular A4 page.
Now, a requirement dropped out of nowhere saying that this report must be printed multiple times in a same page.
Is there a way to re-utilize my previous report as a template, maybe throw it into a "foreach"?
EDIT 1
I've managed to use the "subreport", what i need now is a way to add them on the fly, based on how many rows the dataset returns...
If each of the 8 reports has the same parameters, you can just create 8 subreports in one report.
A simple solution would be to place the subreport 8 times on your main report and define expressions whether to make them visible based on a parameter you provide.
It's not really that dynamic, but it'll get the job done. As you only want a single page filled, it shouldn't be much trouble.

'un-merge' multiple nested column headers in a matrix chart

I have spent far too long on this and would really appreciate any help someone is able to give. I am creating a cross tab type report in SSRS (2012) using a matrix. Everything is working fine - however my end result must have each column separated from the next (i.e. no merging on common groups). I have three nested groups for the column groups (see figure) and want the output to show individual columns as opposed to merged on common groups.
I have seemingly exhausted all options - and am absolutely stuck - is anyone able to help?
Forgive - I found by adding grouping appropriate to my report and then deleting the row and inserting rows inside the group and re entering the values worked. These appear as 'static' in the advanced mode setting.

Matrix report - Page breaks for each column group

I'm using VS2005 to create my reports.
I have a matrix report that works beatifully. I have country going down on the left hand side (row group called "matrix1_country_name") and data going across for 2 column groups, product_node and month (column groups "matrix1_Node" and "matrix1_calendar_month_name" respectively)
The only thing I want to improve is that this report will always show 5 year/60 months of data, and with multiple nodes I'd rather have each node be on its own page (Ideally I'd love to have it on the same page but in the rows just below to first node, but I'm not sure that's even possible).
I've seen numerous responses on these boards about putting in page breaks on column groups, but I can't seem to find how to do that in VS2005. The examples I've read that can do that seem to have a different interface so I'm guessing they aren't in VS2005.
Does VS2005 allow you to add page breaks after each group item and I'm just missing it? Or is there a trick I can do to get that to happen? I've also read about nestin matrix reports in list reports but that seems more complicated than doing the page break on the column group, so I'd rather do the easiest solution if I can.
Ah, I see pagebreaks are ignored on column_groups. Well I guess I'll try one of these workarounds.
http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/ea9d795b-8d17-41d2-a1d7-a4069ebb4539

Grouping by a report item in SSRS 2005 - textbox - any workarounds?

I want to group by a report item, but that's not allowed.
So I tried creating a parameter...not allowed as well.
Tried referencing from footer...failed again.
This is somewhat complicated.
Let me explain:
I have textbox22, it's value is:
=Code.Calc_Factor(Fields!xx.Value, fields!yy.Value...)
This is embedded VB code in the report that's called for each row to calculate a standard factor.
Now to calculate the deviation from the standard factor, I use textbox89, whose value is:
=(Fields!FACTOR.Value - ReportItems!textbox22.Value)/ReportItems!textbox22.Value
Don't get confused between Fields!FACTOR.Value and textbox22.Value, they are different.
Fields!FACTOR.Value is the factor used, textbox22.Value is what it should be (standard factor).
Now I want to create a group which splits deviations into 2 groups, > 1% or not.
So I tried creating a group:
=IIF(ReportItems!textbox89.Value > 1,0,1)
...But then SSRS complains about using report items.
I have run into a similar problem of using report items in the past, but this is a new case!
Any help greatly appreciated.
Have you tried adding a calculated field to your dataset?
Here is how it works:
While you are in the layout view of the report, open "datasets" tool window(in my environment it is on the left).
Right click on the DataSet you are working with and add a field, you can use a calculated field, and build your formula appropriately
Then you should be able to group on this field
-Dan
I'm not 100% that someone won't have some magic solution for this but I have run across similar problems myself in the past. I believe (but could be wrong) the problem Reporting Services is having is that it only renders once and what you're asking it to do is render the data before rendering the grouping which it doesn't do.
The only way I have ever been able to produce the exact results I need is to make the data rendering happen exclusively in the SQL (through the use of table variables usually) and then use Reporting Services merely as a display platform. This will require that your factoring algorithm gets expressed in the T-SQL within the stored procedure you will likely have to write to get the data in shape. This would appear to be the only way to achieve your end result.
This has the bonus feature of separating report design and presentation from data manipulation.
Sorry I couldn't provide a SSRS solution, maybe someone else will know more.