Monday, March 19, 2012

Currency Formatting

I have a report that uses the following xml dataset via a DPE I got from Teo
Lachev:
<dsDisplay>
<Table1>
<AreaGroup>Orange County </AreaGroup>
<Col1>96090.8100</Col1>
<Col2>310241.9500</Col2>
<Col3>95732.6400</Col3>
<Col4>123224.3500</Col4>
<ShowFilter>show</ShowFilter>
<V1>-214151.1400</V1>
<V2>-27491.7100</V2>
</Table1>. . . . . . . .
I am specifying Currency formatting for the textboxes having numeric amounts
but it doesn't format - they still appear as they are in the dataset.
Why would this not work?
Thanks,
TI suspect that your report data is being treated as a string. If that is
correct the currency formatting will affect how your report data is
displayed.
What you need to do is to convert the data to a numeric format and then
apply the currency formatting. The textbox value expression you will need
should be similar to this:
=CDbl(Fields!<SomeFieldName>.Value)
Please see the VB Type Conversion discussion at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vagrptypeconversion.asp
--
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Tina" <tinamseaburn@.removespamexcite.com> wrote in message
news:OegSX3shEHA.1156@.TK2MSFTNGP10.phx.gbl...
> I have a report that uses the following xml dataset via a DPE I got from
Teo
> Lachev:
> <dsDisplay>
> <Table1>
> <AreaGroup>Orange County </AreaGroup>
> <Col1>96090.8100</Col1>
> <Col2>310241.9500</Col2>
> <Col3>95732.6400</Col3>
> <Col4>123224.3500</Col4>
> <ShowFilter>show</ShowFilter>
> <V1>-214151.1400</V1>
> <V2>-27491.7100</V2>
> </Table1>. . . . . . . .
> I am specifying Currency formatting for the textboxes having numeric
amounts
> but it doesn't format - they still appear as they are in the dataset.
> Why would this not work?
> Thanks,
> T
>|||I forgot to include the schema info in the xml file. Once I did that it
worked just fine.
As Anna Roseanadana would say, uh, never mind :)
T
"Bruce Johnson [MSFT]" <brucejoh@.online.microsoft.com> wrote in message
news:OeHsUMthEHA.3916@.TK2MSFTNGP11.phx.gbl...
> I suspect that your report data is being treated as a string. If that is
> correct the currency formatting will affect how your report data is
> displayed.
> What you need to do is to convert the data to a numeric format and then
> apply the currency formatting. The textbox value expression you will need
> should be similar to this:
> =CDbl(Fields!<SomeFieldName>.Value)
> Please see the VB Type Conversion discussion at
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vagrptypeconversion.asp
> --
> Bruce Johnson [MSFT]
> Microsoft SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "Tina" <tinamseaburn@.removespamexcite.com> wrote in message
> news:OegSX3shEHA.1156@.TK2MSFTNGP10.phx.gbl...
> > I have a report that uses the following xml dataset via a DPE I got from
> Teo
> > Lachev:
> > <dsDisplay>
> > <Table1>
> > <AreaGroup>Orange County </AreaGroup>
> > <Col1>96090.8100</Col1>
> > <Col2>310241.9500</Col2>
> > <Col3>95732.6400</Col3>
> > <Col4>123224.3500</Col4>
> > <ShowFilter>show</ShowFilter>
> > <V1>-214151.1400</V1>
> > <V2>-27491.7100</V2>
> > </Table1>. . . . . . . .
> >
> > I am specifying Currency formatting for the textboxes having numeric
> amounts
> > but it doesn't format - they still appear as they are in the dataset.
> >
> > Why would this not work?
> > Thanks,
> > T
> >
> >
>

No comments:

Post a Comment