Showing posts with label expected. Show all posts
Showing posts with label expected. Show all posts

Monday, March 19, 2012

Currency sign problem

Hi,
I have a problem with an ASP page pulling data from a SQL2000 server.
Expected behaviour is that when prices are displayed they are displayed in
pounds as this is the default locale of the server. However they are
displayed in dollars.
I've checked the default locale and the user locale of the (windows 2000)
server and these are both British england. The language for the SQL user is
also British english.
Are there any other settings in SQL 2000 server that could affect this?
Thanks,
TimSQL Server displays money data types as numbers. It does not have any =currency symbols. How are you displaying the data within your active =server page? Perhaps you need to make sure that the code which displays =the data is correct. If it is, one more thing to check would be to make =sure that a smart developer has not hard coded the currency display =within the stored procedure or sql statement which returns the data.
-- Keith, SQL Server MVP
"Tim Harrison" <tim_eridge@.hotmail.com> wrote in message =news:OeHqV8uSDHA.2148@.TK2MSFTNGP11.phx.gbl...
> Hi,
> > I have a problem with an ASP page pulling data from a SQL2000 server.
> Expected behaviour is that when prices are displayed they are =displayed in
> pounds as this is the default locale of the server. However they are
> displayed in dollars.
> > I've checked the default locale and the user locale of the (windows =2000)
> server and these are both British england. The language for the SQL =user is
> also British english.
> > Are there any other settings in SQL 2000 server that could affect =this?
> > Thanks,
> > Tim
> >

Sunday, March 11, 2012

Currency Format

I'd like currency format of $#,###
but when i specify that, I dont get any values for 0 I just get a $
which is somewhat expected.
If I specify C, I get the cents, which I dont care about.
Anyone knowhow I might achieve C currency format, that doesnt include
cents, but displays 0 when the value is 0?
Thanks in advance
Weston WeemsWeston,
Check out the FORMATCURRENCY function.
HTH
Jerry
"Weston Weems" <wweems@.nospam_itsucksGMAIL.COM> wrote in message
news:uFR4buHxFHA.664@.tk2msftngp13.phx.gbl...
> I'd like currency format of $#,###
> but when i specify that, I dont get any values for 0 I just get a $ which
> is somewhat expected.
> If I specify C, I get the cents, which I dont care about.
> Anyone knowhow I might achieve C currency format, that doesnt include
> cents, but displays 0 when the value is 0?
> Thanks in advance
> Weston Weems

Friday, February 24, 2012

Ctype from string to double not behaving as expected.

