Showing posts with label expression. Show all posts
Showing posts with label expression. Show all posts

Thursday, March 22, 2012

Changing the Currency with Reporting Services

Hi,

I am formatting a currency field within reporting services using an expression. However i get the $ sign. I need the £ sign. How can i change this?

Thanks

David

Weird. It seems that once you wrap the FormatCurrency() Vb function, the localization goes out the window

Two workarounds
A)
1. Kill the FormatCurrency Wrapper function in your expression.
2. Use the Format Property of the texbox instead..so Format might equal C2 (for currency with 2 decimal places of precision.
3. Set your Language to English (United Kingdom) - found in Properties, in the International group

B)
If you simply MUST have the FormatCurrency wrapper then do the following
1. Wrap that expression in a CDBL()...so CDBL(FormatCurrency(blah))
2. Follow 2 & 3 in the steps for option A


Cheers


changing textbox expression based on column value

Please forgive what I'm sure is a novice question but I've only been
playing around with Reporting Svcs for a few days.
I have a report that's rendered from a stored procedure (no prob there
- works quite nicely). One of the grouping variables, Type, has values
such as "SS_F", "SS_P" and the like.
Naturally what I'd like to do is assign meaningful labels to these
values. Since there are only a few of them and they're static for the
report - that is, the same 4 values (well, up to 4 .. perhaps only 2 or
3 in any given run) would be returned on any run of the stored proc.
Where do I do that' Or do I need to make the assignments in code? If
so, how do I get there? And before suggesting that I do them in the
sp, I can't - it's not mine to touch :)
Thanks so much for any help!
-Steve LordYou would put in a nested iif statement. RS 2005 books online didn't have an
index listing for that but you could search on the phrase conditional
formatting
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Steve L" <slord@.circlesofcare.org> wrote in message
news:1141419699.794514.9160@.e56g2000cwe.googlegroups.com...
> Please forgive what I'm sure is a novice question but I've only been
> playing around with Reporting Svcs for a few days.
> I have a report that's rendered from a stored procedure (no prob there
> - works quite nicely). One of the grouping variables, Type, has values
> such as "SS_F", "SS_P" and the like.
> Naturally what I'd like to do is assign meaningful labels to these
> values. Since there are only a few of them and they're static for the
> report - that is, the same 4 values (well, up to 4 .. perhaps only 2 or
> 3 in any given run) would be returned on any run of the stored proc.
> Where do I do that' Or do I need to make the assignments in code? If
> so, how do I get there? And before suggesting that I do them in the
> sp, I can't - it's not mine to touch :)
> Thanks so much for any help!
> -Steve Lord
>|||Here's what I had for changing the image used in a report:
=Switch(Fields!PDPType.Value="Bug", "http://localhost/images/bug.gif",
Fields!PDPType.Value="Customization Request",
"http://localhost/images/customization.gif", Fields!PDPType.Value="New
Feature/Enhancement", "http://localhost/images/enhancement.gif",
Fields!PDPType.Value="Script Request", "http://localhost/images/script.gif",
Fields!PDPType.Value="Support Request", http://localhost/images/support.GIF)
Should work for a text field too, I think. Sorry if I'm not understanding
your original question, though, or if you run into another snag. I'm rather
a newbie at the RS stuff myself.
Clint
"Steve L" <slord@.circlesofcare.org> wrote in message
news:1141419699.794514.9160@.e56g2000cwe.googlegroups.com...
> Please forgive what I'm sure is a novice question but I've only been
> playing around with Reporting Svcs for a few days.
> I have a report that's rendered from a stored procedure (no prob there
> - works quite nicely). One of the grouping variables, Type, has values
> such as "SS_F", "SS_P" and the like.
> Naturally what I'd like to do is assign meaningful labels to these
> values. Since there are only a few of them and they're static for the
> report - that is, the same 4 values (well, up to 4 .. perhaps only 2 or
> 3 in any given run) would be returned on any run of the stored proc.
> Where do I do that' Or do I need to make the assignments in code? If
> so, how do I get there? And before suggesting that I do them in the
> sp, I can't - it's not mine to touch :)
> Thanks so much for any help!
> -Steve Lord
>

Tuesday, March 20, 2012

changing subtotal expression

Hello,

I'm using a matrix report to display scores for certain items on certain criteria.
The items are on the left and the criteria at the top.

Now I would like to have some sort of subtotal row at the end of each group of items that displays the average value of all the scores for that group and not simply adds up the scores.
The built-in subtotal just adds up the scores, where I want the average value to be displayed.

Isn't there an easy way to change the subtotal expression and make it calculate the average value instead of the sum?

Thank you for your time,

Kenny

