CALLOCX |
Callocx makes it possible to use COM OBJects (OLE, ActiveX,...).
Beside the standard interfaces, the OBJects called by the Callocx instruction MUST absolutely implement the following interfaces:
Callocx return=""with param_list
|
Element |
Description |
Restrictions |
|
return |
returns the information in the form of a table of character strings |
|
|
list_param |
List of id_param separated by the character ','. |
The expressions must be alphanumeric and are limited to 255. |
############################################################
#--- Creation of the graphical OBJect
Local Char RETOUR(20)
Callocx RETOUR="" With
& "X3Action=" +chr$(1)+ "1",
& "X3Identification=" +chr$(1)+ "VtChartLib.VtChart",
& "X3Window=" +chr$(1)+ "0",
& "X3Left=" +chr$(1)+ "1",
& "X3Top=" +chr$(1)+ "1",
& "X3Right=" +chr$(1)+ "340",
& "X3Bottom=" +chr$(1)+ "200",
& "X3GetFile=" +chr$(1)+ filpath("GRAPH","Chart_line_1","vtc"),
& "Repaint=" +chr$(1)+ '10"%d"' + "0"
#--- Retrieval of the identification number of the OBJect
If (left$(RETOUR,9) = "X3Number=") Then
GOCXID = mid$(RETOUR,11,1)
Endif############################################################
#--- Modification of the OBJect with
# - title and footnote text
# - number of columns and rows
# - number of column and row labelsLocal Char WCLI(255)
WCLI = "$ADXDIR\Report\GX3APP_gailf50_1801\Chart_line_1.vtc"
Callocx "" With
& "X3Action=" +chr$(1)+ "2",
& "X3Number=" +chr$(1)+ GOCXID,
& "ReadFromFile=" +chr$(1)+ '30"%z"' + WCLI,
& "FootnoteText=" +chr$(1)+ '10"%s"' + "graph footer",
& "TitleText=" +chr$(1)+ '10"%s"' + "graph title",
& "ColumnCount=" +chr$(1)+ '10"%d"' + "1",
& "RowCount=" +chr$(1)+ '10"%d"' + "6",
& "ColumnLabelCount=" +chr$(1)+ '10"%d"' + "1",
& "RowLabelCount=" +chr$(1)+ '10"%d"' + "6"
############################################################
#--- Loading of data
Local Decimal WDAT(6)
WDAT(0)=20
WDAT(1)=40
WDAT(2)=65
WDAT(3)=15
WDAT(4)=10
WDAT(5)=10
For WROW = 1 To 6
Callocx "" With
& "X3Action=" +chr$(1)+ "2",
& "X3Number=" +chr$(1)+ GOCXID,
& "Column=" +chr$(1)+ '10"%d"' + "1",
& "Row=" +chr$(1)+ '10"%d"' + num$(WROW),
& "Data=" +chr$(1)+ '10".s"' + num$(WDAT(WROW-1))
Next WROW
############################################################
# Loading the x-axis labels
For WROW = 1 To 6
Callocx "" With
& "X3Action=" +chr$(1)+ "2",
& "X3Number=" +chr$(1)+ GOCXID,
& "RowLabelIndex=" +chr$(1)+ '10"%d"' + "1",
& "Row=" +chr$(1)+ '10"%d"' + num$(WROW),
& "RowLabel=" +chr$(1)+ '10"%s"' + month$(WROW)
Next WROW
############################################################
# The OCX is repainted and the window is activated
Callocx "" With
& "X3Action=" +chr$(1)+ "2",
& "X3Number=" +chr$(1)+ GOCXID,
& "X3Activation=" +chr$(1)+ "1",
& "Repaint=" +chr$(1)+ '10"%d"' + "1"
End
The Callocx statement makes it possible to use COM OBJects (OLE, ActiveX,...) in order to submit results in graphical form, for instance.
For the graphs, a standard structure of the graph must be previously generated in Visual Basic on PC. It is then stored on the server in the GRAPH directory of the folder with the extensin *.vtc. When used, it is transferred and stored on the client in the x3\report\folder_server_port directory. If such a structure is present on the client workstation, there are no transfers from the server.
This structure defines the initial presentation, such as:
This initial presentation can be modified upon execution at client workstation level. The modifiable data are:
There are standard parameters (starting with X3) and parameters specific to the OCX.
Parameters are passed under the form:
Parameter=Index+Value
Value must be alphanumerical and limitted to 255. This value is preceded by an index over one character thus allowing all the values for a given parameter to be regrouped and thus the limit of 255 characters to exceed for this parameter.
The standard parameters to be entered to call the Ocx are the following:
|
Parameter |
Description |
Value |
|
X3Action |
Executes an action for the OBJect |
"1" : Creation |
|
X3Number |
Identifies an OBJect. |
over 1 character. |
|
X3Event |
Used to manage or not the events from the COM OBJect |
"0" or "1" |
|
X3Message |
Those events that should be received. |
Event number |
|
X3Identification |
Identifies the OBJect that needs to be created |
character string |
|
X3Window |
Number of the window to which the OBJect is attached. |
"0" |
|
X3Left |
Left position of the OBJect at the fourth of the column |
numerical position |
|
X3Top |
Top position of the OBJect at the eigth of the line. |
numerical position |
|
X3Right |
Right position of the OBJect at the fourth of the column |
numerical position |
|
X3Bottom |
Bottom position of the OBJect at the eigth of the line. |
numerical position |
|
X3Activation |
Activates or deactivates the window that supports the Ocx. For lengthy processes, it is necessary to deactivate the window to avoid problems with the operator's handling operations. |
"0" : deactivation |
|
X3GetFile |
Access path and name of the *.vtc file on the server |
|
Each Ocx will have its own properties and methods. Parameters are passed under the form:
Parameter=Index+Format field+Value
Index : corresponds to the value of a same parameter being continued (similar to the standard parameters).
Format field: comprised of the requested function type, a Sub-type (not used in this version) and, mentioned between brackets, the Format that needs to specify the type of the transmitted data and the separation character between two data.
Function type:
1 : indicates an incoming property (PUT)
2: indicates an outgoing property (PUT)
3: indicates a methodSub-type:
0 : only value allowed for this version
Format:
"%d": designates a numerical field passed by value to the OBJect
"%s": designates an alphanumerical field passed by value to the OBJect
"%z": indicates a field with constant. Only the ADXDIR constant is managed in this version.
".s": indicates a numerical field to be passed as an alphanumerical value to the OBJect and that must be submitted to the local
transformations (decimal separator)Separator:
1st example, "%d;%s" specifies that the following string is comprised of a numerical field and an alphanumerical string to be found after the semi colon.
2nd example, "%d;%s,%d" 123; test with figures 4563.23 ,45
will give the value for the 1st parameter: 123
for the 2nd: test with figures 4563.23
for the 3rd: 45specifies that the following string is comprised of a numerical field and an alphanumerical string to be found after the semi colon.
# For instance, for the graph management OCX (First impression 5), the following is obtained: Callocx RETOUR ="" With
& "X3Action="+chr$(1)+"2",
& "X3Number="+chr$(1)+GOCXID,
& "ReadFromFile="+chr$(1)+'30"%s"' + "c:\trf\test.vtc",
& "ColumnCount="+chr$(1)+'10"%d"' + "4",
& "RowCount="+chr$(1)+'10"%d"' + "5",
& "TitletextColumnCount="+chr$(1)+'10"%s"' + "C'est le titre du graphe",
& "MenuItemVisible="+chr$(1)+'10"%d,%d"' + "0,0"
# ReadFromFile is a method with a string type parameter.
# ColumnCount is an incoming property with a numerical parameter.
# RowCount is an incoming property with a numerical parameter.
# TitletextColumnCount is an incoming property with a string type parameter
# MenuItemVisible is an incoming property with two numerical parameters
# separated by a comma.Information on these parameters can be found in OLE Object Viewer of Microsoft Visual Studio, for instance.
990="format""values"
The format:
This is a string comprised of:
The value:
They are subdivided according to the format:
For instance:
#XF"the string": it is a string of 35 alphanumerical characters whose value is "the string".
A 5 order can only return one value.
A property can only be accessed once in a message.
It is necessary to use X3Activation to manage the tunnels from an OBJect.
Events can be negative.
Not available in Web version
|
Error |
Description |
|
|
|
|
Copyright © Sage 1999 - 2007 |