null text box

Stimulsoft Reports.NET discussion
majidsoft
Posts: 66
Joined: Fri May 07, 2010 6:54 am

null text box

Post by majidsoft »

hi i have a databand that contain fields that have read information from sql when report read data with null the field is present 0 i dont want to show 0 but i have a 0 in my data base if i click hide zero my data is disappear to i want to use average in end of my data band too but i dont want to use null object in databand my suffix of data is double
thanks
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

null text box

Post by Andrew »

Hello,

Please use {DataSource["ColumnName"] == DBNull.Value ? "" : DataSource.ColumnName.ToString()} for displaying Null values.

Thank you.
majidsoft
Posts: 66
Joined: Fri May 07, 2010 6:54 am

null text box

Post by majidsoft »

thank you
but when i want to use avg for this column avg calculate null field if i want to not calculate null field what can i do
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

null text box

Post by Alex K. »

Hello,

In any case, whether Null values are present or not, the Avg function returns the correct value.
If our explanation does not help you, please send us a test report sample.

Thank you.
majidsoft
Posts: 66
Joined: Fri May 07, 2010 6:54 am

null text box

Post by majidsoft »

hi
here you can compare two avg on column have null value and another column have zero value
thanks
Attachments
514.New Folder (4).rar
(10.51 KiB) Downloaded 636 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

null text box

Post by Alex K. »

Hello,

If you do not want to take into account the Null values, please instead of expression

{Avg(DataTable1,Table1.mp)}

use the following expression:

{Avg(DataTable1,Table1["mp"])}

Thank you.
majidsoft
Posts: 66
Joined: Fri May 07, 2010 6:54 am

null text box

Post by majidsoft »

thank you
bye
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

null text box

Post by Andrew »

Have a nice day!
majidsoft
Posts: 66
Joined: Fri May 07, 2010 6:54 am

null text box

Post by majidsoft »

hi
i use your code in my field but when i want to read information from sql server when i use that code my field in stimul convert to string and the filed in sql is real and when i use filter to reduce decimal number to 2 digit because field is converting to string reducing decimal not working if i want to use else in my code to if field not null ic contain in real format what can i do
and if i want to for example write a symbol like '-' for null value what can i do
thanks
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

null text box

Post by Jan »

Hello,

Please show me your expression.

Thank you.
Post Reply