How to access report parameters array in fusion spreadsheet - palantir-foundry

Parameters have been enabled to interact between spreadsheet and report: If parameter set in report it is accessible through linked cell.
However this works for just one single value for [string] parameter.
If multiple values entered in report form mentioned cell in spreadsheet appears empty and filtered lookups depending on this do not work any more.
-> How may I set up lookup() function in spreadsheet to work with multiple values for report parameters?
-> How to access multiple values for report parameter in spreadsheet
Thanks in advance.

Related

SSRS Open sub report with provided parameters

I have a report which has 5 parameters and i want to open another report from this report which has 13 paramaters.
When i try to open this report it says some parameters are missing.
I want to know if it is possible like, if i do not pass parameters then it should ignore these parameters in repport and also in SQL query (all these are multivalue parameter).
I cannot use "allow null values" as these are multivalue parameter.
This is main report
These are parameters in sub report which i want to call
Can someone help me please? or i need to create seperate subreport with exact parameters everytime
There are two common ways of doing this.
Populate parameters with a list default values
In your subreport, taking #service as an example. If you can get a list of services from your database then create a dataset tat gives a list of distinct services, use this as the default value for your parameter. Then when you do not pass anything from the main report, the subreport will use all services.
Set the default parameter value to a fixed constant
The other option is to set the subreport parameters to a default value such as *all and then handle this when it is passed to your subreport's dataset query.
So the dataset query might be something like
SELECT *
FROM myTable
WHERE location in (#location)
AND (service = '*All' OR service IN(#Service)

Using a script to find blanks in two columns and filling the blanks with any content above the blank

I'm trying to create a macro in Google Sheets for a daily function that I do in Excel. The problem I'm having is that Google Sheets lacks a function that Excel has. That function being the ability to find all blanks and fill in those blanks with values in above fields. I imagine this can be done with a script, but I've been unsuccessful in my attempts.
The sheet I'm using is called Research Macro and I need to run this script at the end of a macro to check columns A:B for blanks, and either insert a formula to populate the value above said blank (unless that cell is a blank, then I would need the above value, etc.) or just insert the value itself.
I think the Excel function you refer to is available in Sheets, with Find and replace:
Select relevant range (but format range as Plain text first) and Find ^, Replace with:
=offset(indirect(address(Row(),Column(),4)),-1,0)
with the first three options ticked.

Issues with Passing Multi-value Parameters to a Drill through Report

I have two reports were I pass multi-valued parameters to it's underlining data and both reports work very well independently. The parameter strings are being split using the function dbo.UTILfn_Split. When trying to drill from the main or Summary report into the sub or Detailed report all other parameters field in the report are populated except the multivalued parameter field. The parameter lists or value are listed in the detailed report but not selected and therefore cannot run the report even though the detailed report parameter property is set to allow multiple values. In both reports, the where clause is set "IN" not "=." How do I fix this?
In your Summary Report, when you pass the parameter to the sub or detailled report, the passed value parameter should be like this expression:
=join(parameters!yourMultivaluedParameter.Value,",")
after that, you pass the name of the parameter to the corresponding parameter in the dataset Detailled report.
In your SQL (SP), get the multivalues of the parameter by spliting it with your function
like following, depending of the result of your function, for exemple:
INNER JOIN dbo.SplitFunction( #yourMultivaluedParameter,',') tmp on tmp.yourColumn = ...etc...
Hope it helps...

How to set hidden parameter in a subscription

We have an SSRS 2008 (not R2) report, which returns data for 2 different customer class types in a single datatable.
I have a request to have this report sent via email automatically to the user as an excel attachment. The user would like to have 2 worksheets in the spreadsheet. The first worksheet should have the result set including both customer class types and the second worksheet should only contain the result set for one of the 2 class types.
I am able to accomplish getting the 2 worksheets exported to excel, by adding a second data table to the report and setting the pagebreak property on the second table to start and to then set a filter on the second datatable, to only include the 1 class type the user wants.
I can then set up a subscription to automate this on schedule.
The issue that I have, is that I don't want 2 datatables to display when the user is executing the report on-demand via the SSRS web page. To accomplish this, I created a hidden boolean parameter which I use (in the expression) to set the value of the hidden property of the second datatable. This will allow me to hide the second datatable by default. I am expecting to be able to set the value to not hide when setting the parameters for the subscription. However, I can't seem to figure out how to set the value of this parameter in the Subscription. The parameters displayed in the subscription are the ones which are not hidden. This hidden parameter is not displayed in the subscription.
Is there a way to set the parameter values of either a hidden or internal parameter in a subscribtion? Optionally, if I can detect at runtime that the report is being executed by the subscription, then I can set the parameter value accordingly.????

How to loop rows of dataset in Reporting services rdl custom code

How can I loop through the rows of a dataset in the custom code?
I have a report containing a dataset. I pass the dataset as a parameter to the custom code function. But what then? Where is a reference about the available members etc.?
Here is my dummy sample code so far:
Public Function ShowParameterValues(ByVal ds as DataSet) as object()
Dim codes() As Object
Array.Resize(codes,dc.???.Count)
codes(0)=ds??(field???)(row??)
return codes
End Function
Please note: this will be a very simple script (if it'll work), so I don't want to go into custom assemblies etc.
I think you got your answer at:
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/a7d59224-0ee5-491e-883b-2e5fcb3edeab/iterate-through-rows-of-dataset-in-reports-custom-code?forum=sqlreportingservices
There were two important pieces of information I was able to grasp from the above link:
First, A dataset in Reporting Services is not the same type of object as an ADO.Net dataset. A report dataset is an internal object managed by the SSRS runtime (it's actually derived from a DataReader object) and not an XML structure containing datatables, etc. and cannot be passed into the report's custom code.
Second, There was a solution posted as to how one can Iterate through rows of dataset in report's custom code by "transforming" the data set into a multivalued parameter (or if several fields are needed, transforming it in multiple multivalued parameters):
The multivalued Report Parameter must have the following characteristics:
Hidden = True, Allow Multiple Values = True
Available Values tab: Choose the desired dataset. Select the searchable id as Value id, and the field you want to expose as Label Field.
Default Values Tab: Get Values from a Query.
Choose the same Dataset as choosen in the available Values Tab.
Value Field the same you choose for value id.
Set the parameter to never refresh (or it will be loading the data from each iteraction of another parameter).
Now, the idea is make this Parameter "searchable". From this point you exposed the Dataset as an array in the Multi valued Parameter.
Now in a custom code insert the following code:
function GetDataSetLabelFromValue( id as integer) as String
dim i as integer
i = 0
for i = 1 to Report.Parameters!YourParameter.Count()
if Report.Parameters!YourParameter.Value(i) = id then
GetDataSetLabelFromValue = Report.YourParameter!ReportParameter1.Label(i)
Exit For
End if
next i
End Function
Were you able to do what you wanted?