Showing posts with label point. Show all posts
Showing posts with label point. Show all posts

Tuesday, March 27, 2012

Forms Based Authentication

Sorry to revive a previously discussed point, I've been trying to get my head around the http://msdn.microsoft.com/library/?url=/library/en-us/dnsql2k/html/ufairs.asp?frame=true#ufairs_topic3 article given in a previous post. I think this is the solution we require but it raises a few issues that I would like some help on. What we are trying to do, is when the user logs on to the .net application, he is authenicated on the report server at the same time. So the user only sees one authenication process and is assigned a role from the report server to limit his/her access to reports. The user credentials at the moment are kept separate to the reportserver, i.e a different datasource and this will be modified slightly to include the report server role mappings. Access to reports is done using a slightly customised ReportViewer control included with SRS.

1. In the development environment we obviously publish different reports for differing clients. These reports are driven from differing databases and so are the user credentials for the application. Is it possible to develop a solution to encapsulate this need? I was thinking of one security extension that accepts the name of the application as a parameter and changes behaviour based on that. I'll probably use the authority parameter?

If I have completely missed the point here, please let me know!!!

Thanks in advance,

Mike.You could store the credentials required for each report in the report server.
And you could give selective permissions to the various folder/reports in the server.
Would that satisfy the requirements?

Thanks
Tudorsql

Forms authentication fun

Anyway, I finally get forms authentication up and working (I think). I use the included example. I finally get to the point where I register a user. Then I modify the rsreportservice.config file to make the new user the 'admin' user. Now when I login, I have no permissions to anything. I restart the entire server. Now when I login I get a "Key cannot be null. Parameter name: key:". Any ideas here? Why the heck didn't ms just bake forms authentication as a selectable option! It is so complicated to setup, you have to modify like a bjillion config files.

I had exactly the same problem today.

Are you using the VB code sample? I usually code in C# but the customer I'm working with prefers VB so I used the VB sample solution and got the error you mention.

Using the C# sample solution instead works fine, in theory you should be able to just build the C# solution and drop the assembly in the appropriate folders.

I've not had a chance to take a look at what the difference is between the VB/C# solutions yet but that should get you going.

Totally agree with the config file madness.

Cheers,

Keith.

|||

Keith,

The problem is that the FormsAuthentication sample is incomplete and simply does not work. Only with help from other people on the forum was I able to get it working. I can email some working sample code to you if you wish.

|||

Hello Jon,

Can you send me some working example of FormsAuthentication?
A try Microsoft's example, but, isn’t working :(

Thanks!

Forms authentication fun

Anyway, I finally get forms authentication up and working (I think). I use the included example. I finally get to the point where I register a user. Then I modify the rsreportservice.config file to make the new user the 'admin' user. Now when I login, I have no permissions to anything. I restart the entire server. Now when I login I get a "Key cannot be null. Parameter name: key:". Any ideas here? Why the heck didn't ms just bake forms authentication as a selectable option! It is so complicated to setup, you have to modify like a bjillion config files.

I had exactly the same problem today.

Are you using the VB code sample? I usually code in C# but the customer I'm working with prefers VB so I used the VB sample solution and got the error you mention.

Using the C# sample solution instead works fine, in theory you should be able to just build the C# solution and drop the assembly in the appropriate folders.

I've not had a chance to take a look at what the difference is between the VB/C# solutions yet but that should get you going.

Totally agree with the config file madness.

Cheers,

Keith.

|||

Keith,

The problem is that the FormsAuthentication sample is incomplete and simply does not work. Only with help from other people on the forum was I able to get it working. I can email some working sample code to you if you wish.

|||

Hello Jon,

Can you send me some working example of FormsAuthentication?
A try Microsoft's example, but, isn’t working :(

Thanks!

Friday, March 23, 2012

Formatting Query Data

When I run queries against tables in MSSQL2000 it returns dates with a time component and has way too many zeros after the decimal point.

