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