cancel
Showing results for 
Search instead for 
Did you mean: 

Reg : Omiting Zero's in ADOBE output

Former Member
0 Kudos

Hi Experts,

I am fetching the Quantity field and displaying through ADOBE FORM, if the Quantity is 0 (ZERO) I have to display BLANK space in the respective CELL of ADOBE, if it is other than 0, I have to print the same value to that CELL.

I have tried many ways to achieve this, still its not resolved. please help me out from this.

Regards

valluru

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member

If it is a print form, just use FormCalc.

You go to your text field, where you want to display the quantity.

Choose:

     event: initialize

     language: FormCalc

     run at: Server

Add the following code:

     if ($ == "0")

     then $ = ""

     endif

And you are done.

Former Member
0 Kudos

Hi Experts,

Thanks for the solutions and response.

to achieve OMITTING ZEROS in ADOBE output I have done scripting.

Please write the following code for the field which you don't want to display the Zero's.

In LAYOUT choose the Language as JavaScript for that particular field also change the field type (Cell type) as TEXT FIELD.

if(this.rawValue == "0");

{

this.rawValue = " ";

}

Edited by: vallurukishore on Aug 22, 2011 8:11 AM

Edited by: vallurukishore on Aug 22, 2011 11:32 AM

Former Member
0 Kudos

Hi Kishore..

I have the same requirement now of displaying space if any zero value is there..

I wrote the same logic as u have given above.. but its not working...

Can u please tell me what is the event and any other extra stuff to be done for achieving this?

Regards

Aparna

Former Member
0 Kudos

Hi Kishore,

I have written the same peice of code which you have written in javascript in initialose event.

Can you please help me out. I have been trying for this for long time.

I have written the below logic on the partcular field. Written in Intialise event and also changed the field type to text field.

if ( this.rawValue == "0");

{

this.rawValue = " ";

}

Thanks and Regads,

Karthik Ganti.

rakesh_m2
Contributor
0 Kudos

This message was moderated.

shahid
Product and Topic Expert
Product and Topic Expert
0 Kudos

data: lv_quan type decimals,

lv_string type string.

if the field is defined as quantity it will display "0.00"

try defining the field in string, when it is ZERO, clear the field...it will show a space.

else.

move lv_quan to lv_string

lv_string is now an attribute in ADOBE.

Former Member
0 Kudos

Hi Kishore,

I haven't worked on Adobe forms but I would like to give you a hint like:

if you have condtions node or similiar to it use:

data quantity1 type text.

if quantity = 0.

quantity1 = space.

endif.

Or

you can retrict it in the slect query it self like:

select f1 f2 quantity 
           into table itab
           from tab
           where quantity NE '0'.

Hope this helps.

BR

Dep

Edited by: DeepakNandikanti on Aug 17, 2011 10:35 AM

Former Member
0 Kudos

Hi Experts thanks for your thoughts,

@ Deepak,

Thanks for the replay, along with the Quantity I am fetching some other fields, and I am passing those values to ADOBE.

If I use the above select query, I can't able to pick the remaining fields values.

Any how We can achieve this through CODE, but for Omitting Zero's some feature/setting is there in ADOBE FORM level itself.

Even I have changed at ADOBE FORM level, like I choosed text field/Numeric field and I have chossed Integer and allow blank space options. I have tried max combinations what I know to restrict Zero's. still it is coming.

Former Member
0 Kudos

Hi Kishore,

select f1 f2..fn quantity " select all fields to be displayed in ADOBE form along with quantity field
           into table itab
           from tab
           where  quantity NE '0'
            and f1 = <X>
             f2 = <Y>
              .... F6 = < U>. " Give all other condiotions along with qunatity NE '0'.

Hope this helps.

BR

Dep

amit_choubey
Discoverer
0 Kudos

I had similar requirement where Amount field of form needed to print as space in case of 0.00 value. Below javascript code in initialize event worked properly for me. in my case form field GV_TOT_DED is bind to interface field GV_TOT_DED which is of type QBSHB. I did not change anything in pattern. On Form, type of field GV_TOT_DED is decimal field and no need to make it as text field.

Simply add this code.

var totded = xfa.resolveNode("data.SP_Page1.SP_Invoice_Items.SP_Footer.GV_TOT_DED").rawValue;
if(totded == "0.00")
{
xfa.resolveNode("data.SP_Page1.SP_Invoice_Items.SP_Footer.GV_TOT_DED").rawValue = "";
  }