Is there any functions or something I can put in the query so my data comes back with only a date for the date and only two decimal points for the numbers?You are generally best off leaving the formatting to the code that receives the data from the database. But you can use the Convert function to format a date and the round function for numeric values.


SELECT Convert(varchar,DateField,101),Round(NumericField,2)
FROM YourTable

However, Round may not work quite as you expect. It will round the value but not necessarily format it for display as you might expect. Other date formats are available, check Sql Server Books OnLine under the convert function for the options.|||I agree with McMurdo, however, that the best place to handle this is outside of the database, in your code that is displaying the data.|||I agree, this is what I wanted - the ability to have the data formatted correctly from SQL. I tried for ages to find a way to do that on the basis of what I new about MySQL (which has a lot of functions for this).

But I'll look into it, as ideally I want my data coming in right from the SQL Query, rather than .Net doing it. Indeed, there is another thread in another forum arguing that as people kept giving me the whole Eval solution.|||Can you strip trailing spaces as well - I have a CUSTNMBR that is 5 characters long put it pads it with four spaces to to make it 9 (the length of the field).

I'll investigate the day, so I may have the answer this morning (UK Time).|||Use RTRIM or LTRIM to strip spaces.sql

Formatting point labels on a stacked column chart

I have a stacked column chart with two series. The chart by default is
showing point labels in the middle of the bar for each series for each
category on X-axis. I also need to have a label at the top of each
stacked column repesenting sum of Y values for each X value. So if one
series Y value is 5 and second 10 for a particular X value, I need to
show both point labels and a third label at the top of the column
showing 15. Thank you for any feedback.Alibronek,
On the data tab of the chart properties add a new value to the chart, with
the expression of field1 + field2. On the appearance tab check the plot data
as line. This will give you a line above the bars, if you play around with
the markers and style you should be able to hide the line and only show the
markes.
AK Code Rat
"Alibronek" wrote:
> I have a stacked column chart with two series. The chart by default is
> showing point labels in the middle of the bar for each series for each
> category on X-axis. I also need to have a label at the top of each
> stacked column repesenting sum of Y values for each X value. So if one
> series Y value is 5 and second 10 for a particular X value, I need to
> show both point labels and a third label at the top of the column
> showing 15. Thank you for any feedback.
>sql

Monday, March 19, 2012

Formatting columns for a flat file destination control

So i've created a flat file destination control and have mapped the columns. At what point can you control which column shows up first?

cheston wrote:

So i've created a flat file destination control and have mapped the columns. At what point can you control which column shows up first?

In the advanced section of the Flat File Connection Manager screen.|||I do not see an option to move the columns and dragging them does not work either.
|||

cheston wrote:

I do not see an option to move the columns and dragging them does not work either.

Nope. You have to define them in the desired order first.|||If that's too painful, it might worth a try to edit the .dtsx file itself and reorder the DTS:FlatFileColumn elements.

Friday, March 9, 2012

Formating a numeric string, that is sometimes text

