473,385 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Numerical Format in Crystal Reports - by code - not working

Hi

when I try to set the amount of decimal places I always get 2, no matter
what.

I have a formulafield in my detailsection, which I connect at runtime :

Dim colfield As FieldObject
colfield = .Section3.ReportObjects("Col1")

'=Not Working, but no error.... I still get 2 decimals
colfield.FieldFormat.NumericFormat.DecimalPlaces = 0

'this works but not if I do the formatting afterwards, then ERROR
Still, I get 2 decimals when I get no error
rpt.DataDefinition.FormulaFields("Col1").Text = " {tblTest.Col1} "

How can I get this decimal formatting to work ?
--
Filip
http://www.ww2airborne.net/
Official Site of the 101st Airborne - 463rd PFA
skype: airborne463pfa-fiwi
[It's nice to be important, but it's more important to be nice!]
----------------------------------------------------------------
Nov 9 '07 #1
2 2299
HEEEEELP Please.... :-/

--
Filip
http://www.ww2airborne.net/
Official Site of the 101st Airborne - 463rd PFA
skype: airborne463pfa-fiwi
[It's nice to be important, but it's more important to be nice!]
----------------------------------------------------------------
" Screaming Eagles 101" <se*********@online.pleaseschreef in bericht
news:47*********************@news.scarlet.nl...
Hi

when I try to set the amount of decimal places I always get 2, no matter
what.

I have a formulafield in my detailsection, which I connect at runtime :

Dim colfield As FieldObject
colfield = .Section3.ReportObjects("Col1")

'=Not Working, but no error.... I still get 2 decimals
colfield.FieldFormat.NumericFormat.DecimalPlaces = 0

'this works but not if I do the formatting afterwards, then ERROR
Still, I get 2 decimals when I get no error
rpt.DataDefinition.FormulaFields("Col1").Text = " {tblTest.Col1} "

How can I get this decimal formatting to work ?
--
Filip
http://www.ww2airborne.net/
Official Site of the 101st Airborne - 463rd PFA
skype: airborne463pfa-fiwi
[It's nice to be important, but it's more important to be nice!]
----------------------------------------------------------------


Nov 13 '07 #2
" Screaming Eagles 101" <se*********@online.pleaseschreef in bericht
news:47*********************@news.scarlet.nl...
Hi

when I try to set the amount of decimal places I always get 2, no matter
what.

I have a formulafield in my detailsection, which I connect at runtime :

Dim colfield As FieldObject
colfield = .Section3.ReportObjects("Col1")

'=Not Working, but no error.... I still get 2 decimals
colfield.FieldFormat.NumericFormat.DecimalPlaces = 0

'this works but not if I do the formatting afterwards, then ERROR
Still, I get 2 decimals when I get no error
rpt.DataDefinition.FormulaFields("Col1").Text = " {tblTest.Col1} "

How can I get this decimal formatting to work ?
--
Filip
http://www.ww2airborne.net/
Official Site of the 101st Airborne - 463rd PFA
skype: airborne463pfa-fiwi
[It's nice to be important, but it's more important to be nice!]
----------------------------------------------------------------
Looked for a solution for weeks, nobody came up with anything,
but this morning I have seen the light.... :-/
1. the datatype of my (design) tablefield was text, I changed it into
numerical
(weird, since I connect the formulafield at runtime
to a temp. vb.net datatable column, which can be of any type... but OK...)
Standard at designtime the formule(text) is just a 0 (zero),
only at runtime I set the formula to {tbl.column}
2. most important: property 'UseSystemDefaults' of the formulafield had to
be set to False.

I thought I'd mention this, even if nobody could help, which is
understandable,
I thought what I found could be of some help to someone else...
--
Filip
http://www.ww2airborne.net/
Official Site of the 101st Airborne - 463rd PFA
skype: airborne463pfa-fiwi
[It's nice to be important, but it's more important to be nice!]
----------------------------------------------------------------
>

Nov 27 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal...
1
by: Gudni G. Sigurdsson | last post by:
Hi. I am working on a program for the .NET Framework written in C# with Visual Studio .NET. With this program, one can print a report realized with the Crystal Report software included with VS...
0
by: Tony_E | last post by:
Hello I am trying to export a Crystal Report (8.5) out of an ACCESS (2002) function. crxReport.ExportOptions.FormatType = crEFTExcel80 FlPth = "C:\Reports\CrystalReport" & ".xls"...
7
by: Robert Schuldenfrei | last post by:
Dear NG, I am just learning object orientated programing in general and C# in particular. My first real project is an inventory application using a SQL database. I have an item master editor...
9
by: Robert Schuldenfrei | last post by:
Hello NG, After a bit of a wait my bookstore, SoftPro of Waltham, MA, got in the Brian Bischof book: Crystal Reports .NET Programming. I have read a few books on CR, but I am very new to it,...
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
1
by: Peri | last post by:
Dear All, Can any one help me out to call a crystal reports designed in 8.0 version in ASP.NET ? Crystal reports has given an asp page called rptserver.asp from which we can call the crystal...
1
by: =?Utf-8?B?VGVycnk=?= | last post by:
I am brand new to using Crystal Reports and am trying to generate a report based on a custom object - in another project. I have a layered design, with all my business objects in a seperate...
1
by: appandairajc | last post by:
Hi Friends, I have a problem in Crystal Reports. I have a web application and it was published in machine. I am running that application through a virtual path. All the pages are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.