We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Accounting Format in reports

Thread ID:

Created:

Updated:

Platform:

Replies:

77876 Nov 19,2008 09:48 PM Nov 20,2008 01:32 AM ASP.NET Web Forms (Classic) 2
loading
Tags: XlsIO
Vidya Jayakumar
Asked On November 19, 2008 09:48 PM

Date: 8/25/2008 7:42:50 AM by G.YavanaArasi [Syncfusion]
Subject : Cell/Range Formatting

Hi,

In a post dated and subject as above to format a cell in accounting format like
($-) if cell value is 0 and
($7,337,216) if the cell has some real numbers,as per the post the solution to this was
Sheet1.Range(4, 3, 28, 3).NumberFormat = "_(""$""* #,##0_);_(""$""* (#,##0);_(""$""* ""-""_);_(@_)"

You can find the outcome of this expression in the attached excel file (QR.xls) and the first tab named "FCE"

I am using expression now to format a row in the same file, second tab named "notformatedto$".

Why am i not getting the row formatted like $- when the cell value is null????

I did a quick watch on the vb.net datatable row object which is fetching the above mentioned rows from the database.
If you can open the attached word doc Second page(sending in next post since i can attach only one file) has the Quick watch for the data which formats like in QR.xls
If you take a look at the value column of the datatable row it is 0D when the value was null.

First page in the attached doc is the quick watch of the data which goes to AR.xls. If you see the
value column, the null values from sql server DB has System.dbnull value

Is it because of the 0D value it formats to $- and does not format because it is System.dbnull?

Thankyou,
Vidya






QR_caef4192.zip

Vidya Jayakumar
Replied On November 19, 2008 10:00 PM

Please ignore the AR.xls file mentioned below it replaces the secong tab in QR.xls.

Vidya

>Date: 8/25/2008 7:42:50 AM by G.YavanaArasi [Syncfusion]
Subject : Cell/Range Formatting

Hi,

In a post dated and subject as above to format a cell in accounting format like
($-) if cell value is 0 and
($7,337,216) if the cell has some real numbers,as per the post the solution to this was
Sheet1.Range(4, 3, 28, 3).NumberFormat = "_(""$""* #,##0_);_(""$""* (#,##0);_(""$""* ""-""_);_(@_)"

You can find the outcome of this expression in the attached excel file (QR.xls) and the first tab named "FCE"

I am using expression now to format a row in the same file, second tab named "notformatedto$".

Why am i not getting the row formatted like $- when the cell value is null????

I did a quick watch on the vb.net datatable row object which is fetching the above mentioned rows from the database.
If you can open the attached word doc Second page(sending in next post since i can attach only one file) has the Quick watch for the data which formats like in QR.xls
If you take a look at the value column of the datatable row it is 0D when the value was null.

First page in the attached doc is the quick watch of the data which goes to AR.xls. If you see the
value column, the null values from sql server DB has System.dbnull value

Is it because of the 0D value it formats to $- and does not format because it is System.dbnull?

Thankyou,
Vidya






QR_caef4192.zip


Geetha M [Syncfusion]
Replied On November 20, 2008 01:32 AM

Hi Vidya,

Yes. '$ -' does not displayed because as there is no value in the cell. This is the behavior of MS Excel. You can check this by applying the Number Format as 'Accounting'. If you type '0' then it will display as '$ -'.

Please follow up with the direct trac incident you created on this regard.

Regards,
Geetha


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;