I tried posting this earlier, but it never showed up. Hopefully I don't
double post.
I was writing code for a custom dll earlier this morning where I ran into
some strange behavior for the IsNumeric function.
IsNumeric("$1,0562.00") was returning false
I thought that maybe this behavior was being cause by one of the "features"
of the IsNumeric function so I decided to do some more testing.
I created a web app on the same machine and ran the same code there
IsNumeric("$1,0562.00") was returning true with the web app.
I delved a little deeper and decided to research just what all IsNumeric
does to check for a numeric value. I didn't have to go far.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctisnumeric.asp
states
"It also returns True if Expression is a String that can be successfully
converted to a Double"
So I decided to test the following code in each environment.
ctype("$1,0562.00",double)
Sure enough within the web app it worked fine, but within a reporting
services custom dll it threw an exception.
Both the instance of reporting services and the webapp are being run and
compiled on the same machine. They are both running under the 1.1 framework.
It would make more sense to me that the code didn't behave the way I thought
it should if it was consistently misbehaving. :-)
It's quite possible there is something I'm missing here, but I'm just trying
to figure out the reason for the inconsistency.
I'm running Reporting Services 2003 with sp2 installed.
Anyone have any ideas?
Thanks,
NathanThat is odd. I tried in SSRS 2005 preview window just for giggles, returned
true as expected.
=IsNumeric("$1,0562.00")
"Nathan" <Nathan@.discussions.microsoft.com> wrote in message
news:4B24FE69-BCA8-48CF-8ECC-40F8FCCC5448@.microsoft.com...
>I tried posting this earlier, but it never showed up. Hopefully I don't
> double post.
> I was writing code for a custom dll earlier this morning where I ran into
> some strange behavior for the IsNumeric function.
> IsNumeric("$1,0562.00") was returning false
> I thought that maybe this behavior was being cause by one of the
> "features"
> of the IsNumeric function so I decided to do some more testing.
> I created a web app on the same machine and ran the same code there
> IsNumeric("$1,0562.00") was returning true with the web app.
> I delved a little deeper and decided to research just what all IsNumeric
> does to check for a numeric value. I didn't have to go far.
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctisnumeric.asp
> states
> "It also returns True if Expression is a String that can be successfully
> converted to a Double"
> So I decided to test the following code in each environment.
> ctype("$1,0562.00",double)
> Sure enough within the web app it worked fine, but within a reporting
> services custom dll it threw an exception.
> Both the instance of reporting services and the webapp are being run and
> compiled on the same machine. They are both running under the 1.1
> framework.
> It would make more sense to me that the code didn't behave the way I
> thought
> it should if it was consistently misbehaving. :-)
> It's quite possible there is something I'm missing here, but I'm just
> trying
> to figure out the reason for the inconsistency.
> I'm running Reporting Services 2003 with sp2 installed.
> Anyone have any ideas?
> Thanks,
> Nathan
>|||Perhaps this was something that was fixed with 2005? Although I'm still not
ruling out that I'm missing something. When you say in the preview window do
you mean you used â'ctype("$1,0562.00",double)â' in the custom code window
there? Iâ'll have to give that a try and see if it has the same behavior as
calling it within a custom dll.
"Steve MunLeeuw" wrote:
> That is odd. I tried in SSRS 2005 preview window just for giggles, returned
> true as expected.
> =IsNumeric("$1,0562.00")
> "Nathan" <Nathan@.discussions.microsoft.com> wrote in message
> news:4B24FE69-BCA8-48CF-8ECC-40F8FCCC5448@.microsoft.com...
> >I tried posting this earlier, but it never showed up. Hopefully I don't
> > double post.
> >
> > I was writing code for a custom dll earlier this morning where I ran into
> > some strange behavior for the IsNumeric function.
> > IsNumeric("$1,0562.00") was returning false
> > I thought that maybe this behavior was being cause by one of the
> > "features"
> > of the IsNumeric function so I decided to do some more testing.
> > I created a web app on the same machine and ran the same code there
> > IsNumeric("$1,0562.00") was returning true with the web app.
> >
> > I delved a little deeper and decided to research just what all IsNumeric
> > does to check for a numeric value. I didn't have to go far.
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctisnumeric.asp
> > states
> > "It also returns True if Expression is a String that can be successfully
> > converted to a Double"
> >
> > So I decided to test the following code in each environment.
> > ctype("$1,0562.00",double)
> > Sure enough within the web app it worked fine, but within a reporting
> > services custom dll it threw an exception.
> >
> > Both the instance of reporting services and the webapp are being run and
> > compiled on the same machine. They are both running under the 1.1
> > framework.
> > It would make more sense to me that the code didn't behave the way I
> > thought
> > it should if it was consistently misbehaving. :-)
> > It's quite possible there is something I'm missing here, but I'm just
> > trying
> > to figure out the reason for the inconsistency.
> >
> > I'm running Reporting Services 2003 with sp2 installed.
> >
> > Anyone have any ideas?
> >
> > Thanks,
> >
> > Nathan
> >
>
>|||I just entered it as an expression in a textbox and clicked the Preview tab
in the Report Designer (VS IDE)
"Nathan" <Nathan@.discussions.microsoft.com> wrote in message
news:E814C5A0-E41D-4261-8A37-7ECB30C98D68@.microsoft.com...
> Perhaps this was something that was fixed with 2005? Although I'm still
> not
> ruling out that I'm missing something. When you say in the preview window
> do
> you mean you used "ctype("$1,0562.00",double)" in the custom code window
> there? I'll have to give that a try and see if it has the same behavior
> as
> calling it within a custom dll.
> "Steve MunLeeuw" wrote:
>> That is odd. I tried in SSRS 2005 preview window just for giggles,
>> returned
>> true as expected.
>> =IsNumeric("$1,0562.00")
>> "Nathan" <Nathan@.discussions.microsoft.com> wrote in message
>> news:4B24FE69-BCA8-48CF-8ECC-40F8FCCC5448@.microsoft.com...
>> >I tried posting this earlier, but it never showed up. Hopefully I don't
>> > double post.
>> >
>> > I was writing code for a custom dll earlier this morning where I ran
>> > into
>> > some strange behavior for the IsNumeric function.
>> > IsNumeric("$1,0562.00") was returning false
>> > I thought that maybe this behavior was being cause by one of the
>> > "features"
>> > of the IsNumeric function so I decided to do some more testing.
>> > I created a web app on the same machine and ran the same code there
>> > IsNumeric("$1,0562.00") was returning true with the web app.
>> >
>> > I delved a little deeper and decided to research just what all
>> > IsNumeric
>> > does to check for a numeric value. I didn't have to go far.
>> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctisnumeric.asp
>> > states
>> > "It also returns True if Expression is a String that can be
>> > successfully
>> > converted to a Double"
>> >
>> > So I decided to test the following code in each environment.
>> > ctype("$1,0562.00",double)
>> > Sure enough within the web app it worked fine, but within a reporting
>> > services custom dll it threw an exception.
>> >
>> > Both the instance of reporting services and the webapp are being run
>> > and
>> > compiled on the same machine. They are both running under the 1.1
>> > framework.
>> > It would make more sense to me that the code didn't behave the way I
>> > thought
>> > it should if it was consistently misbehaving. :-)
>> > It's quite possible there is something I'm missing here, but I'm just
>> > trying
>> > to figure out the reason for the inconsistency.
>> >
>> > I'm running Reporting Services 2003 with sp2 installed.
>> >
>> > Anyone have any ideas?
>> >
>> > Thanks,
>> >
>> > Nathan
>> >
>>|||Putting the "ctype("$1,0562.00",double)" directly in the cell on a page seems
to work fine. It seems to be when the code is run in a custom dll that the
problem occurs.
Can anyone else reproduce this?
Thanks,
-Nathan
"Steve MunLeeuw" wrote:
> I just entered it as an expression in a textbox and clicked the Preview tab
> in the Report Designer (VS IDE)
>
> "Nathan" <Nathan@.discussions.microsoft.com> wrote in message
> news:E814C5A0-E41D-4261-8A37-7ECB30C98D68@.microsoft.com...
> > Perhaps this was something that was fixed with 2005? Although I'm still
> > not
> > ruling out that I'm missing something. When you say in the preview window
> > do
> > you mean you used "ctype("$1,0562.00",double)" in the custom code window
> > there? I'll have to give that a try and see if it has the same behavior
> > as
> > calling it within a custom dll.
> > "Steve MunLeeuw" wrote:
> >
> >> That is odd. I tried in SSRS 2005 preview window just for giggles,
> >> returned
> >> true as expected.
> >> =IsNumeric("$1,0562.00")
> >>
> >> "Nathan" <Nathan@.discussions.microsoft.com> wrote in message
> >> news:4B24FE69-BCA8-48CF-8ECC-40F8FCCC5448@.microsoft.com...
> >> >I tried posting this earlier, but it never showed up. Hopefully I don't
> >> > double post.
> >> >
> >> > I was writing code for a custom dll earlier this morning where I ran
> >> > into
> >> > some strange behavior for the IsNumeric function.
> >> > IsNumeric("$1,0562.00") was returning false
> >> > I thought that maybe this behavior was being cause by one of the
> >> > "features"
> >> > of the IsNumeric function so I decided to do some more testing.
> >> > I created a web app on the same machine and ran the same code there
> >> > IsNumeric("$1,0562.00") was returning true with the web app.
> >> >
> >> > I delved a little deeper and decided to research just what all
> >> > IsNumeric
> >> > does to check for a numeric value. I didn't have to go far.
> >> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctisnumeric.asp
> >> > states
> >> > "It also returns True if Expression is a String that can be
> >> > successfully
> >> > converted to a Double"
> >> >
> >> > So I decided to test the following code in each environment.
> >> > ctype("$1,0562.00",double)
> >> > Sure enough within the web app it worked fine, but within a reporting
> >> > services custom dll it threw an exception.
> >> >
> >> > Both the instance of reporting services and the webapp are being run
> >> > and
> >> > compiled on the same machine. They are both running under the 1.1
> >> > framework.
> >> > It would make more sense to me that the code didn't behave the way I
> >> > thought
> >> > it should if it was consistently misbehaving. :-)
> >> > It's quite possible there is something I'm missing here, but I'm just
> >> > trying
> >> > to figure out the reason for the inconsistency.
> >> >
> >> > I'm running Reporting Services 2003 with sp2 installed.
> >> >
> >> > Anyone have any ideas?
> >> >
> >> > Thanks,
> >> >
> >> > Nathan
> >> >
> >>
> >>
> >>
>
>|||Sorry about that, I missed the whole point.
I added the following method to a custom assembly and referenced this in a
2005 report and used the preview window. I was going to try the same in VS
2003, but my 2.0 assembly doesn't appear that it will work with the 1.1
framework in 2003. My custom assembly is in C#, referenced the VB.Net dll
to get the IsNumeric function.
public bool NewsGroup_CtypeFromString()
{
return Microsoft.VisualBasic.Information.IsNumeric("$1,0562.00");
}
Expression:
=Code.loc.NewsGroup_CtypeFromString
Returns True
Steve MunLeeuw
"Nathan" <Nathan@.discussions.microsoft.com> wrote in message
news:AC81C8D6-6E64-4867-A15E-72C034F3F511@.microsoft.com...
> Putting the "ctype("$1,0562.00",double)" directly in the cell on a page
> seems
> to work fine. It seems to be when the code is run in a custom dll that
> the
> problem occurs.
> Can anyone else reproduce this?
> Thanks,
> -Nathan
> "Steve MunLeeuw" wrote:
>> I just entered it as an expression in a textbox and clicked the Preview
>> tab
>> in the Report Designer (VS IDE)
>>
>> "Nathan" <Nathan@.discussions.microsoft.com> wrote in message
>> news:E814C5A0-E41D-4261-8A37-7ECB30C98D68@.microsoft.com...
>> > Perhaps this was something that was fixed with 2005? Although I'm
>> > still
>> > not
>> > ruling out that I'm missing something. When you say in the preview
>> > window
>> > do
>> > you mean you used "ctype("$1,0562.00",double)" in the custom code
>> > window
>> > there? I'll have to give that a try and see if it has the same
>> > behavior
>> > as
>> > calling it within a custom dll.
>> > "Steve MunLeeuw" wrote:
>> >
>> >> That is odd. I tried in SSRS 2005 preview window just for giggles,
>> >> returned
>> >> true as expected.
>> >> =IsNumeric("$1,0562.00")
>> >>
>> >> "Nathan" <Nathan@.discussions.microsoft.com> wrote in message
>> >> news:4B24FE69-BCA8-48CF-8ECC-40F8FCCC5448@.microsoft.com...
>> >> >I tried posting this earlier, but it never showed up. Hopefully I
>> >> >don't
>> >> > double post.
>> >> >
>> >> > I was writing code for a custom dll earlier this morning where I ran
>> >> > into
>> >> > some strange behavior for the IsNumeric function.
>> >> > IsNumeric("$1,0562.00") was returning false
>> >> > I thought that maybe this behavior was being cause by one of the
>> >> > "features"
>> >> > of the IsNumeric function so I decided to do some more testing.
>> >> > I created a web app on the same machine and ran the same code there
>> >> > IsNumeric("$1,0562.00") was returning true with the web app.
>> >> >
>> >> > I delved a little deeper and decided to research just what all
>> >> > IsNumeric
>> >> > does to check for a numeric value. I didn't have to go far.
>> >> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctisnumeric.asp
>> >> > states
>> >> > "It also returns True if Expression is a String that can be
>> >> > successfully
>> >> > converted to a Double"
>> >> >
>> >> > So I decided to test the following code in each environment.
>> >> > ctype("$1,0562.00",double)
>> >> > Sure enough within the web app it worked fine, but within a
>> >> > reporting
>> >> > services custom dll it threw an exception.
>> >> >
>> >> > Both the instance of reporting services and the webapp are being run
>> >> > and
>> >> > compiled on the same machine. They are both running under the 1.1
>> >> > framework.
>> >> > It would make more sense to me that the code didn't behave the way I
>> >> > thought
>> >> > it should if it was consistently misbehaving. :-)
>> >> > It's quite possible there is something I'm missing here, but I'm
>> >> > just
>> >> > trying
>> >> > to figure out the reason for the inconsistency.
>> >> >
>> >> > I'm running Reporting Services 2003 with sp2 installed.
>> >> >
>> >> > Anyone have any ideas?
>> >> >
>> >> > Thanks,
>> >> >
>> >> > Nathan
>> >> >
>> >>
>> >>
>> >>
>>|||Got off my lazy horse and tried in VS 2003, I don't have VB installed, I
think using regular expressions would defeat the whole purpose of your case.
Maybe using RegExpr instead of IsNumeric would be a valid workaround?
sorry, C#
deonvs said:
Even easier:
static bool IsNumeric(string inputString)
{
return Regex.IsMatch(inputString, "^[0-9]+$");
}
Reference: http://dotnet.org.za/deonvs/archive/2004/07/06/2579.aspx
Steve MunLeeuw
"Nathan" <Nathan@.discussions.microsoft.com> wrote in message
news:AC81C8D6-6E64-4867-A15E-72C034F3F511@.microsoft.com...
> Putting the "ctype("$1,0562.00",double)" directly in the cell on a page
> seems
> to work fine. It seems to be when the code is run in a custom dll that
> the
> problem occurs.
> Can anyone else reproduce this?
> Thanks,
> -Nathan
> "Steve MunLeeuw" wrote:
>> I just entered it as an expression in a textbox and clicked the Preview
>> tab
>> in the Report Designer (VS IDE)
>>
>> "Nathan" <Nathan@.discussions.microsoft.com> wrote in message
>> news:E814C5A0-E41D-4261-8A37-7ECB30C98D68@.microsoft.com...
>> > Perhaps this was something that was fixed with 2005? Although I'm
>> > still
>> > not
>> > ruling out that I'm missing something. When you say in the preview
>> > window
>> > do
>> > you mean you used "ctype("$1,0562.00",double)" in the custom code
>> > window
>> > there? I'll have to give that a try and see if it has the same
>> > behavior
>> > as
>> > calling it within a custom dll.
>> > "Steve MunLeeuw" wrote:
>> >
>> >> That is odd. I tried in SSRS 2005 preview window just for giggles,
>> >> returned
>> >> true as expected.
>> >> =IsNumeric("$1,0562.00")
>> >>
>> >> "Nathan" <Nathan@.discussions.microsoft.com> wrote in message
>> >> news:4B24FE69-BCA8-48CF-8ECC-40F8FCCC5448@.microsoft.com...
>> >> >I tried posting this earlier, but it never showed up. Hopefully I
>> >> >don't
>> >> > double post.
>> >> >
>> >> > I was writing code for a custom dll earlier this morning where I ran
>> >> > into
>> >> > some strange behavior for the IsNumeric function.
>> >> > IsNumeric("$1,0562.00") was returning false
>> >> > I thought that maybe this behavior was being cause by one of the
>> >> > "features"
>> >> > of the IsNumeric function so I decided to do some more testing.
>> >> > I created a web app on the same machine and ran the same code there
>> >> > IsNumeric("$1,0562.00") was returning true with the web app.
>> >> >
>> >> > I delved a little deeper and decided to research just what all
>> >> > IsNumeric
>> >> > does to check for a numeric value. I didn't have to go far.
>> >> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctisnumeric.asp
>> >> > states
>> >> > "It also returns True if Expression is a String that can be
>> >> > successfully
>> >> > converted to a Double"
>> >> >
>> >> > So I decided to test the following code in each environment.
>> >> > ctype("$1,0562.00",double)
>> >> > Sure enough within the web app it worked fine, but within a
>> >> > reporting
>> >> > services custom dll it threw an exception.
>> >> >
>> >> > Both the instance of reporting services and the webapp are being run
>> >> > and
>> >> > compiled on the same machine. They are both running under the 1.1
>> >> > framework.
>> >> > It would make more sense to me that the code didn't behave the way I
>> >> > thought
>> >> > it should if it was consistently misbehaving. :-)
>> >> > It's quite possible there is something I'm missing here, but I'm
>> >> > just
>> >> > trying
>> >> > to figure out the reason for the inconsistency.
>> >> >
>> >> > I'm running Reporting Services 2003 with sp2 installed.
>> >> >
>> >> > Anyone have any ideas?
>> >> >
>> >> > Thanks,
>> >> >
>> >> > Nathan
>> >> >
>> >>
>> >>
>> >>
>>

Friday, February 17, 2012

CSV Exports are not as expected, columns are missing

I use SQL2005. I have a hard time understanding the reason why the CSV exports are not exporting the report with all the columns. Only the first column of data is exported.
example, I have report like this

Product Customer Jan Feb Mar Apr Jun

p1 C1 12 3 13 7 20

After csv export, I get a bunch of label down the rows, then I see my Product and Customer columns but I can only see Jan. Feb Mar Apr and Jun are NOT exported.

All these columns have exactly the same settings and the report is not a matrix report.

When I export to Excel or HTML, the result is perfect.

Any idea?

Thanks

Philippe

Make sure that Output property is set to Auto or Yes for those textboxes (Textbox Properties dialog -> Data Output tab)|||

Hi,

All these text boxes have the output property set to Auto.

|||Would you like to e-mail your report to me?|||

OK, thanks for your help. I greatly appreciate it. The rdl of one of these reports is on its way.

Thanks,

Philippe

|||

There is a bug here : when Output is set Auto it is translated to No for table columns with Hidden set to an expression.

The workaround is to set Output to Yes for textboxes which should be exported.