Yes this can be done through the InScope function. Please read this related thread: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=276213&SiteID=1

-- Robert

Friday, February 10, 2012

Changing data types of a variable in an expression

Greetings once again SQL friends,

Sorry to bug you with my silly questions but this little problem has been driving me crazy for the last hour or so!

I am attempting to change the data type of a variable in an expression but I keep getting an error saying that the expression can not be evaluated.

The syntax I am using is as follows :

(dt_str) @.[User::MAX_OFFER_PRICE_ID]

My variable MAX_OFFER_PRICE_ID is type int32 and I am attempting to cast it as a string.

What am I doing wrong?!

Thanks for your help in advance.

Try,

(dt_str, 6, 1252) @.[User::MAX_OFFER_PRICE_ID]

If you're using the expression builder then expand "Type Casts" in the top right hand corner and you'll see the required syntax.

-Jamie

|||

Hi Jamie,

You are my SSIS hero now

Thanks very much mate.

|||

Hi Jamie,

Just wondering, if I want to use retrieve another value from a different table, would I have to create yet another SourceSQL variable?! I am trying to think of a method that would allow me to re-use the sqlSource rather than create a new one.

My initial thoughts (after some reading) is to use a configuration file but I have not figured out the finer details of this solution.. God help me!!

Have you come across this kind of thing before? Do you have any suggestions?

Please forgive me for pestering you with my questions but I am eager to learn as much as I can about this great tool. As much as I am annoyed (for spending ages tryi8ng to work out simple thigs), I am even more determined to learn more about this beast of a tool.

Thanks for all the advice.

|||

You say "yet another SourceSQL variable" as if its a bad thing :)

If you need to extract data from a different table then create another variable - no problem with doing that.

-Jamie

|||

Hello there,

I have read your questions and i must say that i sympathize with you alot!!!

I have spent hours trying to figure out the logic behind the syntax and i must say that even though the examples appear simple in books online, they become complex to decipher when I start to get these error messages from the parser.

would you be able to share with me some of the simple syntax logic behind these expressions?

Thank you!!

|||

The syntax will likely appear familiar to C programmers, as the grammar is similar to the C language. Beyond that, the books online has a pretty good reference.

If you run into any specific errors that perplex you, please do post the expression and the error message on these forums. Most likely someone will be able to help you, and furthermore it will help the SSIS team identify cases where the error messages are not as helpful as they should be.

Thanks
Mark

Changing data types of a variable in an expression

Greetings once again SQL friends,

Sorry to bug you with my silly questions but this little problem has been driving me crazy for the last hour or so!

I am attempting to change the data type of a variable in an expression but I keep getting an error saying that the expression can not be evaluated.

The syntax I am using is as follows :

(dt_str) @.[User::MAX_OFFER_PRICE_ID]

My variable MAX_OFFER_PRICE_ID is type int32 and I am attempting to cast it as a string.

What am I doing wrong?!

Thanks for your help in advance.

Try,

(dt_str, 6, 1252) @.[User::MAX_OFFER_PRICE_ID]

If you're using the expression builder then expand "Type Casts" in the top right hand corner and you'll see the required syntax.

-Jamie

|||

Hi Jamie,

You are my SSIS hero now

Thanks very much mate.

|||

Hi Jamie,

Just wondering, if I want to use retrieve another value from a different table, would I have to create yet another SourceSQL variable?! I am trying to think of a method that would allow me to re-use the sqlSource rather than create a new one.

My initial thoughts (after some reading) is to use a configuration file but I have not figured out the finer details of this solution.. God help me!!

Have you come across this kind of thing before? Do you have any suggestions?

Please forgive me for pestering you with my questions but I am eager to learn as much as I can about this great tool. As much as I am annoyed (for spending ages tryi8ng to work out simple thigs), I am even more determined to learn more about this beast of a tool.

Thanks for all the advice.

|||

You say "yet another SourceSQL variable" as if its a bad thing :)

If you need to extract data from a different table then create another variable - no problem with doing that.

-Jamie

|||

Hello there,

I have read your questions and i must say that i sympathize with you alot!!!

I have spent hours trying to figure out the logic behind the syntax and i must say that even though the examples appear simple in books online, they become complex to decipher when I start to get these error messages from the parser.

would you be able to share with me some of the simple syntax logic behind these expressions?

Thank you!!

|||

The syntax will likely appear familiar to C programmers, as the grammar is similar to the C language. Beyond that, the books online has a pretty good reference.

If you run into any specific errors that perplex you, please do post the expression and the error message on these forums. Most likely someone will be able to help you, and furthermore it will help the SSIS team identify cases where the error messages are not as helpful as they should be.

Thanks
Mark