I am using SSRS reports on sp_execute_external_script in R language.
I have problem with multivalues parameter.
#params = N'#age int'
I want choose from the report more values ?
example 3 , 5, 70 years old.
Thanks
Related
Now I am in the task of passing some reports that are in SQL Server Reporting Services to Power BI, among them I find a report which apparently obtains the average of a value as follows:
=Format(AVG(Fields!t_TOTAL_SALIDA_seg.Value)/3600, "##") + ":" + Format(AVG(Fields!t_TOTAL_SALIDA_seg.Value) MOD 60, "##")
I have tried to pass this same formula to Power BI as follows:
= AVERAGE(Consulta1[t_TOTAL_SALIDA_seg])/3600 + AVERAGE(Consulta1[t_TOTAL_SALIDA_seg])
But its values do not correspond to the report found in SSRS, I do not know if it is necessary to add something else to my formula or change something, I hope someone can give me guidance.
UPDATE:
I have made use of the formula that they tell me in one of the answers as follows:
= FORMAT( AVERAGE(Consulta1[t_TOTAL_SALIDA_seg])/3600 , "##" ) + ":" + FORMAT( AVERAGE(Consulta1[t_TOTAL_SALIDA_seg]), "##" )
But I got an error message after saving the formula
UPDATE 2:
I am comparing the results in the SSRS and Power BI report but their results do not match, the following are the values in SSRS:
And these are the results in Power BI after correcting the formula:
Their results are close but they do not match anyway.
I would like to think why I still need to add MOD 60 to my Power BI formula as the report in SSRS brings it
I think that you try to convert a range of second in the average but converted in format hours/seconds.
For example, if you have 3 records :
You will get 13:32 if you respect the format ## for the Number and the mod60.
So if you want to reproduce the same in PowerBI you need to cast something like that :
= FORMAT( AVERAGE(Consulta1[t_TOTAL_SALIDA_seg])/3600 , "##" ) & ":" & FORMAT( MOD(AVERAGE(Consulta1[t_TOTAL_SALIDA_seg]),60), "##" )
Scenario: I am working with a Firebird database (somewhat similar to MySQL) connected to Microsoft SSRS 2012 via ODBC connection manager.
I have a huge stored procedure (which I am not supposed to modify at all) given by our client. The stored procedure has a parameter - Parameter X filtering Column X (integer datatype); when I pass values to Parameter X - say 1,2,3,4... individually, I am able to run the report correctly in SSRS.
However, when I try to pass a string of values - (1,2,3,4...) - i.e. (by checking) 'Allow multiple values' for this Parameter X (text datatype) in SSRS Report Parameter Properties box, I get this error -
'Cannot add multi value parameter '?' for dataset XYZ because it is
not supported by the data extension. (XYZ is the main dataset for this report)
The values 1,2,3 are passed as input from another dataset (PQR).
How can I pass multiple input values (1,2,3,...) to Parameter X from this PQR dataset ?
As I have mentioned, I cannot modify the PSQL Firebird stored procedure (main dataset XYZ) at all. The procedure reads something like this for filtering Column_X:
WHERE :Parameter_X CONTAINING Column_X
Now if :Parameter_X = 1 or 2 or 3 individually passed from dataset PQR, SSRS report works fine.
If :Parameter_X = (1 ,2, 3, ....) multi values passed from dataset PQR, SSRS report throws the above error.
I can modify the dataset PQR, but not the main dataset XYZ.
Any suggestions ?
Join(Parameters!ParameterX.Value,",") still works. In my case it was using OLE DB connection type instead of regular ORACLE in Report Manager.
It seems OLE DB could not parse Join(Parameters!ParameterX.Value,",") .
In an existing ssrs 2008 r2 report, I have a requirement from a user where they want to add 2 more parameters to the report. Right now there is an option
where the user can choice to generate report1, report2, report3, report4, report5, report6, report7, report8, and/or any combination of the reports I just listed.
This is setup by using an expression in the visibility property for each of the 8 tablixes.
For your information, the following is an example of how to display one of the reports or not:
=iif(InStr(join(Parameters!report.Value,","),6)>0,false,true)
Now the user wants to be able to add the parameters of customer and inventory_item based upon if report7 and/or or report8 is selected.
Now can you tell me the following:
Would you show me the code I can use in the dataset to select report7 and/or report8?
Is this considered using 'optional' parameters since they new parameters of inventory_item are based upon if report7 and/or or report8 is selected. If so, can you show me how I can code for these optional parameters?
If the above is not possible to select specific reports, then would the dataset query need to look something like:
where #report is null or where #report is not null? What would you suggest?
If the above options are not possible for the 2 new parameters, would I have all items (or one item)selected so that the reports would run all the time?
For your extra parameters, you can check out Cascading Parameters (http://www.mssqltips.com/sqlservertip/3466/cascaded-parameters-in-sql-server-reporting-services/).
Basically, you'll add your new parameters but not use them for the filter unless reports 7 or 8 is selected. Unfortunately, there's not a method I know of to disable a parameter based on another parameter selection.
I'm guessing from your expression that your Report parameter just returns a value of 1 - 8 based on the report selected. The example should be from Report 6:
=IIF(InStr(Join(Parameters!report.Value, ","), 6) > 0, false, true)
The Filter to use your new inventory_item parameter would be something like:
=IIF(InStr(Join(Parameters!report.Value, ","), "7") > 0
OR InStr(Join(Parameters!report.Value, ","), "8") > 0,
IIF(Parameters!inventory_item.Value = Fields!inventory_item.Value, TRUE, FALSE), TRUE)
This would only restrict the data by inventory_item if the report is 7 or 8.
I'm new in SSRS reporting. I've a doubt on setting parameters.
I need to create a SSRS report with 3 i/p values a,b &c. The condition is if a & b has values then C should not be active..How to apply this ?
I could not find any option like this in parameters.
Somebody please help..
Regards,
Julie
I think SSRS doesn't have any native feature like this.
I would provide c with available values from a dataset. If a & b have values then the dataset for c would return 1 row e.g. "All". I would set the Default Values for c to the same dataset, so it will work without user intervention.
Then in the main datasets I would code for the "All" value being passed as parameter c.
This question already has an answer here:
Link Subreport to matrix
(1 answer)
Closed 9 years ago.
I a matrix which shows count of Invoices (InvoiceID) with countries on rows and years on headers
Country 2001 2002
US 100 300
UK 200 400
IR 500 90
I have requirement of creating a subreport which shows Invoices details. When I click 100(US-2001) on my main report I have to show all the 100 Invoices. I tried this way: since I am doing count of InoviceID in matrix, I tried using Join(Fields!InvoiceID,", ") expression on the data text box action (Go to report). on the other side I created a subreport with multivalue parameter. but this approach dint work. Later I discovered that Join will not work rows as it expects only arrays.
later I used Join(LookupSet(1,1,Fields!InvoiceID.Value, "DatasetName")," / ") I could join the invoice ids but the problem is, this expression joins all the invoice ID in complete dataset. I just need US-2001 invoices to take to my subreport.
Your subreport should have two parameters:
#Year
#Country
With those two parameters, the subreport can find the clicked invoices. For example, if the following values are passed:
#Year = "2001"
#Country = "UK"
Then it should be able to find those "200" invoices and display their details.
If you base both the main report (that shows COUNT(InvoiceID) and the subreport (that shows Invoice.* details) on the same view, you're pretty safe in getting consistent results in both reports.
With the "Go to subreport" action you should be able to fill those parameters.