TOC : Script API > JavaScript > JavaScript API > Component > PDFDocument > PDFPage > Method >

 

GetDataSetValue

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

TOC : Script API > JavaScript > JavaScript API > Component > PDFDocument > PDFPage > Method >

 

GetDataSetValue

 

 

Gets the data value of the given field.

 

 

 

Prototype :

 

var GetDataSetValue

(

        string FieldPath,

        [ integer RowIndex ]

)

 

 

 

Arguments :

 

FieldPath

Field Path setup depends on the field type

RowIndex

One-Based row Index

Row index is effective only when getting data field value

If not set, cursor index by default

 

 

 

Reference :

 

Return type is one of double, integer or string according to field type.

 

How to set field path according to field types :

 

Data field

"ODI name.dataset name.field name"

 

ODI parameter field

"ODI name.OZParam.field name"

 

Form parameter field

"OZFormParam.field name"

 

System field

"OZSystem.field name"

 

Resource field

"OZResource.field name"

Returns the resource value of the current language.

 

If executes GetDataSetValue function in OnStartUp event, value of form parameter field and system field returns correctly, but value of data field and ODI parameter field returns null value.

 

 

 

Example :

 

//Data field (ODI name : Sample, dataset name : Orders, field name : Price)

  _TraceLn(This.GetDataSetValue("Sample.Orders.Price", 1)); //Data value of the 1st row

  _TraceLn(This.GetDataSetValue("Sample.Orders.Price", 3)); //Data value of the 3rd row

 

//ODI parameter field (ODI name : Sample, ODI parameter field name : TotalAmount)

  _TraceLn(This.GetDataSetValue("Sample.OZParam.TotalAmount"));

 

//form parameter field name : Quantity

  _TraceLn(This.GetDataSetValue("OZFormParam.Quantity"));

 

//system field

  _TraceLn(This.GetDataSetValue("OZSystem.Time"));

 

//resource field

  _TraceLn(This.GetDataSetValue("OZResource.Table_Title1"));

 

 

 

Available Events :

 

All Events

 

The GetDataSetValue function can be used in all events. But the Data Field, the ODI Paramater Field and the System Field(Page_Number, Total_Page, Page_Of_Total) returns the wrong value or script error, depending on the event.

Restrictions on the event, please refer to JavaScript Events topic.

 

 

 

See also :

 

JavaScript Events