Reporting Services, Custom Percent Format - reporting-services

I have some fields I currently populate with a P0. The results is like this:
2,434%
I want however something like this:
2434%
How do I do this?

Have you tried something like 0000%? Or alternatively, an expression like:
=right(format(Fields!YourField.Value,"#%"),5).
I don't have BI studio open right now so I can't test these. The expression would of course convert the value to text, which maybe problematic when you export the report to excel.

####%
Note: Unfortunately, this does not lock down to a max of 4 characters (like I would expect/wanted), but it's close enough.

Related

Displaying mysql string outputs in wordpress

Can anyone tell me how to display something like this in wordpress? I know the SQL code for it, just not how to display it in Wordpress. Ive tried to google plug ins etc with no luck.
You can try NUMBER_FORMAT or MONEY_FORMAT functions of PHP and format your data before displaying it on page. You do not need to rely on sql.
Number Format
Money Format
If you insist using sql and try showing data as it comes from database you can query your data as shown below.
FORMAT()
CONCAT('$', FORMAT(VAL, 2))
I'm not quite familiar with wordpress html editor but I think you can do something like this:
Make an <input> field with text type, remove the borders and set as read-only. Then send the value from sql query - make sure the value looked exactly as you want it - according to your example there, the value should be '$6,621,280'. Use that value to show in the <input> field.
Refer to this jsfiddle example : https://jsfiddle.net/6vqhc1sL/3/

SSRS Format Number Separator

I have a field in SSRS that returns the value of numbers varying from ## to #######. I want these numbers to be separated by thousands. I have seen a few posts saying you could use this:
=Format(Fields!Number.Value,"#,#.##")
However, I have this textbox to display data from a different dataset, like:
=First(Fields!Price.Value, "DataSet3")
Now, the question is how do I combine both? Is it possible to wrap it like this:
=Format(First(Fields!Price.Value, "DataSet3"),"#,#.##")
If I do this and run the report then the output on the text field is just #,#.## and not the actual number itself.
Input: 100000000
Output that I expect: 100,000,000
Output that I get: #,#.##
Any help is much appreciated. Thanks!
This is definitely some weird functionality. I didn't figure out exactly what was causing it, but I found that adding a datatype cast to the expression resolved the issue.
=FORMAT(CDec(First(Fields!XYZColumn.Value, "ZYXTable")), "#,#.##")

Is there a solution for localizing "parameters/prompt" in SSRS 2008 R2 or 2012?

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.

Access 2007 - Using results of an equation inside another equation on a report

I inserted three text boxes to test how this could work:
Text81: =1
Text82: =2
Text83: I want this one to be the sum of Text81 and Text82
Thanks in advance for your help on what I think is a pretty simple problem.
There are a couple options that spring to mind.
First you could always modify the data source for the report to include the calculated field.
Second, which is what your question drives at, you can do something like this:
=[Text81] + [Text82]
Should work when typed into the Control Source of a TextBox provided Text81 and Text82 are the data field names from the Data Source of the Report. If they are not you would put the corresponding data field names in the square brackets []
Hope this helps

In Access VBA expression builder, how do I sum a column conditionally?

Let's say I have two fields A and B and one textbox B_input. I would like to set up a query so it sums all entries of column A where B = B_input
Currently I have:
==Sum(IIf([B_input]<>"All",[A],IIf([B_input]<>[B],0,[A])))
I did more testing, it seem the problem is that under Sum(IIF([B_input])), it's not recognizing the value of [B_input], but if I just have IIF([B_input]), it recognize the value just fine, any ideas?
iif([B_input]=="xyz",Sum[A],False)
Might be what you're after but I'm not sure i understood your question properly.
Alternatively, just edit the sql to something like
SELECT(SUM[A]) AS SumOfA FROM [MyTable] HAVING ("B"="xyz");
How about:
=Sum(IIf([B_input]<>"All",[A],0))
Gave up, went with form filtering instead.