The old string didn't move up when I replied to it, so copied the information
into this new question
----
OK -- this works to a point. I have real string data in my field that I want
to display, if the field is not "isnumeric". So, here is the code I am using:
=iif(isnumeric(Fields!Q4Amt.Value),
Format(convert.ToDouble(Fields!Q4Amt.Value),
"$###,###,##0.00;($###,###,##0.00);$0.00"), "N/A")
Every time the N/A is supposed to be displayed, I get an error message.
Thanks for any and all help
"Teo Lachev [MVP]" wrote:
> =Iif (Fields!phone.Value Is Nothing, Nothing,
> Format(Convert.ToDouble(Fields!phone.Value), "(###) ###-#### 'Ext.' ####"))
>
> --
> HTH,
> ---
> Teo Lachev, MVP, MCSD, MCT
> "Microsoft Reporting Services in Action"
> "Applied Microsoft Analysis Services 2005"
> Home page and blog: http://www.prologika.com/
> ---
> "rybrown1818" <rybrown1818@.discussions.microsoft.com> wrote in message
> news:03C42C02-DBFD-44AA-A297-FEA74C6ACB29@.microsoft.com...
> > okay great. I used the first example. Thanks!
> > Now i have discovered that there are some rows without phone numbers.
> > How do I do an IIF statement, that will return the formatted phone number
> > and not available when there is no phone number?
> >
> > "Teo Lachev [MVP]" wrote:
> >
> >> = Format(Convert.ToDouble("90155585850000"), "(###) ###-#### 'Ext.'
> >> ####")
> >>
> >> or use a regular expression, sth like
> >>
> >> =System.Text.RegularExpressions.Regex.Replace(Fields!phone.Value,
> >> "(\d{3})(\d{3})(\d{4})", "($1) $2-$3")
> >>
> >> --
> >> HTH,
> >> ---
> >> Teo Lachev, MVP, MCSD, MCT
> >> "Microsoft Reporting Services in Action"
> >> "Applied Microsoft Analysis Services 2005"
> >> Home page and blog: http://www.prologika.com/
> >> ---
> >> "rybrown1818" <rybrown1818@.discussions.microsoft.com> wrote in message
> >> news:E8FFA4A2-0CEF-4AF5-9CCB-ED08E8DCBE51@.microsoft.com...
> >> > how can i format a phone number to be displayed as follows in the
> >> > report
> >> > (678) 444-4444
> >> >
> >> > Thanks!
> >>
> >>
> >>
>
>
>This will happen because of the nature of IIF. IIF calculates both the true
and false values before choosing which one to display. So it actually is
failing because in the background it trys to convert the string to a double
and return the value. Writing Custom Code to take advantage of the real IF
function is a way around this.
If you know VB its pretty simple.
report->report properties-> code tab->
Public Function checkstr(ByVal testval As String)
IF Char.IsNumber(testval, 0) THEN
return CDbl(testval)
ELSE
return "N/A"
END IF
End Function
Then apply the formatting in the textbox you want N/A Displayed in and have
your text box state the following
=Code.checkstr(Fields!Q4Amt.Value)
-Michael Abair
Programmer Analyst
Chicos FAS Inc.
"msflinx" <msflinx@.discussions.microsoft.com> wrote in message
news:7F943183-B6BD-46CF-9CAF-AFF73834DAE5@.microsoft.com...
> The old string didn't move up when I replied to it, so copied the
> information
> into this new question
> ----
> OK -- this works to a point. I have real string data in my field that I
> want
> to display, if the field is not "isnumeric". So, here is the code I am
> using:
> =iif(isnumeric(Fields!Q4Amt.Value),
> Format(convert.ToDouble(Fields!Q4Amt.Value),
> "$###,###,##0.00;($###,###,##0.00);$0.00"), "N/A")
> Every time the N/A is supposed to be displayed, I get an error message.
> Thanks for any and all help
> "Teo Lachev [MVP]" wrote:
>> =Iif (Fields!phone.Value Is Nothing, Nothing,
>> Format(Convert.ToDouble(Fields!phone.Value), "(###) ###-#### 'Ext.'
>> ####"))
>> --
>> HTH,
>> ---
>> Teo Lachev, MVP, MCSD, MCT
>> "Microsoft Reporting Services in Action"
>> "Applied Microsoft Analysis Services 2005"
>> Home page and blog: http://www.prologika.com/
>> ---
>> "rybrown1818" <rybrown1818@.discussions.microsoft.com> wrote in message
>> news:03C42C02-DBFD-44AA-A297-FEA74C6ACB29@.microsoft.com...
>> > okay great. I used the first example. Thanks!
>> > Now i have discovered that there are some rows without phone numbers.
>> > How do I do an IIF statement, that will return the formatted phone
>> > number
>> > and not available when there is no phone number?
>> >
>> > "Teo Lachev [MVP]" wrote:
>> >
>> >> = Format(Convert.ToDouble("90155585850000"), "(###) ###-#### 'Ext.'
>> >> ####")
>> >>
>> >> or use a regular expression, sth like
>> >>
>> >> =System.Text.RegularExpressions.Regex.Replace(Fields!phone.Value,
>> >> "(\d{3})(\d{3})(\d{4})", "($1) $2-$3")
>> >>
>> >> --
>> >> HTH,
>> >> ---
>> >> Teo Lachev, MVP, MCSD, MCT
>> >> "Microsoft Reporting Services in Action"
>> >> "Applied Microsoft Analysis Services 2005"
>> >> Home page and blog: http://www.prologika.com/
>> >> ---
>> >> "rybrown1818" <rybrown1818@.discussions.microsoft.com> wrote in message
>> >> news:E8FFA4A2-0CEF-4AF5-9CCB-ED08E8DCBE51@.microsoft.com...
>> >> > how can i format a phone number to be displayed as follows in the
>> >> > report
>> >> > (678) 444-4444
>> >> >
>> >> > Thanks!
>> >>
>> >>
>> >>
>>
>|||I like your solution better than mine Michael... kudos! :)
=-Chris
"Michael Abair" <michael.abair@.chicos.com> wrote in message
news:OTxLAxH9GHA.4224@.TK2MSFTNGP02.phx.gbl...
> This will happen because of the nature of IIF. IIF calculates both the
> true and false values before choosing which one to display. So it
> actually is failing because in the background it trys to convert the
> string to a double and return the value. Writing Custom Code to take
> advantage of the real IF function is a way around this.
> If you know VB its pretty simple.
> report->report properties-> code tab->
>
> Public Function checkstr(ByVal testval As String)
> IF Char.IsNumber(testval, 0) THEN
> return CDbl(testval)
> ELSE
> return "N/A"
> END IF
> End Function
> Then apply the formatting in the textbox you want N/A Displayed in and
> have your text box state the following
> =Code.checkstr(Fields!Q4Amt.Value)
> -Michael Abair
> Programmer Analyst
> Chicos FAS Inc.
>
> "msflinx" <msflinx@.discussions.microsoft.com> wrote in message
> news:7F943183-B6BD-46CF-9CAF-AFF73834DAE5@.microsoft.com...
>> The old string didn't move up when I replied to it, so copied the
>> information
>> into this new question
>> ----
>> OK -- this works to a point. I have real string data in my field that I
>> want
>> to display, if the field is not "isnumeric". So, here is the code I am
>> using:
>> =iif(isnumeric(Fields!Q4Amt.Value),
>> Format(convert.ToDouble(Fields!Q4Amt.Value),
>> "$###,###,##0.00;($###,###,##0.00);$0.00"), "N/A")
>> Every time the N/A is supposed to be displayed, I get an error message.
>> Thanks for any and all help
>> "Teo Lachev [MVP]" wrote:
>> =Iif (Fields!phone.Value Is Nothing, Nothing,
>> Format(Convert.ToDouble(Fields!phone.Value), "(###) ###-#### 'Ext.'
>> ####"))
>> --
>> HTH,
>> ---
>> Teo Lachev, MVP, MCSD, MCT
>> "Microsoft Reporting Services in Action"
>> "Applied Microsoft Analysis Services 2005"
>> Home page and blog: http://www.prologika.com/
>> ---
>> "rybrown1818" <rybrown1818@.discussions.microsoft.com> wrote in message
>> news:03C42C02-DBFD-44AA-A297-FEA74C6ACB29@.microsoft.com...
>> > okay great. I used the first example. Thanks!
>> > Now i have discovered that there are some rows without phone numbers.
>> > How do I do an IIF statement, that will return the formatted phone
>> > number
>> > and not available when there is no phone number?
>> >
>> > "Teo Lachev [MVP]" wrote:
>> >
>> >> = Format(Convert.ToDouble("90155585850000"), "(###) ###-#### 'Ext.'
>> >> ####")
>> >>
>> >> or use a regular expression, sth like
>> >>
>> >> =System.Text.RegularExpressions.Regex.Replace(Fields!phone.Value,
>> >> "(\d{3})(\d{3})(\d{4})", "($1) $2-$3")
>> >>
>> >> --
>> >> HTH,
>> >> ---
>> >> Teo Lachev, MVP, MCSD, MCT
>> >> "Microsoft Reporting Services in Action"
>> >> "Applied Microsoft Analysis Services 2005"
>> >> Home page and blog: http://www.prologika.com/
>> >> ---
>> >> "rybrown1818" <rybrown1818@.discussions.microsoft.com> wrote in
>> >> message
>> >> news:E8FFA4A2-0CEF-4AF5-9CCB-ED08E8DCBE51@.microsoft.com...
>> >> > how can i format a phone number to be displayed as follows in the
>> >> > report
>> >> > (678) 444-4444
>> >> >
>> >> > Thanks!
>> >>
>> >>
>> >>
>>
>>
>|||Thank you Michael. Didn't quite do to trick, but put me in the right
direction.
This is the code I ended up with in the Report Property's Code Tab:
Public Function NumericStringToCurrencyString(ByVal strPhrase as string) as
string
if isnumeric(strPhrase) then
NumericStringToCurrencyString =format(cdec(strPhrase),"$###,###,###.##;($###,###,###.##);$0.00")
else
NumericStringToCurrencyString = strPhrase
end if
end function
Then I called it like you wrote in the field and Viola!!! It worked.
Thank you ever so much.
"Michael Abair" wrote:
> This will happen because of the nature of IIF. IIF calculates both the true
> and false values before choosing which one to display. So it actually is
> failing because in the background it trys to convert the string to a double
> and return the value. Writing Custom Code to take advantage of the real IF
> function is a way around this.
> If you know VB its pretty simple.
> report->report properties-> code tab->
>
> Public Function checkstr(ByVal testval As String)
> IF Char.IsNumber(testval, 0) THEN
> return CDbl(testval)
> ELSE
> return "N/A"
> END IF
> End Function
> Then apply the formatting in the textbox you want N/A Displayed in and have
> your text box state the following
> =Code.checkstr(Fields!Q4Amt.Value)
> -Michael Abair
> Programmer Analyst
> Chicos FAS Inc.
>
> "msflinx" <msflinx@.discussions.microsoft.com> wrote in message
> news:7F943183-B6BD-46CF-9CAF-AFF73834DAE5@.microsoft.com...
> > The old string didn't move up when I replied to it, so copied the
> > information
> > into this new question
> > ----
> >
> > OK -- this works to a point. I have real string data in my field that I
> > want
> > to display, if the field is not "isnumeric". So, here is the code I am
> > using:
> >
> > =iif(isnumeric(Fields!Q4Amt.Value),
> > Format(convert.ToDouble(Fields!Q4Amt.Value),
> > "$###,###,##0.00;($###,###,##0.00);$0.00"), "N/A")
> >
> > Every time the N/A is supposed to be displayed, I get an error message.
> >
> > Thanks for any and all help
> >
> > "Teo Lachev [MVP]" wrote:
> >
> >> =Iif (Fields!phone.Value Is Nothing, Nothing,
> >> Format(Convert.ToDouble(Fields!phone.Value), "(###) ###-#### 'Ext.'
> >> ####"))
> >>
> >> --
> >> HTH,
> >> ---
> >> Teo Lachev, MVP, MCSD, MCT
> >> "Microsoft Reporting Services in Action"
> >> "Applied Microsoft Analysis Services 2005"
> >> Home page and blog: http://www.prologika.com/
> >> ---
> >> "rybrown1818" <rybrown1818@.discussions.microsoft.com> wrote in message
> >> news:03C42C02-DBFD-44AA-A297-FEA74C6ACB29@.microsoft.com...
> >> > okay great. I used the first example. Thanks!
> >> > Now i have discovered that there are some rows without phone numbers.
> >> > How do I do an IIF statement, that will return the formatted phone
> >> > number
> >> > and not available when there is no phone number?
> >> >
> >> > "Teo Lachev [MVP]" wrote:
> >> >
> >> >> = Format(Convert.ToDouble("90155585850000"), "(###) ###-#### 'Ext.'
> >> >> ####")
> >> >>
> >> >> or use a regular expression, sth like
> >> >>
> >> >> =System.Text.RegularExpressions.Regex.Replace(Fields!phone.Value,
> >> >> "(\d{3})(\d{3})(\d{4})", "($1) $2-$3")
> >> >>
> >> >> --
> >> >> HTH,
> >> >> ---
> >> >> Teo Lachev, MVP, MCSD, MCT
> >> >> "Microsoft Reporting Services in Action"
> >> >> "Applied Microsoft Analysis Services 2005"
> >> >> Home page and blog: http://www.prologika.com/
> >> >> ---
> >> >> "rybrown1818" <rybrown1818@.discussions.microsoft.com> wrote in message
> >> >> news:E8FFA4A2-0CEF-4AF5-9CCB-ED08E8DCBE51@.microsoft.com...
> >> >> > how can i format a phone number to be displayed as follows in the
> >> >> > report
> >> >> > (678) 444-4444
> >> >> >
> >> >> > Thanks!
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
> >
>
>|||Much Appreciated!
"Chris Conner" <Chris.Conner@.NOSPAMPolarisLibrary.com> wrote in message
news:O0$$x0H9GHA.3264@.TK2MSFTNGP04.phx.gbl...
>I like your solution better than mine Michael... kudos! :)
> =-Chris
> "Michael Abair" <michael.abair@.chicos.com> wrote in message
> news:OTxLAxH9GHA.4224@.TK2MSFTNGP02.phx.gbl...
>> This will happen because of the nature of IIF. IIF calculates both the
>> true and false values before choosing which one to display. So it
>> actually is failing because in the background it trys to convert the
>> string to a double and return the value. Writing Custom Code to take
>> advantage of the real IF function is a way around this.
>> If you know VB its pretty simple.
>> report->report properties-> code tab->
>>
>> Public Function checkstr(ByVal testval As String)
>> IF Char.IsNumber(testval, 0) THEN
>> return CDbl(testval)
>> ELSE
>> return "N/A"
>> END IF
>> End Function
>> Then apply the formatting in the textbox you want N/A Displayed in and
>> have your text box state the following
>> =Code.checkstr(Fields!Q4Amt.Value)
>> -Michael Abair
>> Programmer Analyst
>> Chicos FAS Inc.
>>
>> "msflinx" <msflinx@.discussions.microsoft.com> wrote in message
>> news:7F943183-B6BD-46CF-9CAF-AFF73834DAE5@.microsoft.com...
>> The old string didn't move up when I replied to it, so copied the
>> information
>> into this new question
>> ----
>> OK -- this works to a point. I have real string data in my field that I
>> want
>> to display, if the field is not "isnumeric". So, here is the code I am
>> using:
>> =iif(isnumeric(Fields!Q4Amt.Value),
>> Format(convert.ToDouble(Fields!Q4Amt.Value),
>> "$###,###,##0.00;($###,###,##0.00);$0.00"), "N/A")
>> Every time the N/A is supposed to be displayed, I get an error message.
>> Thanks for any and all help
>> "Teo Lachev [MVP]" wrote:
>> =Iif (Fields!phone.Value Is Nothing, Nothing,
>> Format(Convert.ToDouble(Fields!phone.Value), "(###) ###-#### 'Ext.'
>> ####"))
>> --
>> HTH,
>> ---
>> Teo Lachev, MVP, MCSD, MCT
>> "Microsoft Reporting Services in Action"
>> "Applied Microsoft Analysis Services 2005"
>> Home page and blog: http://www.prologika.com/
>> ---
>> "rybrown1818" <rybrown1818@.discussions.microsoft.com> wrote in message
>> news:03C42C02-DBFD-44AA-A297-FEA74C6ACB29@.microsoft.com...
>> > okay great. I used the first example. Thanks!
>> > Now i have discovered that there are some rows without phone numbers.
>> > How do I do an IIF statement, that will return the formatted phone
>> > number
>> > and not available when there is no phone number?
>> >
>> > "Teo Lachev [MVP]" wrote:
>> >
>> >> = Format(Convert.ToDouble("90155585850000"), "(###) ###-#### 'Ext.'
>> >> ####")
>> >>
>> >> or use a regular expression, sth like
>> >>
>> >> =System.Text.RegularExpressions.Regex.Replace(Fields!phone.Value,
>> >> "(\d{3})(\d{3})(\d{4})", "($1) $2-$3")
>> >>
>> >> --
>> >> HTH,
>> >> ---
>> >> Teo Lachev, MVP, MCSD, MCT
>> >> "Microsoft Reporting Services in Action"
>> >> "Applied Microsoft Analysis Services 2005"
>> >> Home page and blog: http://www.prologika.com/
>> >> ---
>> >> "rybrown1818" <rybrown1818@.discussions.microsoft.com> wrote in
>> >> message
>> >> news:E8FFA4A2-0CEF-4AF5-9CCB-ED08E8DCBE51@.microsoft.com...
>> >> > how can i format a phone number to be displayed as follows in the
>> >> > report
>> >> > (678) 444-4444
>> >> >
>> >> > Thanks!
>> >>
>> >>
>> >>
>>
>>
>>
>|||You know, it never even occured to me that the logical IIF would do that...
that is evaluate the expression, and the false case...
i.e.
if a = 5 then is this fine...
=iif(IsNumeric(a), Format(Convert.ToDouble(a), "#"), "N/A")
if a = 'test' I would expect "N/A" to print out...
Of course I HAD to create a report to test it... and sure enough, it broke
the moment I put a text character in instead of a value.
Thanks for the great tip.
=-Chris
"Michael Abair" <michael.abair@.chicos.com> wrote in message
news:OTxLAxH9GHA.4224@.TK2MSFTNGP02.phx.gbl...
> This will happen because of the nature of IIF. IIF calculates both the
> true and false values before choosing which one to display. So it
> actually is failing because in the background it trys to convert the
> string to a double and return the value. Writing Custom Code to take
> advantage of the real IF function is a way around this.
> If you know VB its pretty simple.
> report->report properties-> code tab->
>
> Public Function checkstr(ByVal testval As String)
> IF Char.IsNumber(testval, 0) THEN
> return CDbl(testval)
> ELSE
> return "N/A"
> END IF
> End Function
> Then apply the formatting in the textbox you want N/A Displayed in and
> have your text box state the following
> =Code.checkstr(Fields!Q4Amt.Value)
> -Michael Abair
> Programmer Analyst
> Chicos FAS Inc.
>
> "msflinx" <msflinx@.discussions.microsoft.com> wrote in message
> news:7F943183-B6BD-46CF-9CAF-AFF73834DAE5@.microsoft.com...
>> The old string didn't move up when I replied to it, so copied the
>> information
>> into this new question
>> ----
>> OK -- this works to a point. I have real string data in my field that I
>> want
>> to display, if the field is not "isnumeric". So, here is the code I am
>> using:
>> =iif(isnumeric(Fields!Q4Amt.Value),
>> Format(convert.ToDouble(Fields!Q4Amt.Value),
>> "$###,###,##0.00;($###,###,##0.00);$0.00"), "N/A")
>> Every time the N/A is supposed to be displayed, I get an error message.
>> Thanks for any and all help
>> "Teo Lachev [MVP]" wrote:
>> =Iif (Fields!phone.Value Is Nothing, Nothing,
>> Format(Convert.ToDouble(Fields!phone.Value), "(###) ###-#### 'Ext.'
>> ####"))
>> --
>> HTH,
>> ---
>> Teo Lachev, MVP, MCSD, MCT
>> "Microsoft Reporting Services in Action"
>> "Applied Microsoft Analysis Services 2005"
>> Home page and blog: http://www.prologika.com/
>> ---
>> "rybrown1818" <rybrown1818@.discussions.microsoft.com> wrote in message
>> news:03C42C02-DBFD-44AA-A297-FEA74C6ACB29@.microsoft.com...
>> > okay great. I used the first example. Thanks!
>> > Now i have discovered that there are some rows without phone numbers.
>> > How do I do an IIF statement, that will return the formatted phone
>> > number
>> > and not available when there is no phone number?
>> >
>> > "Teo Lachev [MVP]" wrote:
>> >
>> >> = Format(Convert.ToDouble("90155585850000"), "(###) ###-#### 'Ext.'
>> >> ####")
>> >>
>> >> or use a regular expression, sth like
>> >>
>> >> =System.Text.RegularExpressions.Regex.Replace(Fields!phone.Value,
>> >> "(\d{3})(\d{3})(\d{4})", "($1) $2-$3")
>> >>
>> >> --
>> >> HTH,
>> >> ---
>> >> Teo Lachev, MVP, MCSD, MCT
>> >> "Microsoft Reporting Services in Action"
>> >> "Applied Microsoft Analysis Services 2005"
>> >> Home page and blog: http://www.prologika.com/
>> >> ---
>> >> "rybrown1818" <rybrown1818@.discussions.microsoft.com> wrote in
>> >> message
>> >> news:E8FFA4A2-0CEF-4AF5-9CCB-ED08E8DCBE51@.microsoft.com...
>> >> > how can i format a phone number to be displayed as follows in the
>> >> > report
>> >> > (678) 444-4444
>> >> >
>> >> > Thanks!
>> >>
>> >>
>> >>
>>
>>
>

Wednesday, March 7, 2012

format of point labels

Can I display number values with their corresponding percentage values in pie
charts like I can in Excel? (Ex. 45, 7.7%) If so, how? I've gotten either
one or the other to appear, but not both at the same time.You would need to write an expression to concatenate the calculated values.
E.g.:
=Sum(Fields!x.Value) & ", " & Format(Sum(Fields!x.Value) /
Sum(Fields!x.Value, "DataSetName"), "P1")
Robert M. Bruckner
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"dataGirl" <dataGirl@.discussions.microsoft.com> wrote in message
news:8025F487-40B6-46E8-97D4-FABA0507B9EB@.microsoft.com...
> Can I display number values with their corresponding percentage values in
> pie
> charts like I can in Excel? (Ex. 45, 7.7%) If so, how? I've gotten
> either
> one or the other to appear, but not both at the same time.

Sunday, February 19, 2012

format codes - font colours, background etc

can anyone point me in the direction of help and assistance in formatting
using expressions?
an example would be change font to red if negative
also to change the background colour matix when using the visibility options
many thanksDid you read this section in BOL? Among many other examples it contains an
example for formatting values red when the value is negative.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSCREATE/htm/rcr_creating_expressions_v1_571v.asp
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"jez_uk" <nospam@.nospam.com> wrote in message
news:uwfdvy3ZEHA.3016@.tk2msftngp13.phx.gbl...
> can anyone point me in the direction of help and assistance in formatting
> using expressions?
> an example would be change font to red if negative
> also to change the background colour matix when using the visibility
options
> many thanks
>