| |
ActiveReports for .NET Support
Started by wcpulling at 02-04-2010 7:24 AM. Topic has 3 replies.
 
 
 
|
|
Sort Posts:
|
|
|
|
02-04-2010, 7:24 AM
|
wcpulling
Joined on 02-04-2010
Posts 2
|
Replacing 0 (zero) with - (dash) in the detail area of an active report
|
|
|
|
|
I need to deliver a report that shows numeric values provided by bound columns. Is is possible to replace any column value = 0 with a dash. The bound column data source is type integer.
My preferred method would be manipulation of a calculated field via a formula.
|
|
|
|
|
Report
|
|
|
|
02-04-2010, 9:57 PM
|
subodh.sinha
Joined on 10-06-2009
Posts 1,091

|
Re: Replacing 0 (zero) with - (dash) in the detail area of an active report
|
|
|
|
|
Hello,
You can always check the value of a field in the fetch data event and change the fields value. To change the field value from zero to dash you can use this in fetch data event: //C# if ((int)Fields["Number"].Value == 0) { Fields["Number"].Value = "-"; }
Please do let me know if I misunderstood the issue.
Regards, Subodh
|
|
|
|
|
Report
|
|
|
|
02-11-2010, 10:53 AM
|
wcpulling
Joined on 02-04-2010
Posts 2
|
Re: Replacing 0 (zero) with - (dash) in the detail area of an active report
|
|
|
|
|
Subohh, thanks for the initial response, but I had already tried something similar within the rpx file, because the c# file is using a datareader that is supposed to be hands off. I was hoping to leverage the formula functionality in a calculated column to achieve this result.
I was concerned that conversion of the value within a SQL Select statement of otherwise would negatively impact my ability to perform mathmatical (sum) functions dynamically within the active report.
|
|
|
|
|
Report
|
|
|
|
02-12-2010, 4:52 AM
|
AnkitN
Joined on 03-03-2009
Posts 844

|
Re: Replacing 0 (zero) with - (dash) in the detail area of an active report
|
|
|
|
|
Hello,
You can use the ternary operator in the DataField expression for checking the zero value. For Example
textBox1.DataField = “= (Value == 0) ? "-" : Value”;
To know more about DataField expression you may click here.
I hope it helps.
Regards, Ankit Nigam
|
|
|
|
|
Report
|
|
|
|
|
GrapeCity » Product Support » ActiveReports f... » Replacing 0 (zero) with - (dash) in the detail area of an active report
|
|
|
|
|