Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting fields (decimal/number) 2

Status
Not open for further replies.

hencyt

MIS
Mar 14, 2003
122
US
Good morning everyone,

Just wondering if there is a way to format the fields besides scripting it.
For example-- I know I can change the format of my current decimal fields to only show 2 places to the right of the decimal by using this in the dataset select query:

CAST(v90.CNTR_MATL_INV_ON_HAND AS decimal(10, 2))

But in crystal I was able to set the format for the field on the layout of the report by right-clicking the field and choosing the format (-1234.00).

I was just hoping I wouldn't have to cast all the decimals in this report as there are many.

I guess I am lazy!

Thanks for any advice!!
You all are great!
Sunny
 
There is a format attribute on items.

Under Properties > Format > Format Code

F = 1234.00
N = 1,234.00

Otherwise the .rdl would be...
Code:
<Textbox Name="Non_Charge_Hours_2">          <rd:DefaultName>Non_Charge_Hours_2</rd:DefaultName>
 <ZIndex>15</ZIndex>
  <Style>
   <Format>N</Format>
  </Style>
  <CanGrow>true</CanGrow>
  <Value>=Sum(Fields!Non_Charge_Hours.Value)</Value>
 </Textbox>
 
Yeh - just use the NumberFormat property of the control

Can use various shorthand notations or default formatting styles such as #,##0.00

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Thanks checkai and xlbo-

I appreciate your responses.

Lots of good information there. Several options and ways to approach.

Thanks for sharing your knowledge!

Sunny
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top