I have a list of subreports in an SSRS report which all have a parameter of Client_No based from their original report. I then only want the subreport to show if the Client No in a dataset 'Summary' has that particular subreport set to 1. The fields of those subreports whether 1 or 0 is bit so I'm not sure if that's the problem but at the moment if I add the following code, it hides this particular subreport even if its set to 1 or 0 when it should only be visible if set to 1 for that particular client and subreport. Basically, different clients only want to see certain subreports.
=IIf(Parameters!Client_No.Value = Fields!Client.Value,"Summary" AND fields!Output.Value,"Summary" = "1!, False, TRUE)
You can create a dataset that return records filtered by Client_No = 1. then in subreport visibility set show condition on number of rows.
Related
In my main report I have one subreport for now. The subreport is linked and runs when I run the main report.
However, taking things step by step, I am trying to hide the subreport based on a field called "CL_Language" that has either "Spanish" or "English".
So main report runs and shows all subreports with both languages. This works.But now I am trying to hide any subreport where the "CL_Language" field.value is not "Spanish".
This is my Expression in the Visiblity property of the subreport control on main form:
=IIF((Fields!CL_Language.Value, "DataSet1")="Spanish",True, False)
I would assume I need to reference "DataSet1" since that is what the subreport is using but I get this error:
Overload resolution failed because no accessible 'IIf' accepts this number of arguments.
So I tried without referencing the DataSet1 in the expression:
=IIF(Fields!CL_Language.Value="Spanish",True, False)
And I get all records, Spanish and English as if it doesn't see the value.
The main report has no other controls on it, is only there to show hide based on language.
I have searched for other threads that have a solution with no luck.
EDIT:
As requested in comments here is my subreport layout.
In order to create 4 printable pages per Detail row I added a ListBox to the report and added first row as Parent Group, grouped on Row ID and set Page Breaks at every instance of new group. A rectangle holds the contents of the first page. Then for the next 3 pages I "Inserted row", inside group and below.
Each one of those rows holds a rectangle with all sorts of textboxes with values from the DataSet1. So all 4 pages print for each Parent group detail. I tried setting the Visibility property in the ListBox the same way I am trying to set the subReport's Visibility property but no luck.
I created a matrix report table with the option to drill down in that matrix with the + sign in both columns and rows.
The user can also click on any text-box in the matrix and it actions to a different report with parameters to view details.
Both tables are 1 report and 1 matrix table in different settings of hide/show groups.
In the right table I sent the number marked red is an example for drill through with parameters sales+mary, and aria1+product 2.
On the left, the drill through always sends with sales-david as parameter because he was first.
How can I drill-through with a parameter that represents the entire group of sales?
You should be able to use InScope("SalesPerson") or simialr to test the scope of the cell you click on. If it's inscope of the detail column group you can pass the actual SalesPerson to the drill down report, if not then pass some arbitrary value (say -1) and have you sub-report ignore SalesPerson if the parameter is -1
InScope("SalesPerson") will return true if the group is expanded or false if it's not.
You can read about InScope here
https://technet.microsoft.com/en-us/library/ms156490(v=sql.100).aspx
I have a main page with many subreports but dependent on the client parameter I don't want all pages to show. I have a dataset 'params' that indicate if each subreprt should be visible fot the Client picked based on a 1 or 0 in the field of the name of the report.
I used the below but then had the error that I hadn't used an aggregate
=iif(Fields!ClientName.Value,"params") = Parameters!Client.Value and (Fields!Overview.Value,"params") = "1" , TRUE, FALSE
I added in First around the fields but then it will only look at the first Client in the params table. I just want the correct subreports to be visable based on the Client chosen in the parameter
I have one dataset (DataSet1) in main report. The main report contains a subreport (child report). I would like to know how can I pass rowcount of dataset (DataSet1) in main report to subreport (child report). DataSet1 returns 1, 2 o 3 rows depending on a parameter on the query.
I have used a textbox in main report and assign it the expression:
= RowCount("DataSet1")
then I pass the value of this textbox to the subreport (child report) as a parameter using the expression:
= Reportitems!textbox1.Value
The subreport (child report) within main report is contained in a list object. This list object has assigned the DataSet1 over which it iterates.
Within subreport I print in a textbox the value of the parameter passed from main report (rowcount("DataSet1")) but it always prints value of 1 instead of print 1, 2 or 3 depending on the case.
Also I have tried to create another dataset2 which contains the same query as dataset1 but returning SELECT COUNT(*) AS rc ..... Then outside of the tablix I create another textbox and I assign to it the expression:
= First(Fields!rc.Value)
In the textbox is correctly shown the value of count 1,2,3 depending on the case but when passing it as parameter to subreport, in the subreport it is always shown as 0.
What am I doing wrong?
Instead of setting a textbox with the row count and passing that value to the subreport, could you try passing the parameter directly to the subreport. ie. =CountRows("DataSet1") in the 'Change subreport parameters' dialog?
I have a report showing hours and dollars that are written off. Jobs for this report are classified as NRB (non-billable) and non-NRB (billable). Each job type has its own Tablix in the report and I want to populate each Tablix based on a bit value - IsNRB.
All of the "0" IsNRB rows should populate the top Tablix and the "1" values should populate the bottom Tablix . For the most part this is working. What is happening, however, is that some Programs or Clients will have both NRB and non-NRB jobs, and it appears that as each Tablix works its way through the rows of the report dataset, it will capture and retain the first value for IsNRB and apply that to the entire report.
I have tried logic similar to the following in a number of places/ways:
=IIF(Fields!IsNRB.Value = False, Fields!CustProgram.Value, NOTHING)
The Grouping hierarchy of the report looks like this:
ProgramGroup
ClientGroup
Job/SubJobGroup
Detail is here
I have tried setting evaluative expressions similar to the one above on TablixVisibility, GroupVisibility, RowVisibility, and in the field expression itself. The behavior seems consistent in that the first row for that Program, Client, or Job sets the value of IsNRB for the entire report.
As a concrete example, the first Program, "Cascadia" has three rows where IsNRB = 1/True and two where IsNRB = 0/False, and the latter two rows of data are always misapplied because the value of 1/True is overriding the 0/False valued rows.
What is the proper approach to take that will allow the first Tablix to accept and display rows of data where IsNRB = 0 and the second Tablix to show those with a value of 1? Do I need to abandon the IsNRB bit datatype and just have a distinct dataset for each Tablix? That seems like a klunky way to approach the report.
Filter each table on the IsNRB field. Right click the tablix and select Tablix Properties. Select filter, then then select the field you want to filter against (IsNRB) and the value your want it to be (1).
This will put all records with a 1 for the field in one table, and with a 0 in the other