I have VS 2010.
I try using variable in SSRS.
Adding variable as explained on: http://www.sqlchick.com/entries/2010/11/24/deciding-whether-to-use-an-expression-or-a-variable-in-ssrs.html
Several problems:
I am using above, and cannot see the "readonly" parameter.
I am trying doing something like (in expression): =Variables!MyVariable.Value, and I got an error while trying to compile the report: Error 1 : Value is invalid. InvalidIdentifier.
I need to set variable value as on: http://msdn.microsoft.com/en-us/library/dd255208.aspx - Maybe this is for VS 2014. Is there any way doing that for VS 2012?
Thanks :)
Related
This is a bit strange to me. I am using a SSRS Report Builder 3.0 for creating a report. I have two options: 1. Use a filter linked with report parameter OR 2. Use a query parameter linked with report parameter.
In the first case, the report preview works perfect. I am using a simple query for filter with parameter (#parameter_a) applied on ID column:
Select ID, Name from tbl_Table
But when I use a query parameter linked to the report parameter, the preview is blank. For the query parameter, I use the below query:
SELECT ID, Name FROM tbl_Table WHERE ID = #parameter_a
I am clueless on this. I have also tried keeping a default value or removing it. Refresh/View Report doesn't work either.
PS: I am using MySql ODBC connection. Both options in report work fine when used in a c# application and rendered programatically. Tried re-installing current version, older version as well.
Reading the MySQLCommand documentation, there is reference to an older parameter syntax (not sure what version of MySQL you are using in this scenario).
Using the '#' symbol for paramters is now the preferred approach
although the old pattern of using '?' is still supported. Please be
aware though that using '#' can cause conflicts when user variables
are also used. To help with this situation please see the
documentation on the 'allow user variables' connection string option.
The 'old syntax' connection string option has now been deprecated.
Instead of using #, can you try with ?:
SELECT ID, Name FROM tbl_Table WHERE ID = ?
The order of the parameters used in the query will have to match the order of the SSRS report parameters.
After an upgrade from SSRS 2005 to SSRS 2012, one of our reports no longer renders and gives the following error:
Microsoft.ReportingServices.ReportProcessingException: The specified operation is not valid
I've narrowed it down to a textbox with the following expression:
=CountDistinct(Fields!field1.Value) / (CountDistinct(Fields!field2.Value) - CountDistinct(Fields!field3.Value))
Why would this no longer work, and is there an alternative i can use? The text box is to show a percentage and has format P1 assigned to it.
Many thanks in advance for any help.
Tunrs out that field3 was a calculated field. I've updated the SQL to populate field3 and all works fine now.
I'm using now SQL Server 2008 R2.
My website shows the report exactly as it is, including the container where the parameters appear (the client prefers it that way).
However, my website solution includes localization (Portuguese, English, Spanish).
I've tried to translate the parameters by creating one parameter for each language, and then show them according the selected one. It didn't work in SSRS 2008. Because I don't know how to find the visibility properties of prompt.
Does anyone know a solution... Or if SQL Server 2012 has solutions for translating parameter's prompt, or conditional visibility?
Thanks.
The only solution I've found so far (SSRS 2008, 2008R2, 2010, 2012) is to break the DRY commandments, and duplicate the reports with language codes as part of the report name (e.g. MyReport_sp.rdl, MyReport_de.rdl, etc) and then place a web service between the client request and the SSRS instance. The web service then has to field the request to the correct report based on a "Culture" parameter passed with the client's request.
This is NOT a good solution, though at least the Culture param is used in localizing the rest of the report as well. We still have hopes that at some future date MS will add prompt localizability and we can rename the report to MyReport.rdl and just have everything actually localized. Hmm, what a concept...
Another workaround would be to just put a number in the prompt for the parameter then prefix the label of each parameter with the localised version by either using "get values from query" or by using the expression builder with a switch statement in the label expression.
For the get values from query option you would have a dataset something like this if you have the translated versions in the query:
SELECT ParamLabel, ParamValue
FROM MyLocalisedParameters
WHERE UserLanguage = #Language
Or like this if not:
SELECT
CASE #Language
WHEN 'pt-PT' THEN 'Selecione Departamento: ' + ParamLabel
WHEN 'es-ES' THEN 'Seleccionar Departamento: ' + ParamLabel
ELSE 'Select Department: ' + ParamLabel
END AS ParamLabel
, ParamValue
FROM MyParametersTable
in both cases creating and assigning the Globals!Language to a Parameter called #Language.
Or if using the expression builder for a hardcoded set of values it would look something like this:
either way the end result would look something like this:
Not perfect but functioning and easier to maintain than several copies of the same report.
If you want it to look a bit tidier then just have the Parameter prompt as only one entry in the parameters list and set it to the default value to avoid repetition on every line.
There is none...
As per connect.microsoft.com, this feature has been requested after SSRS 2005 has been released, and while it is on Microsoft's TODO list, the programmer time to do this has never been allocated, and hence in 2012, SSRS is still not capable of doing that.
Although it's (with much effort) possible to translate everything else, it's not possible to translate the parameter prompt.
There is NO conditional visibility either, visibility of parameters is fixed.
Also, there is no way having SSRS use a supplied language instead of the one set in the browser language settings.
The only thing that you CAN do is write a C# program that loads your XML file, get's the report's parameter name(s) (and possibly the report's name as well), looks them up in a database, and automagically creates N reports for n languages.
Then, you have to redirect your users to the report in their language.
You then only need to write an upload tool, because you won't want to do that by hand.
The other way is to use the ReportViewer control, and re-implement parameter selection.
I think there's CrissCross that tries to do that, but it failed in all but 2 of the reports that I tested.
An evil hack would be:
parametername: babla_language1 / blabla_language2 / blabla_language3 / blabla_language4
and then use jQuery to get that string. do string.split('/')[index_of_language]
and then prey that / is never within "blabla_languageXY"
Edit:
I actually did that. You have to use setInterval to do it, because there is no way to detect change when you select a parameter.
I've set up a report using SSRS and would like it to AutoRefresh constantly as data will continuously be added. Simple solution was to set the value to a constant which is easy enough. However, the report is an error log so I would like for the user to be able to shut it off or delay the refresh while they read the messages. I've tried adding a parameter Refresh as an Integer but I cannot set the AutoRefresh value to an expression via
=Parameters!Refresh.Value
and
=[#Refresh]
SSRS yells at me saying the "Property value is not valid. PARAM is not a valid value for Int32."
I appreciate any help.
Yes, AutoRefresh can use an expression in SSRS 2012.
I was able to set this up correctly on SSRS 2012 and make it work. The data type of the parameter must be Integer. What data type are you using? What version of SSRS are you using?
Edit: I have confirmed it does NOT work in SSRS 2008. However, if you are using SSRS 2008 R2, change the project property TargetServerVersion to SQL Server 2008 R2, and it will work. I have it working in a test environment.
I'm using SSRS 2005 and I'd like to be able to 'jump to' different reports depending on the value in a date field. For example:
=iif(Fields!Date.Value = Today, TodaysReport, OtherDaysReport)
When I use this syntax, I get this error when previewing the report:
The ReportName expression for the textbox ‘CallId’ contains an error: [BC30451] Name 'TodaysReport' is not declared.
I don't get any error on the 'OtherDaysReport' parameter but I think the compiler gave up on the first error.
Is the syntax I'm using in the IIF statement valid in a 'Jump to Report' expression in the Navigation property of a textbox? If not, is there a different way to do what I'm trying to do.
I am not sure if you found answer to your problem yet. but for anybody with similar problem please try following
put your report names in quotations. In your case try
=iif(Fields!Date.Value = Today,"TodaysReport", "OtherDaysReport")
Also make sure you specify the right parameters and the "Omit" properties as required.