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")), "#,#.##")
Related
I have an SSRS report that is rounding currency and I need the report to show the actual value. When I run the query in query designer all the values are shown correctly. If I output this to Excel and SUM the values I get the total I expect (e.g £56724.30)
When I run the report I get the value £56840.00 so it looks as if the data being used is getting rounded before output.
I have a Calculated field in the report called Total_Rent_Due_UC_Claims:
=iif(Fields!UC_Rent.Value = Fields!LastCharge.Value, Fields!UC_Rent.Value, 0) or
iif(Fields!UC_Rent_Date.Value = Fields!LastCharge.Value and
Fields!extra10a_d003.Value < Parameters!AsAtDate.Value, 0, Fields!UC_Rent_Date.Value)
I then use this to get a total:
=Sum(Fields!Total_Rent_Due_UC_Claims.Value)
I have formatted this field to currency to two decimal places.
Can someone assist with this so that the value in the report is the same as the expected value?
I don't think this difference can be attributed to rounding -- at least not any rounding I've ever seen before. That's a difference of £115.70. I think the calculated field isn't quite doing what you want it to and needs a little modification. I'm not exactly sure what it's doing right now, but basically both of those IIF statements will evaluate because OR doesn't really work the way you have it. I would try the following expression.
=IIF(Fields!UC_Rent.Value = Fields!LastCharge.Value,
Fields!UC_Rent.Value, IIF(Fields!UC_Rent_Date.Value = Fields!LastCharge.Value
AND Fields!extra10a_d003.Value < Parameters!AsAtDate.Value, 0, Fields!UC_Rent_Date.Value))
Of course, this could still be wrong as I can't tell if all of the fields are date datatypes or if there's some kind of mismatch going on here. Let me know if this doesn't work and I'll see if I can adjust it.
I am creating a report, the purpose of which is to print a letter to many different people. Obviously each person's name, email, etc. will be different. For this I am using a list, which I understand uses a tablix.
Now inside each letter I also need some global data that comes from a dataset. For example, the company email, telephone number, etc. This data will be the same for every letter. However, every time I try to use some expression to get this, I get an error such as:
The Value expression for the text box ‘Textbox11’ refers to the
field ‘URL’. Report item expressions can only refer to fields within
the current dataset scope or, if inside an aggregate, the specified
dataset scope. Letters in the names of fields must use the correct
case.
The expression I'm using to get the above error is
=LookupSet(true, true, Fields!URL, "SystemVars")
I've tried other things but I can't figure out what I need to make it word.
Is there an expression I can use to solve this problem? If not, what steps should I take to get my letters working?
You are missing the ".Value" portion in the expression. Try this:
=First(Fields!URL.Value, "SystemVars")
I am having a few issues using SSRS-Reports 2005.
The first one is I am trying to use the datediff function to change the background color of a cell based on the two dates being within 30 days of each other.
=iif(
DateDiff("d",DateString,Fields!Insurance_Certificate.Value)<= 30, "Tan", "White"
)
I have my fields formatted through the initial query so they look like mm/dd/yyyy. I guess my first question is how do I see what value is being evaluated because whatever this is returning can't be right.
my [...] question is how do I see what value is being evaluated
There is no real "debugger" available like you would have in -say- a WinForms C# app. Instead, you have several "raw" "debugging" options:
Render Fields!Insureance_Certificate.Value in a seperate cell, as text
Render DateDiff("d",DateString,Fields!Insurance_Certificate.Value) in a seperate cell, as text
Right-click your dataset, select "Query...", and execute the query manually. Inspect the values for your field. Make sure they're what you'd expect.
Render your DateString in a seperate cell, with and without a cast to a date.
Other than that #MarkBannister has a great suggestion, using actual Dates as opposed to strings for your fields and variables. One additional thing to note about this, is that date parsing may be culture-specific. Be sure you understand and know in what culture your DateString is being parsed. The above "debugging" options may help you find out.
I suggest querying your date fields as dates (instead of as strings), comparing them using the DateDiff function as in the question and formatting the date output using the Format property of the appropriate textboxes in SSRS.
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
I have the details of my report being summed up in a summary expression, all works fine. The fields are decimal values of hours worked. Thus, the summary value is also a decimal value. I'd like to access the summary value and convert it to hours / minutes. I've labeled the express as "WorkTimeSum", but can't seem to get a handle to it, however. Fields! obviously won't work since it is a summary expression. I was thinking ReportItems! should work, but to no avail. How can I use this expression field (in a summary row) in an expression in the same summary row?
If I've understood correctly, you're asking how to reference the textbox containing the total work hours value so that you can convert it to hours and minutes using an expression in a different textbox?
You can use either ReportItems! e.g.
=ReportItems!Textbox20.Value)
or ReportItems("") e.g.
=ReportItems("Textbox20").Value
to reference the value of another textbox. Be careful with the names as they are case sensitive.
You can use aggregate functions in any expression. For example, in any header rows you can use the following expression to determine the total hours value:
=Floor(Sum(Fields!hours.Value))
Sum(Fields!hours.Value) is just the total hours in whatever context, e.g. the group total if it's a group header row; you can use this expression as an input in any other expression you require.
It sounds like your issue wasn't the conversion itself, so hopefully this points you in the right direction. If you need further information please specify.