report designer manual - 17.appendix ii

Upload: euelvis1045

Post on 06-Jul-2018

230 views

Category:

Documents


1 download

TRANSCRIPT

  • 8/16/2019 Report designer Manual - 17.Appendix II

    1/144

     Append ixⅡ

    . Report Designer Scrip t

    81

    About Report Designer Script

    The grammar  of Script in Report Designer is similar to C Language. This is the programlanguage, which provides programming function to the Fixed Form Report created on

    Report Designer.

    This function is enough to change the existing concept on the document and provide high

    possibility of transplantation to Korean style document creation as well. Of course, similarattempts have been tried, and some part of this function was once adapted by another

    development tool. However, its application area was very limited and otherwise it was veryinconvenient to use.

    Characteristics of a Script Program

    1Th

    , Program input/output skil l is the same as document editing skill on Editor.Considering that 60~70% of typical programming code is used to handle data input and

    output when application programs are made by a third generation programming language,this greatly increase the productivity of script programming.

    2Th, Data flow expression is very natural. Changes for data in a application program can

    be expressed as they are applied simply to several relevant applications.

    3Th

    , Report Designer Script conveniently supports the development of application

    programming in a Client/Server environment. Report Designer Script provides aprogrammer with the environment to use the programs and data equally regardless whether

    they exist in a server or in a client. It also provides the efficient client/server environment

    through ODBC connection, or through a specified DLL as well. 

    4Th, Report Designer Script treats the document and the scr ipt equally in the Graphic

    user connection environment.  So, a document is a script program and a program has the

    document functions. While creating a document, you can make a program at the same time.And you can add functions of script program to an existing document, and can easily change

    the program already made into the same format as the document. 

    5Th

    , Report Designer Script makes it possible to create high quality database

    application program and provides the functions to make lots of application programs

    in a short period of time. It makes it possible to make a simple 4GL or SQL Query

    sentences.

  • 8/16/2019 Report designer Manual - 17.Appendix II

    2/144

     Append ixⅡ

    . Report Designer Script

    82

    As a result of combining the functions of document and program, the graphics to be printed

    can have as high quality as ones to be shown on the screen. Also, it can be applied tovarious areas from the artificial intelligent document in which functions for a user can be

    programmed to the general data processing programs with the interface. After all, this will

    increase the productivity of work and development. 

    1 Make Script

    Scripts can be used in the Fixed Form Report among the 4 document types of ReportDesigner (General Document, Table, Label, Fixed Form Report). (It is possible that itcan be used in certain sections of  the General Document, Table, and Label.)

    1.1. Basic Information on Script

    1.1.1. Characteris tics of Fixed Form Document in Report Designer

    Text contents and programs made in Report Designer exist in one file. You create a

    document using the editing functions of Report Designer Editor. Then you can apply scriptsto the created document to complete the programming.

    Script wi ll be execute each time a query from the ‘Define Query’ reads in one result

    set(Record) from the database.

    With the Script, you can make a different Query and request the data from the database, and

    display those data after editing.

    Script execute once if the main query is not created in ‘Define Query’

    As Description above, normally in case of connecting database use the script used

    document also can be used in file connection document. But, in case of File connection, it

    could be used in a fixed form report only.

    1.1.2. Object and Object Variable

    Object

    Object means a unit which has data related to a function. All of items to be expressed in

    Report Designer are either an object or a part of an object.

  • 8/16/2019 Report designer Manual - 17.Appendix II

    3/144

     Append ixⅡ

    . Report Designer Scrip t

    83

    Report Designer function can be largely categorized into Edit function and Program function.

    Two functions are closely related to the Object.

    Edit function in Report Designer is to make or modify Objects, and Programming function is

    to describe scripts to the existing Objects.

    Object Variable

    Variables used in Report Designer are categorized into Object Variable, Local Variable and

    Temporary Variable. For more details on Variables, please refer to paragraph 2.2. Thissection will simply cover the object variable related with the object.

    Object Variable is the name that a user assigns to an object created in Report Designer.Variables can be assigned to all objects of documents in Report Designer.

    Object Variable name accepts both a lowercase and an uppercase, and can be applied to

    script statement and Internal Function. As the object variable name is a global variable, the

    name should be unique in a document.

    In order  to declare the object variable, select the object in the Edit Script dialog box andthen input variable name. And define the variable type.

    Variable type of the object variable is the data type of defined variables. Variable typeconsists of Char, Date, Number, or Time. However, not all variables may have a variable

    type. For example, graphics objects and bitmap objects do not have a variable type.

    Rule for naming an Object Variable

    When you assign a name for the object variable, you should keep in mind the fact that

    duplicate object name is not allowed in one file and that you can’t place a number asthe first character of the variable name.

    Also, words (Reserved word) predefined in the script cannot be used.

    Rules for naming an object variable are as follows.

  • 8/16/2019 Report designer Manual - 17.Appendix II

    4/144

     Append ixⅡ

    . Report Designer Script

    84

    T Exceptions to naming an object are as follows.

     Assign ing a name to the cel l in a table and the object

    In a table, you can assign variable names with sequential numbers to several cells inside atable in batch. This option is closely related to the table characteristics that the table is

    frequently used to display the repeated records, and that the cells in a table can be regularlyadded.

    TypeS of assigning variables in cells of a table are as follows.

    In the column of product name, the object name is given by order of Product Name1,

    Product Name2, Product Name3, Product Name4, and Product Name5. These are data withsame characteristics. When you assign the name through the script dialog box, if you

    select the column in which the name will be given and input the product name in the

    Variable input field, then the variable names will be given to cells from the first cell you

    selected by same order as the above table.

    It is possible to fix object variables by a vertical, diagonal or random selection as follows.

  • 8/16/2019 Report designer Manual - 17.Appendix II

    5/144

     Append ixⅡ

    . Report Designer Scrip t

    85

    (1)Vertical Selection (2)Diagonal Selection (3)Random Selection

    In the above example, in the case of assigning object variable name on multi columns, itassigns object variable name which has sequence number beginning at the top left column

    within blocked columns set. The order is from left to right and top to bottom.

    I (1) Example, If you input “a10” in the variable field of the script dialog box , serial numberswill be 10, 11, 12 starting from the top cell. The first cell will be given “a10”, the second cell

    “a11”, and the third cell “a12”.

  • 8/16/2019 Report designer Manual - 17.Appendix II

    6/144

     Append ixⅡ

    . Report Designer Script

    86

    1.1.3. Object and Script

    A user can assign a variable name to all objects in Report Designer and describe one script

    per each file. And, the objects with a variable type can have a value, but the objects withouta variable type can’t have a value.

    Object with a variable type (Object being capable of having a value)

    The objects of Text frame or Table cells can be used effectively to make a script program.

    [Objects in close relation to a script]

  • 8/16/2019 Report designer Manual - 17.Appendix II

    7/144

     Append ixⅡ

    . Report Designer Scrip t

    87

    Object without a variable type (Object with the value)

    Objects not being able to have variable types cannot input or output the data by using ascript.

    1.1.4. Executing Report Designer Script

    In case of a Fixed Form Report, the time when a script is executed

  • 8/16/2019 Report designer Manual - 17.Appendix II

    8/144

     Append ixⅡ

    . Report Designer Script

    88

    When scripts are executed whenever page content created from main query result record in

    database connection or base field define result on file connection document.

    In case General document, Table and Label type report include a script, the time when

    a script i s executed

    Only in the time of opening a file first, a script will be executed.

    1.2. Script Descript ion Procedure

    Script description procedure will be as follows.

    1. By selecting Database-Edit Scr ipt or pressing the button in the toolbar, open the Edit

    Script Dialog box.

    2. After selecting the object to describe the script , input the variable name in the

    Variable Name field, and assign the variable type.

    Only after you input the variable name into the object, you can use it in the script. 

    3. After describing the corresponding script in the script edit window, verify it or click Close 

    button.

    4.

    1.2.1. Variable

    In Report Designer, there are three ways to define the variable and use them.

    1Th, Object Variable assigns a variable name to an object,

    2Th

    , Global Variable, which is not an object variable name, can be used in the entire

    program,

    3Th

    , Local Variable can be used only within one script.

    1.2.2. Script Editing

    For user’s convenience, Script Editing functions such as Block unit Copy (,

    ), Cut (, ), Paste (, < Ctrl+V>), and Find/ReplaceString() are provided. 

    Find/Replace String can be used to find a location of a character string or replace it withother character string.

  • 8/16/2019 Report designer Manual - 17.Appendix II

    9/144

     Append ixⅡ

    . Report Designer Scrip t

    89

    If you press , while editing a script, Find/Replace dialog box will appear.

    .

    If you click Word Only check box, you can find the word consisting of input character string.And, if you check Case Sensiti ve check box, you can find a character string in which all of

    upper cases and lower cases coincide.

    Making a search will start from a location where a cursor blinks in the current Editwindow. In case a cursor moves to the end, a search is made for it from the beginning again.

    In case there is no more string to find in Find/Replace string opt ion, the following dialog

    box will appear.

    1.2.3. Checking Script Syntax

    Report Designer interprets scripts described in the Script Input dialog box.

    Script creation and Syntax checking is made on Report Designer Editor , and on ReportDesigner Viewer  the described script will be interpreted and according to a result of

    interpretation, the script will be executed.

    Assuming that Script Input dialog box opened, and the object with the script described is

    selected, the time when this script is interpreted in Report Designer is as shown below.

      In case of pressing OK or Verify button in the Script dialog box

      In case of pressing Close button in the Script dialog box

      In case of opening the document which includes the script in Report Designer

  • 8/16/2019 Report designer Manual - 17.Appendix II

    10/144

     Append ixⅡ

    . Report Designer Script

    9

    Viewer  

    When a script is interpreted, script syntax is checked. If a syntax error is found, the errormessage will appear. If not, a confirmation message will appear.

    Error message will notify the column number and the contents of an error  and show thecharacter string with syntax error in the string or script between “☞ ☜" marks.

    .

  • 8/16/2019 Report designer Manual - 17.Appendix II

    11/144

     Append ixⅡ

    . Report Designer Scrip t

    91

    2 Script Syntax

    2.1. Constant

    Character, Number, Data and Time etc. are the constants which can be used in a script.

    2.1.1. String constant

    String Constants are expressed as characters other than Null Constant (Null Character: "")and any characters except control characters can be used. 

      String constants must be enclosed within Quotation marks ( " ) 

      Maximum string length is 256 characters for English characters, numbers, andsymbols. It is 128 characters Korean characters

      When you include a quotation mark inside a string constant, use a wave pattern

    character  (~ : Escape Character).

    Example) "ABC", "1234", "Soft", "&$%@#", "Product0+Product1", "~"Country~"", "~~abc"

    Here, “~"Country~"”  expresses the string of “Country”, and “~~abc" expresses thestring of ~abc.

    The wave pattern (~) quote can be used in front of special character used in SQL

    statement when you create Query in the script.

    2.1.2. Number Constant

      Number constant is expressed by an integer or a real number  

       A negative number and number below decimal point  can be expressed.

      The maximum significant digit of a number constant is 15 

    Example) 123, 123.0, -123, 16.98

  • 8/16/2019 Report designer Manual - 17.Appendix II

    12/144

     Append ixⅡ

    . Report Designer Script

    92

    2.1.3. Date Constant

    Date Constant is expressed inside a Quotation Marks (“ “ ) with the delimiter, '/' like

    “YYYY/MM/DD”, “YY/MM/DD” or “MM/DD”. The default year in the system clock is assumedfor the following format: “MM/DD”

    Example) "1994/01/20", "94/2/5". "9/1"

    In Report Designer Script, a record can be made of Date Constant from the year 1900. 

    2.1.4. Time Constant

    Time Constant is expressed inside a Quotation marks (“ “ ) with the delimiter, ':' like“HH:MM:SS” or “HH:MM”. And 24 hour expression is used.

    Example) "12:00", "3:53:29", "17:23"

  • 8/16/2019 Report designer Manual - 17.Appendix II

    13/144

     Append ixⅡ

    . Report Designer Scrip t

    93

    2.2. Variable

    2.2.1. Kinds of Variables

    The maximum length of a variable is 20 characters for English, and in Korean, 10 characters.

    The variable should start with a character  or ' _ '. Small letter and Capital letter are notdistinguished in the variable name. And the variable can be divided into 3 types based on

    types.

    Object variable

    Object Variable is the name that a user assigns  to an object created in Report Designer.

    And you cannot assign the same variable name to two or more objects in one file.

    In order to declare the object variable, select the object in the Script dialog box, and assignthe variable name and type..

    In Report Designer, other objects except table cells and text frames (Example:

    Circle, Line, Cylinder…) can’t have a variable type..

    The variable value change can be modified in the Edit Script dialog box.

    Local variable

    Local Variable is the variable that is meaningful only inside a script.

    An effect is not exerted on an object. And, while performing an operation, String variable and

    Number variable will be always initialized to " " (Null Character) and 0 respectively. In otherwords, the local variable is only valid during the period when a script is executed and,

    after an execution is completed, the value is not saved.

    Number, Character, Date and Time can be used as the variable type for the local variable.And it is used as follows. 

    NUM i, j;

    CHAR s;

    DATE d;

    TIME t; 

  • 8/16/2019 Report designer Manual - 17.Appendix II

    14/144

     Append ixⅡ

    . Report Designer Script

    94

    Temporary variable

     A temporary Variable is a variable generated automatically in a time when a value is

    assigned to a variable other than the object variable or the local variable, as a result of scriptexecution. Therefore, the temporary variable is valid during the time when the file is

    opened and its value will not be saved in the file.

    For example, when B is not declared as an object variable (A is an object variable), if you

    describe a script as B = A, then a temporary variable, B will be generated. Of course, if yougive the variable name, B to other object later, a temporary variable will be changed into an

    object variable.

    A temporary variable is recognized as a string variable as a specific variable type is notdeclared. So, in case of using a temporary variable for drawing a comparison between

    largeness and smallness, a comparison will be drawn in ASCII order.

    As a comparison between largeness and smallness for String variable drawn in ASCIIorder it will be “10”

  • 8/16/2019 Report designer Manual - 17.Appendix II

    15/144

     Append ixⅡ

    . Report Designer Scrip t

    95

    2.2.2. Variable Type

    Variable Type is the type of record kept in the variable. According to the variable type

    (Variable type: String, Number, Date, Time), the variable can be divided into 4 types.

    Date variable keeps the record of date from the year 1900 as a Julian Date value.

    Time variable keeps the time record as the time value.

    When you convert the type of a variable with a different variable type, the first priority is

    given to the string variable.

    2.2.3. Using Variable in Script

    To use the variable in the script, you can use the variables explained in the above, and also

    you can use it more effectively by using a Meta Character  such as?, $, [] (Array variable), ..,#.  The benefits of Meta Characters are that you can express the number of variables at

    once.

    ? is a meta character corresponding to one character. For example, if you express a?, itindicates all of the variables, which have only one character after a, among variables starting

    from a.

    $ is a meta character corresponding to 0 or more characters. For example, if you express a$,it indicates all of the variables, which start from a, including a.

    Example) Script using ? and $

    a? = 10;

    s = SUM (a$);

    If a variable name ends with 1 or more, it is regarded as an array variable. For example, all

    of a1, a2, a3, … a10 are array variables with a name including a.

    Array variables can be declared to each of objects one by one and can be declared to table

    cells at once after selecting them. At this time, even if the variable types are different, it

    doesn’t matter.

    If a declaration is made as an array variable, you can describe a script by using Meta

    character such as “..“. “..“  indicates all of array variables between the first array variableand the last array variable. For example, as for m = avg(a1..a10), the average of all arrayvariables with a digit among 1 ~ 10 in the array variables, which start from a, will be saved

    into m.

  • 8/16/2019 Report designer Manual - 17.Appendix II

    16/144

     Append ixⅡ

    . Report Designer Script

    96

    2.3. Arithmetic Expression

    Arithmetic Expression is an expression showed by arithmetic operators, and the following

    symbols can be used for it.

      “ +” Plus or Positive mark

      “ –“  Minus or Negative mark

      “ * “ Multiply

      “ / “ Divide

      % Residual except for a quotient gotten from a front value divided by a rear value

    In an arithmetic expression, Constant, Variable, Logical Expression, Relational

    Expression and Internal Function can be used for an operand and the result value isa number .

    Example

    a = 2 + 3 * 5;

    b = (a - b) / 2 + (a + b) * 2;

    Net Income = SUM (Sales$) - SUM(Cost$);

  • 8/16/2019 Report designer Manual - 17.Appendix II

    17/144

     Append ixⅡ

    . Report Designer Scrip t

    97

    2.4. Relational Expression

    Relational Expression is an expression showed by relational operators, and the following

    operators can be used. Relational operator can be used to compare operands quantitatively.

      =

    It is “true” if the left operand is greater or equal to right operand. If the right is greater than

    left side, it is “false”.

      >

    It is “true" if the left operand is greater than right operand. If the right side is greater or equalto left side, it is “false”.

      ==

    It is “true” if the both of operands are equal. If the both of operands are unequal, it is “ false.

      !=

    It is “true” if the both of operands are unequal. If the both of operands are equal, it is “false”.

    In a relational expression, Constant, Variable, Logical Expression, Arithmetic Express  

    and Internal Function can be placed as the operand. And the result value will be express

    as ‘true’ or ‘false’. And ‘true’ and ‘false’ is respectively ‘1’ and ‘0’.

    String Constant and String Variable can be placed as the operand. In case when alloperands are String Constant or String Variable, comparison is made by order of

    Dictionary. For example, when you compare “report” and “designer”, as “designer” comesfirst in a dictionary, “designer” is less than “report”. In case when Give attention when

    comparing to “2” and “100”, because the result of dictionary style comparison is that “2” isgreater than “100”.

    Dictionary style comparison means to compare by the order of words listed in a

    dictionary.

  • 8/16/2019 Report designer Manual - 17.Appendix II

    18/144

     Append ixⅡ

    . Report Designer Script

    98

    Example

    ret = (200 >= 100);

    //ret Result value:True

    ret = "Report Designer" > "M2Soft";//ret Result value:False

    a = 100;b = "200";

    ret = a < b;//ret Result value:True

    a = "Report Designer";b = 100;

    ret = a < b;

    //ret Result value:Error

  • 8/16/2019 Report designer Manual - 17.Appendix II

    19/144

     Append ixⅡ

    . Report Designer Scrip t

    99

    2.5. Logical Expression

    A logical expression is an expression using logical operator. The following symbols can be

    used.

       AND, &&

    If all the operands at both sides are ‘true’ then the results will be ‘true’. If only one side is ‘false’, the results will be ‘false’.

      OR, ||

    If one of the operands on both sides is ‘true’ then the results will be ‘true’. If both sidesare ‘false’ then the results will be ‘false’.

      !

    Negates the resul t of operand coming after "!".

    In a logical expression, a constant, variables, relational expression, arithmetic

    expression and internal functi ons can be placed as the operands. The result value willbe ‘True’ or ‘False’, and 1 for ‘true’ and 0 for ‘false’.

    Example

    a = 1;b = 0;c = 1;d = 0;

    ret = (a && b) || (c || d);// ret Result value:True

    a = 100;b = 200;

    c = 300;ret = ((a < 200) AND (b == 200)) OR (c == 400);

    // ret Result value:True

    a = "ABC";

    b = 100;ret = a || (b == 100);

    // ret Result value:Error

  • 8/16/2019 Report designer Manual - 17.Appendix II

    20/144

     Append ixⅡ

    . Report Designer Script

    1

    2.6. String Expression

      &

    This connects one string to the other string. As for a function, it plays the same part asstrcat()function.

    2.7. Compound Expression

    The operands in a compound expression can be expressions (arithmetic expression,

    relational expression or logical expression). Expression can be placed all of thearithmetic operators, logical operators and relational operators. 

    Example

    ret = ((a + b) > c) AND (k < b);

    ret = (Birth Date > "1964/3/1") && (male && Finish Military service) &&

    (SUM (Salary$) < Dependent * Living expense per capital);

    2.8. Priority in Operators

    Operators are ( ), !, +(positive number mark), -(negative number mark), *, /, %, +, -, > , >=,

  • 8/16/2019 Report designer Manual - 17.Appendix II

    21/144

     Append ixⅡ

    . Report Designer Scrip t

    1 1

    2.9. Type Conversion Rule

    Type conversion rules for constants or variables in scripts are as follows.

    2.9.1. Type Conversion of Constants or Variables in OperationalExpressions and Internal Functions

    In general, the variables or constants used as arguments of operational expression or

    Arguments of internal functions should have appropriate types according to the types ofoperators or internal functions. When they are not in appropriate types, they will be

    processed with automatic type conversion.

    Type conversion rules of constants or variables in operational expressions and internal

    function are as follows.

    The first column represents the necessary types according to operators or internal functions.The first row represents the types of variables or constants that the user actually used. Forthe cells with assigned numbers, a type will be converted automatically.

    ①  In order to operate numbers and characters, characters will be converted to numbers.

    ② 

    In order to operate numbers and dates, dates will be converted to Julian date value.

    ③  In order to operate numbers and times, times will be converted to time value.

    ④  In order to operate characters and dates, characters will be converted to dates if the

    characters have “YYYY:MM:DD”, “YY:MM:DD” or “MM:DD” type.

    ⑤  In order to operate characters and times, characters will be converted to times if the

    characters have “HH:MM:SS” or “HH:MM” type

    ⑥  You cannot operate dates and times together.

    In case of not being convert by the above type conversion rule, then an error message,

  • 8/16/2019 Report designer Manual - 17.Appendix II

    22/144

     Append ixⅡ

    . Report Designer Script

    1 2

    “ Inaccurate Type Conversion” , will be displayed. You have to manually change the

    variable types appropriately.

    2.9.2. Type Conversion of Constants or Variables in SubstitutionParagraphs

    A substitution paragraph is a statement that substitutes a variable on the left side of theexpression with the operational result of the right side. A substitution paragraph can be

    expressed as "Variable = Operational expression | Built -in function;" .

    When the result of operational expression or internal function on the right side is notapplicable to the variable types of the left side variable, an automatic type conversion willbe executed based on the variable type of left side

  • 8/16/2019 Report designer Manual - 17.Appendix II

    23/144

     Append ixⅡ

    . Report Designer Scrip t

    1 3

    3 Command Statement

    Script statements are local variable declaration statement, substitution statement, and

    control statement. All statements should be terminated with a “;” (semicolon) except for

    the statements meaning a specific block. The examples of specific block are; ENDIF (end ofIF block, ENDFOR (end of FOR block), ENDWHILE (end of WHILE block), andENDSWITCH (end of SWITCH block).

    In the Description of statements and internal functions, [ ] means that an omission is possible,and |  means that you can use one or more of the choices selectively. The Statement

    means one or more paragraphs or internal functions.

    3.1. Local Variable Declaration

    A local variable is a variable used within a script only. In the local variable declarationstatement, its types are CHAR, DATE, NUM, and TIME.

    3.1.1. CHAR StatementSyntax

    CHAR Variables List;

    Description

    Declare local variable with character variable type. Can declare array variable as well.

    CHAR type variable means a string. It doesn’t mean a character type variable in other

    languages, i.e. a character.

    Example

    CHAR GRADE[10];

    CHAR LEVEL;

    CHAR A, B, C, D;

  • 8/16/2019 Report designer Manual - 17.Appendix II

    24/144

     Append ixⅡ

    . Report Designer Script

    1 4

    3.1.2. DATE Statement

    Syntax

    DATE Variables List; 

    Description

    Declare local variable with Date variable type. Can declare array variable as well.

    Example

    DATE today;

    DATE days[10];

  • 8/16/2019 Report designer Manual - 17.Appendix II

    25/144

     Append ixⅡ

    . Report Designer Scrip t

    1 5

    3.1.3. NUM Statement

    Syntax

    NUM Variables List;

    Description

    Declare local variable with numeric variable type. Can declare array variable as well.

    Example

    NUM Score;

    NUM Age[12];

    NUM rank_a, rank_b, rank_c;

  • 8/16/2019 Report designer Manual - 17.Appendix II

    26/144

     Append ixⅡ

    . Report Designer Script

    1 6

    3.1.4. TIME Statement

    Syntax

    TIME Variables List; 

    Description

    Declare local variable with time variable type. Can declare array variable as well.

    Example

    TIME now;

    TIME event[10];

  • 8/16/2019 Report designer Manual - 17.Appendix II

    27/144

     Append ixⅡ

    . Report Designer Scrip t

    1 7

    3.2. Substitution Statement

    A Substitution Statement is a command to substitute a variable with a result of an

    operation. You can give values to all objects that can have values with them. For example,if there is a text frame object, which has a variable name “text frame 1” with a Character

    variable type. And if a script, text frame 1 = “Good morning” has been executed, then “Goodmorning” will be inputted in a text frame.

    3.2.1. =

    Syntax

    Variable = Operation Expression | Internal Expression;

    Description

    Substitute the variable on the left with an operation expression or internal expression on theright

    Example

    Company Name = "M2Soft";

    number = 123;greater = Record1 > Record2;

    first = !first;Gang$ = 0;

    The maximum value = MAX (value1..value10);

  • 8/16/2019 Report designer Manual - 17.Appendix II

    28/144

     Append ixⅡ

    . Report Designer Script

    1 8

    3.3. Control Statement

    A Control Statement is a command to execute or s top statement according to a condition.

    In the control statement, there are BREAK, CONTINUE, IF-ENDIF, FOR-ENDFOR, RETURN,CALL, SWITCH-ENDSWITCH, and WHILE ENDWHILE statements.

    3.3.1. BREAK Statement

    Syntax

    BREAK;

    Description

    It is used when interrupting the execution of a script or when stopping and exiting

    FOR/WHILE statement, during the execution of it, even though the result of conditionalparagraph is true. It can also be used to exit SWITCH statement after executing only thecorresponding CASE block in it.

    Example

    char Msg;

    FOR (Index = Last; Index >= Start; Index = Index - 1)

    IF (name[Index] == "")CALL error( );

    BREAK; // Exit FOR paragraph.

    ENDIFENDFOR

    IF (Name[Index] == "")Break; // Stop Execution

    ENDIF

  • 8/16/2019 Report designer Manual - 17.Appendix II

    29/144

     Append ixⅡ

    . Report Designer Scrip t

    1 9

    3.3.2. CONTINUE Statement

    Syntax

    CONTINUE; 

    Description

    CONTINUE Statement is used within FOR-ENDFOR and WHILE-ENDWHILE statements, a

    control statement to be executed iteratively. When CONTINUE statement is executed in aniterative execution statement, a move is made to the last of an iterative execution statement

    without the execution of sentences after CONTINUE statement.

    Example

    FOR (Index = 1; Index

  • 8/16/2019 Report designer Manual - 17.Appendix II

    30/144

     Append ixⅡ

    . Report Designer Script

    11

    3.3.3. IF-ENDIF Statement

    Syntax

    IF (Conditional Paragraph) sentence 1 [ELSE sentence 2]

    ENDIF [;] 

    Description

    If the conditional statement is ‘true’ then execute sentence 1, if it is ‘false’ then executesentence 2.

    A logical expression or relational expression can be used in a conditional statement.

    You can nest If statement at sentence 2. In this case, if the result of the first IF function isfalse, then look for the result of the second IF function. There should be the same number of

    ENDIF statements as IF statements.

    Example

    IF (Tax> 100000 ) Level = "High";ELSE Level = "Low";

    ENDIF

    IF (Score > 90) Grade = "A";ELSE IF (Score > 80) Grade = "B";

    ELSE IF (Score > 70) Grade = "C";ELSE IF (Score > 60) Grade = "D";

    ELSE Grade= "F";

    ENDIF;ENDIF;

    ENDIF;

    ENDIF

  • 8/16/2019 Report designer Manual - 17.Appendix II

    31/144

     Append ixⅡ

    . Report Designer Scrip t

    111

    3.3.4. FOR-ENDFOR Statement

    Syntax

    FOR ([ execution statement]; [Conditional statement]; [execution statement])

    Sentence

    ENDFOR [;]

    Description

    While conditional paragraph is ‘true’, it executes statement inside FOR statement iteratively.

    Logical expression or Relational expression can be used at Conditional statement, and it can

    be omitted.

    The former execution clause and the latter execution clause are the conditions determining

    the number of repeats for FOR Statement.

    Substitution statement, control statement and local variable declaration, etc can be placed in the first

    execution paragraph or the second execution paragraph.

    Example

    FOR (Employee= 1; Employee

  • 8/16/2019 Report designer Manual - 17.Appendix II

    32/144

     Append ixⅡ

    . Report Designer Script

    112

    3.3.5. SWITCH-ENDSWITCH Statement

    Syntax

    SWITCH (operation expression)

    CASE Constant:

    Sentence;

    [CASE Constant:

    Sentence;]

    [default:

    Sentence;]

    ENDSWITCH [;]

    Description

    Execute the sentence of relevant CASE paragraph when the value of operation expression isthe same as constant of CASE. The “IF” statement selectively executes one of two

    commands according to a given condition, whereas SWITCH statement selects execution ofone among many commands according to the values of operation expression.

    Example

    SWITCH ( type )CASE 101:

    total = (a+b) * 0.8;BREAK;

    CASE 102:total = (a+b) * 0.9;

    BREAK;

    DEFAULT:total = a + b;

    ENDSWITCH

  • 8/16/2019 Report designer Manual - 17.Appendix II

    33/144

     Append ixⅡ

    . Report Designer Scrip t

    113

    3.3.6. WHILE-ENDWHILE Statement

    Syntax

    WHILE (Conditional Paragraph)

    Sentence

    ENDWHILE [;]

    Description

    Execute sentence iteratively while the result of conditional paragraph is ‘true’. Logical

    expression or relational expression can be used in conditional paragraph.

    Example

    Employee = 1;Gross Amount= 0;

    WHILE ( Employee

  • 8/16/2019 Report designer Manual - 17.Appendix II

    34/144

     Append ixⅡ

    . Report Designer Script

    114

    4 Internal Function

    An internal function is used within a s tatement, and it includes Arguments in

    parentheses. Each Argument differs according to the function, and separated by a comma

    (,). An internal function can use another internal function as its Argument, and you can nestup to 10 functions. 

    4.1. Types of Funct ions

    The internal function of Report Designer Script, object related function, digital relatedfunction, word related function. Date/time related function, database related function, Drawobject and properties related function are offered. Those functions are used a report to be

    drawn by developer’s design as it is possible to edit and calculate atypical data with much

    easier process.

    4.1.1. ADDDATABODY()

    Syntax

    ADDDATABODY(argstr);

     Argument

    argstr

    String that name of object variable, must become string type as tied by quotes “ ”

    “Name of object variable”; normal case

    “EndAddDataBody”: must be used in case of finished table enlargement of a table

    “name of object variable(pageBreak)”: repetition enlargement with turning page.

    Return Value

    Number

    1: 1 is always returned.

    Description

    Function to add repeating part of a table when you use the table with a repetition specified

    column in the script, i.e. a fixed form report

    In case of creating document as the table document, the table is expanded whenever it

  • 8/16/2019 Report designer Manual - 17.Appendix II

    35/144

     Append ixⅡ

    . Report Designer Scrip t

    115

    brings data from database server. However in static document which uses script , even

    though it has row set to repeat, it is not expanded automatically , so it needs a function toexpand, therefore the ADDDATABODY( ) function.

    You can use one of object variables applied on repetition section as a Argument ofADDDATABODY( ) function. If there are 2 tables to contain repetition section in one page,

    and when you need to expand other table while expanding one table with this function, youshould finish currently expanding table by using “EndAddDataBody” as a Argument, and

    input variable name of other table. In order to pass page at certain moment, you should use“variable (PageBreak)” as a Argument.

    Example

    num i, ret;char oldee;

    i = 1;a = :a1;

    cursor = "mycursor";

    execfile declare :cursor cursor;declareeor("\\eor");

    declarefield(cursor, 1, 200);

    declarefield(cursor, 1, 200);

    declarefield(cursor, 1, 200);declarefield(cursor, 1, 200);

    declarefield(cursor, 1, 200);

    while(1)

    ret = execfile fetch :cursor into :aa, :bb, :cc, :dd, :ee;if(ret != 1)AddDataBody("EndAddDataBody"); /* Finish the currently expanding table */

    break;endif

    b = aa;c = bb;

    d = cc;e = dd;

    f = ee;if(i == 1)

    oldee = ee;endif

    if(i > 1 && strcmp(ee, oldee) != 0)

    AddDataBody("b(PageBreak)"); /* Table with b object on the next page */oldee = ee;

    else

  • 8/16/2019 Report designer Manual - 17.Appendix II

    36/144

     Append ixⅡ

    . Report Designer Script

    116

    AddDataBody("b"); /* Expand the table with b object */

    endif

    i = i+1;

    endwhile

    execfile close :cursor;

  • 8/16/2019 Report designer Manual - 17.Appendix II

    37/144

     Append ixⅡ

    . Report Designer Scrip t

    117

    4.1.2. ADDDATALINE()

    Syntax

    ADDDATALINE(argstr);

     Argument

    argstr

    String with name of object variable

    “Name of object variable” : must input in type of string as tied by””

    Return Value

    Number1: 1 is always returned.

    Description

    It draws lines having the properties of the upper lines with repetition applied, when a table

    contains repetition row in a static form document, i.e. a script document.

    You can use summary clause, when you draw a line on every certain row in Table document.

    That is, if you define condition of summary and didn’t define create summary, then only lineshape above summary field appears. However, in order to use this function from a static

    using script, this function is used.

    Example

    if(i == 5)AddDataBody("b"); /* print repetition section where b object is located */

    elseAddDataBody("b");

    AddDataLine(“c”); /* print a line above repetition section where c object is located.*/

    endif

  • 8/16/2019 Report designer Manual - 17.Appendix II

    38/144

     Append ixⅡ

    . Report Designer Script

    118

    4.1.3. AVG()

    Syntax 

    AVG (arglist);

     Argument

    arglist

    Argument list to show variables which will be calculated average value.

    a1,a2,a3 : three variables of a1, a2, a3

    a1…a10 :ten variables of between a1~a10

    Return Value

    Number type

    Average value of returned arguments

    Description

    Calculate the average of argument list. One or more Constant, Variable or operationExpression can be used as Arguments.

    .

    Example 

    ret = AVG (0,1,2,3,4,5,6,7,8,9);

    ret = AVG (a, b, c);

    ret = AVG (a + b, 36/5 - 1, c * d);

    ret = AVG (a$, b?);

    ret = AVG (a1..a10);

    tot_avg = AVG (SUM (Korean$), SUM(English$), SUM(Mathematics$));

  • 8/16/2019 Report designer Manual - 17.Appendix II

    39/144

     Append ixⅡ

    . Report Designer Scrip t

    119

    4.1.4. BLANK()

    Syntax

    BLANK();

     Argument

    varname

    object variable name of formatted object

    Return Value

    Nonexistence

    Description 

    Blank removes the format of an object with pre-defined format (Example: Text Box indicating

    Date) and make it blank.

    Example

    . blank(date_var);

    // Delete the format “YYYYMMDD” of Date Object date_var and convert it to blank.

  • 8/16/2019 Report designer Manual - 17.Appendix II

    40/144

     Append ixⅡ

    . Report Designer Script

    12

    4.1.5. CHANGEATTR()

    Syntax

    CHANGEATTR(varname, code, value);

     Argument

    varname

    Object variable to change properties

    code

    String shows code to change properties

    valueString shows execute value of code to change properties

    Return Value

    Nonexistence

    Description

    Modify the properties of a cell of Table or TextFrame(Facet properties, Font, Font color).

    Value of execution code is applied as properties. Usually, in case of satisfying a condition orwhen intending to change character properties, it is used.

    When you need to give several execution codes at the same time, by using ‘@’ character asa delimiter, a connection is made of every code each other. Also, the same goes forexecution values. The execution codes and values are as follows.

  • 8/16/2019 Report designer Manual - 17.Appendix II

    41/144

     Append ixⅡ

    . Report Designer Scrip t

    121

    [Kinds and values of execution codes]

    Example

    changeattr (a, "FN", "Gulim");

    changeattr (a, "BC", "256,256,0");

    changeattr (a, "FA@FS", "B@15");

    Reference

    CHANGEROWATTR()

  • 8/16/2019 Report designer Manual - 17.Appendix II

    42/144

     Append ixⅡ

    . Report Designer Script

    122

  • 8/16/2019 Report designer Manual - 17.Appendix II

    43/144

     Append ixⅡ

    . Report Designer Scrip t

    123

    4.1.6. CHANGEROWATTR()

    Syntax

    CHANGEROWATTR(varname, code, value);

     Argument

    varname

    Object variable to change properties.

    code

    String shows code to change properties.

    valueString shows execute value of code to change properties.

    Return Value

    Nonexistence

    Description

    Modify properties of row in table(Facet Properties, Fonts, Character color)

    This function modifies the properties of TextFrame of row in Table by certain value. Basicallyit is the same as changeattr( ) function but this function applies to a row unit.

    So you can change row of table include varname total properties by using this function.

    And when you need to give several execution code at the same time use ‘@’ character as adelimiter..

    Refer to CHANGEATTR() function for execution code and value.

    Example

    changerowattr (a, "FN", "Gulim");

    changerowattr (a, "BC", "256,256,0");

    changerowattr (a, "FA@FS", "B@15");

    Reference

    CHANGEATTR(), CHANGETEXTATTR()

  • 8/16/2019 Report designer Manual - 17.Appendix II

    44/144

     Append ixⅡ

    . Report Designer Script

    124

    4.1.7. CHANGETEXTATTR()

    Syntax

    CHANGETEXTATTR(varname, inx, strsub, code, value, allflag)

     Argument

    varname

    Object variable to apply.

    inx

    Number to show location in the varname string which is start to fine strsub. Start from 1.

    strsubstring or string variable to fine out in varname string.

    code

    string shows code to change properties.

    valuestring shows execute value of code to change properties.

    allflag

    Number display to change all the matched strings or first one that find out.0: change the properties of fist string that find out only1: change all the properties of matched string.

    Description

    A function to change string properties of searched string which is strsub string on varname

    string. Similar with changeattr function but just added string to find out(str).Properties of totalstring is change, if give the str value as “”(null string).

    Caution) As for the value of a location to find out strsub on varname string, it will be differentbetween Unicode version and general version. In case of Unicode version location and

    length of characters relate with number of character but In general case relate with numberof bite. In case of a character by a character, the length is 1 in Unicode version but It is 2 in

    general version.

    There are several execution codes, link each code with separator character ‘@’ and execute

    value as the same. Execute code value as shown below.

  • 8/16/2019 Report designer Manual - 17.Appendix II

    45/144

     Append ixⅡ

    . Report Designer Scrip t

    125

    [Type and value of execution value]

    Example

    changetextattr(CustomerID, 1, "ATR", "FA", "B", 1);

    //Find out all the ATR strings in CustomerID string and change to thicker font.

    Reference

    CHANGEATTR(), CHANGEROWATTR()

  • 8/16/2019 Report designer Manual - 17.Appendix II

    46/144

     Append ixⅡ

    . Report Designer Script

    126

    4.1.8. CONNECTDB()

    Syntax

    CONNECTDB (connectionid, ipaddr, port, service, dbname, userid, password);

     Argument

    connectionid

    Connection identifier . ConnectDB() id character to use in query and etc, after callingfunction.

    ipaddrIP address

    port

    Port number of database to connect

    serviceService name

    dbname

    DB name made from database service.

    useridUser id in database service

    password

    Password in database service

    Return Value

    Number type0 : Connection Failure

    1 : Connection Success

    Description

    Allow to connect to several Database from one document. That is, Function to connect

    another database server when databases are scattered at several servers and the

    connection to the current database has been terminated. Only, The DBMS of All DB servermust be the same.

    To disconnect from the database server that was connected by CONNECTDB() function,

    DISCONNECT() function should be used.

    Without using ODBC, This function is available only when you use direct connection library

    for Report Designer v2.5 supported database (ORACLE, SYBASE, and UNISQL etc.).

  • 8/16/2019 Report designer Manual - 17.Appendix II

    47/144

     Append ixⅡ

    . Report Designer Scrip t

    127

    All the Arguments may not be used and the Arguments are to be used in accordance with the

    database server’s properties.

    Using Argument for database connecting is as shown below.

    Example

    // ORACLE direct connectionCONNECTDB (“orar”, “”, “”, “oraservice”, “”, “m2”, “m2soft”);

    // SYBASEdirect connection

    CONNECTDB(“syb”, “”, “”, “sybservice”, “m2db”, “m2”, “m2soft”);

    An example of EXECSQL for detailed example.

    Reference

    DISCONNECTDB ( ), EXECSQL

  • 8/16/2019 Report designer Manual - 17.Appendix II

    48/144

     Append ixⅡ

    . Report Designer Script

    128

    4.1.9. COS()

    Syntax

    COS(arg)

     Argument

    arg

    Radian style number or type of number variable

    Return Value

    Number typevalue of cosign

    Description

    This is a function that calculates cosine value of trigonometrically function. Used for the

    mathematical statistics or numerical value operation, not for the general purposes. TheArgument is formed as radian type.

    Example

    num ret, PI;

    PI = 3.141592;ret = COS (PI/2);

    ret = COS (SUM (a, b, c, d));

    ret = COS (PI/3 – PI/6 + AVG (a, b, c, d));

    Reference

    SIN(), TAN()

  • 8/16/2019 Report designer Manual - 17.Appendix II

    49/144

     Append ixⅡ

    . Report Designer Scrip t

    129

    4.1.10. CURRENTDATE()

    Syntax

    CURRENTDATE ();

     Argument

    Nonexistence

    Return Value

    Number type

    Julian date value convert to number of current date.

    Description

    This is a function to get Julian Date of the current system.

    Example

    DATE d;num cdate;

    cdate = CURRENTDATE();d = cdate + 10; /* Date value of 10 days later */

    Reference

    CURRENTTIME(), DATE(), TIME()

  • 8/16/2019 Report designer Manual - 17.Appendix II

    50/144

     Append ixⅡ

    . Report Designer Script

    13

    4.1.11. CURRENTTIME()

    Syntax

    CURRENTTIME(); 

     Argument

    Nonexistence

    Return Value

    Type of time

    Time value of current time.

    Description

    This is a function to get the current time.

    Example

    time ctime

    ctime = CURRENTTIME(); // ctimeis a TIME type variable

    Reference

    CURRENTDATE(), DATE(), TIME()

  • 8/16/2019 Report designer Manual - 17.Appendix II

    51/144

     Append ixⅡ

    . Report Designer Scrip t

    131

    4.1.12. DATE()

    Syntax

    DATE(julian, kind);

     Argument

     julian

    Number to display julian date.

    kind

    Kind of value to return.YEAR : yearMONTH : month

    DAY : day

    WEEKDAY : weekday (1: sunday, 2: monday ..., 7: saturday)

    Return Value

    Number types

    the returning value according to kind value.

    Description

    Extract a desired value(year, month, day or weekday) from Julian date value.

    Example

    NUM Curdate;NUM Day;

    Curdate = CURRENTDATE();

    iYear = DATE(curdate, YEAR);

    iMonth = DATE(curdate, MONTH);

    iDay = DATE(curdate, DAY);

    Day = DATE(curdate, WEEKDAY);

    if (Day == 1)sWeekDay = "Sunday";

    endif

    Reference

    CURRENTDATE(), CURRENTTIME(), TIME()

  • 8/16/2019 Report designer Manual - 17.Appendix II

    52/144

     Append ixⅡ

    . Report Designer Script

    132

    4.1.13. DECLAREEOR()

    Syntax

    DECLAREEOR(str);

     Argument

    str

    String to separate subdata. Basic value is //EOR//.

    Return Value

    Number type0: failure1: success

    Description

    When you use a script for file connection, you have to define a field using DECLAREFIELD()function to support the subquery.

    When you get data values using Execfile fetch function, you have to indicate EOR (end of

    record) for a data file to recognize the end of data records corresponding to each subquery.

    In this case, you can specify the EOR using DECLAREEOR() function. The default value ofEOR has been set as “//EOR//” without calling the function.

    Example

    Refer to an example of DECLAREFIELD()

    Reference

    DECLAREFIELD(), EXECFILE

  • 8/16/2019 Report designer Manual - 17.Appendix II

    53/144

     Append ixⅡ

    . Report Designer Scrip t

    133

    4.1.14. DECLAREFIELD()

    Syntax

    DECLAREFIELD(cursorname, type, length) ;

     Argument

    cursorname

    cursor name of subdata

    type

    field type1: CHAR2: NUMERIC

    9: DATE

    10: TIME12: VARCHAR (when the field include opening character)

    lengthlength of field(maximum length to display current data)

    Return Value

    Number type0: failure1: success

    Description

    Define field corresponding to a subquery when a script is used for file connection..

    In file connection static form document, when you create a document in the same format as

    a subpage, you should define a corresponded field type and length to support sub field.

    If this function is called for the first time, it notifies column information that contains Argument

    (cursor name, type and length) to a cursor. At second call, notifies 2nd column information.All of the Arguments should be defined before you call fetch function.

    Example

    aaa = :a1;bbb = :a2;

    ccc = :a3;

    ddd = :a4;eee = :a5;

    cursor = "mycursor";

  • 8/16/2019 Report designer Manual - 17.Appendix II

    54/144

     Append ixⅡ

    . Report Designer Script

    134

    execfile declare :cursor cursor; // Cursor definition

    declareeor(“_EOR_”) ;

    declarefield(cursor, 1, 30); // character Add a character type 30 bite length column

    declarefield(cursor, 1, 30); // character Add a character type 30 bite length columndeclarefield(cursor, 1, 30); // character Add a character type 30 bite length column

    while(1)// Because 3 columns declared

    ret = execfile fetch :cursor into :fff, :ggg, :hhh;

    if(ret != 1) // return 0 when meeting end of recordAddDataBody("EndAddDataBody");

    Break;endifAddDataBody("fff");

    xxx = :a2;

    yyy = :a3;endwhile

    // Close a cursor at the end..

    execfile close :cursor;

    Reference

    EXECFILE

  • 8/16/2019 Report designer Manual - 17.Appendix II

    55/144

     Append ixⅡ

    . Report Designer Scrip t

    135

    4.1.15. DEFINECHART()

    Syntax

    DEFINECHART(chartname, axisname, dataname);

     Argument

    chartname

    variable name of chart object

    axisname

    string to display axis name of chart

    datanamestring to display data apply at axis

    Return Value

    Nonexistence

    Description

    Function to define necessary information for chart object

    Used to define chart objects in a script. After defining corresponding variables for X Axis, YAxis, and Z axis, you can draw a chart by using DrawChart() function that transmit each

    variable values to a chart object.

    Definechart(),drawchart() function was applied in primary version of Report Designer(before3.0). You can use defineseries(), drawseries() functions which are added with teechart is

    offer.

    Example

    definechart(mychart, "X", "Products.ProductName");

    definechart(mychart, "Y", "Categories.CategoryName");definechart(mychart, "Z", "Products.UnitsInStock");

    catename = :Categories.CategoryName;cursor = "mycursor";

    query = "SELECT C.CategoryName, P.ProductName, P.UnitPrice, P.UnitsInStock FROMCategories C, Products PWHERE C.CategoryID = P.CategoryID AND Categories.CategoryName = :catename

    ORDER BY C.CategoryName, P.ProductName";

    execsql declare :cursor for :query;

  • 8/16/2019 Report designer Manual - 17.Appendix II

    56/144

     Append ixⅡ

    . Report Designer Script

    136

    for(i=0; i

  • 8/16/2019 Report designer Manual - 17.Appendix II

    57/144

     Append ixⅡ

    . Report Designer Scrip t

    137

    4.1.16. DEFINESERIES()

    Syntax

    DEFINESERIES(chartname, seriesname, var1, var2, var3);

     Argument

    chartname

    variable name of chart object

    seriesname

    string to display series name that chart object has. Must be tied by “ ”. Anticipateformatted series in editor. When viewer execute, re-naming sequence at formattedseries such as “S0”, “S1”, “S2” …. The numbers in the above names and index of series

    may alter, if series is deleted cause of calling Deleteseries() function.

    var1String shows variable name to apply at Series. Must be tied by “ “.

    var2

    String shows variable name to apply at horizontal axis of Series. Must be tied by “ “.

    var3

    Normally input “ “(null string) but in case of using variable name should be tied by “ “.

    When variable name is applied and drawseries() is called, it is current variable and is

    added to series and displayed on Legend if its value is different from the previous value.

    Return Value

    Nonexistence

    Description

    Function to assign data variable name which will be applied to seriesname series. Var1 is

    series data value, and var2 is data value of axis that series refers to. 

    Example

    defineseries(mychart, "S0", "stock", "productname", "");

    defineseries(mychart, "S2", "order", "productname", "");deleteseries(mychart, "S1");

    setseriestitle(mychart, "S0", "stock amount");

    setseriestitle(mychart, "S2", "order amount");

    cid = :Categories.CategoryID;

  • 8/16/2019 Report designer Manual - 17.Appendix II

    58/144

     Append ixⅡ

    . Report Designer Script

    138

    category = :Categories.CategoryName;

    cursor = "mycursor";

    query = "select products.ProductName, products.UnitsInStock, products.UnitsOnOrder

    from Products where Products.CategoryID=:cid";

    execsql declare :cursor cursor for :query;

    first = 1;

    while(1)ret = execsql fetch :cursor into :productname,:stock,:order;

    if(ret != 1 && first == 0)AddDataBody("EndAddDataBody");break;

    endif

    drawseries(mychart, "S0");drawseries(mychart, "S2");

    AddDataBody("productname");first = 0;

    endwhile;

    execsql close :cursor;

    Reference

    DEFINESERIESXY(), DEFINESERIESXYS(), DRAWSERIES()

  • 8/16/2019 Report designer Manual - 17.Appendix II

    59/144

     Append ixⅡ

    . Report Designer Scrip t

    139

    4.1.17. DEFINESERIESXY()

    Syntax

    DEFINESERIESXY(chartname, seriesname, x, y, label);

     Argument

    chartname

    variable name of chart object

    seriesname

    string to display series name that chart object has. Must be tied by “ ”. Anticipateformatted series in editor. When viewer execute, re-naming sequence at formattedseries such as “S0”, “S1”, “S2” …. The numbers in the above names and index of series

    may alter, if series is deleted cause of calling Deleteseries() function.

    xstring display variable name to apply at X axis. Must be tied by “ “.

    y

    string display variable name to apply at Y axis. Must be tied by “ “.

    Label

    string display variable name to use as label. Must be tied by “ “.

    Return Value

    Nonexistence

    Description

    Function to assign X axis and Y axis variable names which will be applied to seriesname. Incase of a specific series, it can not be assigned as defineseries() function cause of requiring

    Y axis data. In this case using defineseriesxy().

    Example

    char a1, a3;char a2, a4;

    defineseriesxy(mychart, "S0", "a1", "a2", "");defineseriesxy(mychart, "S1", "a3", "a4", "");

    a1 = 0;a2 = 0;

    a3 = 0;

    a4 = 7.251;

  • 8/16/2019 Report designer Manual - 17.Appendix II

    60/144

     Append ixⅡ

    . Report Designer Script

    14

    drawseries(mychart, "S0");

    drawseries(mychart, "S1");

    a1 = 0;

    a2 = 0;a3 = 23.3;a4 = 45.1;

    drawseries(mychart, "S0");

    drawseries(mychart, "S1");

    Reference

    DEFINESERIES(), DEFINESEARIESXYZ()

  • 8/16/2019 Report designer Manual - 17.Appendix II

    61/144

     Append ixⅡ

    . Report Designer Scrip t

    141

    4.1.18. DEFINESERIESXYZ()

    Syntax

    DEFINESERIESXYZ(chartname, seriesname, x, y, z, label);

     Argument

    chartname

    variable name of chart object

    seriesname

    string to display series name that chart object has. Must be tied by “ ”. Anticipateformatted series in editor. When viewer execute, re-naming sequence at formattedseries such as “S0”, “S1”, “S2” …. The numbers in the above names and index of series

    may alter, if series is deleted cause of calling Deleteseries() function.

    xstring display variable name to apply at X axis. Must be tied by “ “.

    y

    string display variable name to apply at Y axis. Must be tied by “ “.

    z

    string display variable name to apply at Z axis. Must be tied by “ “

    label

    string display variable name to use as label. Must be tied by “ “.

    Return Value

    Nonexistence

    Description

    Function to fix X axis, Y axis, Z axis variable name to apply at seriesname. In case of specify

    series, It can be accord can not fix with defineseies() function cause of require Y axis data. Inthis case using defineseriesxy().

    Example

    Refer to example of DEFINESERIESXY( ).

    Reference

    DEFINESERIES(), DEFINESERIESXY()

  • 8/16/2019 Report designer Manual - 17.Appendix II

    62/144

     Append ixⅡ

    . Report Designer Script

    142

    4.1.19. DELETESERIES()

    Syntax

    DELETESERIES(chartname, seriesname);

     Argument

    chartname

    variable name of chart object

    seriesname

    string to display series name that chart object has. Must be tied by “ ”. Anticipateformatted series in editor. When viewer execute, re-naming sequence at formattedseries such as “S0”, “S1”, “S2” …. The numbers in the above names and index of series

    may alter, if series is deleted cause of calling Deleteseries() function.

    Return Value

    Nonexistence

    Description

    Function to delete seriesname series. When you designing chart of report on Editor, In case

    of you made many serieses, delete unusing series on executing Viewer.

    Example

    Refer to an example of DEFINESERIES( ).

    Reference

    DEFINESERIES()

  • 8/16/2019 Report designer Manual - 17.Appendix II

    63/144

     Append ixⅡ

    . Report Designer Scrip t

    143

    4.1.20. DELWSPACE()

    Syntax

    DELWSPACE(str, pos); 

     Argument

    str

    string to delete null space

    pos

    number to display location of deleting null.-1: delete front side null of string.-In case of non 1: delete back side of string.

    Return Value

    stringstring with except null space.

    Description

    Delete white spaces (Tab, Blank and Return) ahead of or after character string. If the

    position is -1, then delete blank characters from the front, otherwise delete from behind.Blank Characters in the middle of character string cannot be deleted.

    Example

    a = " White Space";ret = DELWSPACE (a,-1); // ret = "White Space"

    a = "Blue Sky ";

    ret = DELWSPACE (a,1); // ret = "Blue Sky"

  • 8/16/2019 Report designer Manual - 17.Appendix II

    64/144

     Append ixⅡ

    . Report Designer Script

    144

    4.1.21. DISCONNECTDB()

    Syntax

    DISCONNECTDB(connectionid);

     Argument

    connectionid

    ID string to database connect in ConnectDB() function.

    Return Value

    Number type0: failure1: success

    Description

    This is a function to disconnect database connection connected using CONNECTDB()function. Disconnect from current connected database server in order to connect withanother database when the databases are scattered across several servers.

    To connect with another database server with CONNECTDB() function, disconnect from the

    currently connected server first by using DISCONNECT() function.

    Without using ODBC, This function is available only when you use direct connection libraryfor Report Designer v2.5 supported database (ORACLE, SYBASE, and UNISQL etc.).

    Example

    DISCONNECTDB (“oras”); // Use the first Argument at CONNECTDB() function

    Refer to the example of EXECSQL for a detailed example.

    Reference

    CONNECTDB(), EXECSQL

  • 8/16/2019 Report designer Manual - 17.Appendix II

    65/144

     Append ixⅡ

    . Report Designer Scrip t

    145

    4.1.22. DRAWCHART()

    Syntax

    DRAWCHART(chartname);

     Argument

    chartname

    variable of chart object

    Return Value

    Nonexistence

    Description

    Draw a chart object.

    Function to draw a chart after defining chart object in a script. After definition ofcorresponding variables for X Axis, Y Axis, and Z axis with DefinChart() function,

    DrawChart() function transmits each variable value to a chart object in order to draw a chart.

    Definechart(),drawchart() function was provided in primary version of Report Designer(before

    3.0). You can use defineseries(), drawseries() functions which are added as teechart isprovided in Report Designer.

    Example

    Refer to the example of DEFINECHART().

    Reference

    definechart(), defineseries(), drawseries()

  • 8/16/2019 Report designer Manual - 17.Appendix II

    66/144

     Append ixⅡ

    . Report Designer Script

    146

    4.1.23. DRAWIMAGE()

    Syntax

    DRAWIMAGE(x, y, path, width, height, opt);

     Argument

    x

    number display X coordinates to print image.unit of coordinates value and basic location follow using of Report Designer.1 inch as

    1000

    ynumber display Y axis to print image.

    path

    string to display image path.

    widthnumber of image width.

    heightnumber of image height.

    optnumber to display option.

    0: format image with no size.1: format image with proportional size

    Return Value

    Nonexistence

    Description

    Image file which in path, function drawing specify size width, height to specify location x, y ofreport.

    Example

    char path;

    path = “http://www.m2soft.co.kr/testimage.jpg”;

    drawimage(100, 100, path, 2000, 1000, 0);

  • 8/16/2019 Report designer Manual - 17.Appendix II

    67/144

     Append ixⅡ

    . Report Designer Scrip t

    147

    4.1.24. DRAWLINE()

    Syntax

    DRAWLINE(x1, y1, x2, y2, command, value);

     Argument

    x1

    number of X coordinates which is start point to draw line.unit of coordinates value and basic location follow using of Report Designer.1 inch as

    1000

    y1number of Y coordinate which is start point to draw line

    x2

    number of X coordinate which is end point of drawing line

    y2number of Y coordinate which is end point of drawing line

    commandstring defining the shape and properties of line arrow.

    valuestring displaying a value according to a command

    Return Value

    Nonexistence

    Description

    Function to draw line object.

    At calling this function, if some Arguments are not defined, they will follow properties definedby SETDRAWOBJECTTR(). “Command” defines “properties” and “value” is assigned to the“properties”.

    Example

    num x1, y1, x2, y2;

    x1 = 1000;

    y1 = 1000;

    x2 = 5000;y2 = 1000;

  • 8/16/2019 Report designer Manual - 17.Appendix II

    68/144

     Append ixⅡ

    . Report Designer Script

    148

    drawline(x1, y1, x2, y2, "LS@LT@LC", "2@1@255,0,0");

    // draw 4 inches red dotted row line on the top of report.

  • 8/16/2019 Report designer Manual - 17.Appendix II

    69/144

     Append ixⅡ

    . Report Designer Scrip t

    149

    4.1.25. DRAWSERIES()

    Syntax

    DRAWSERIES(chartname, seriesname);

     Argument

    chartname

    variable name of chart object

    seriesname

    string to display series name that chart object has. Must be tied by “ ”. Anticipateformatted series in editor. When viewer execute, re-naming sequence at formattedseries such as “S0”, “S1”, “S2” …. The numbers in the above names and index of series

    may alter, if series is deleted cause of calling Deleteseries() function.

    Return Value

    Nonexistence

    Description

    Defineseries() draws “Chart Object” selected by “chartname” and “seriesname”. Whenever

    calling this function, one record is applied to “Chart”.

    Example

    Refer to example of DEFINESERIES( ).

    Reference

    DEFINESERIES(), DELETESERIES()

  • 8/16/2019 Report designer Manual - 17.Appendix II

    70/144

     Append ixⅡ

    . Report Designer Script

    15

    4.1.26. DRAWTEXT()

    Syntax

    DRAWTEXT(x1, y1, x2, y2, text, command, value)

     Argument

    x1

    number display start point of drawing line by X coordinates.unit of coordinates value and basic location follow using of Report Designer.1 inch as

    1000

    y1number display start point of drawing line by Y coordinates.

    x2

    number display end point of drawing line by X coordinates.

    y2number display end point of drawing line by Y coordinates.

    textcontents string of text frame

    commandstring define properties of text frame.

    valuestring display value as command

    Return Value

    Nonexistence

    Description

    This function draws “TextFrame”. If some Arguments are not defined at calling this function,they will follow properties defined by SETDRAWOBJECTTR().“Command” defines

    “properties” and “value” is assigned to the“properties”.

    Example

    num x1, y1, x2, y2;

    x1 = 1000;

    y1 = 1000;x2 = 5000;

  • 8/16/2019 Report designer Manual - 17.Appendix II

    71/144

     Append ixⅡ

    . Report Designer Scrip t

    151

    y2 = 1500;

    drawtext(x1, y1, x2, y2, "TEST STRING", "FN@FS", "Tahoma@20");// draw 4inches text frame on top of the report.

  • 8/16/2019 Report designer Manual - 17.Appendix II

    72/144

     Append ixⅡ

    . Report Designer Script

    152

    4.1.27. DRILLDOWN()

    Syntax

    DRILLDOWN(mrdpath, param);

     Argument

    mrdpath

    mrd file consisting of template to be shown by DRULLDOWN() file.

    param

    Report Designer Argument option to open “mrd” file.additional Arguments/rdrillright : To be shown at the right side of “hyperlink Object”.

    /rdrillover : To be shown at the top of “hyperlink Object".

    Return Value

    Number type

    Description

    This function is used in “result report”. If DRILLDOWN() is called twice for an “Object”, theresult is the same as DRILLUP() Function is applied.

    This function can not be used for script of “Fixed Form“report. The functions, which can be

    used only for Hyperlink Object’s script, are DRILLDOWN(), DRILLUP() and SORTDATA() etc.

  • 8/16/2019 Report designer Manual - 17.Appendix II

    73/144

     Append ixⅡ

    . Report Designer Scrip t

    153

    Example

    drilldown("ordserstatistics.mrd", "/rp [Less than 10] /rdrillright ");

    Reference

    DRILLUP()

  • 8/16/2019 Report designer Manual - 17.Appendix II

    74/144

     Append ixⅡ

    . Report Designer Script

    154

    4.1.28. DRILLUP()

    Syntax

    DRILLUP();

     Argument

    Nonexistence

    Return Value

    Nonexistence

    Description

    This function deletes “Object” inserted by DRILLDOWN(). If DRILLDOWN is applied to an“Object” twice, the result is the same as DRILLUP() is applied.

    This function can not be used for script of “Fixed Form“report. The functions, which can beused only for Hyperlink Object’s script, are DRILLDOWN(), DRILLUP() and SORTDATA() etc.

    Example

    Refer to example of DRILLDOWN() function

    Reference

    DRILLDOWN()

  • 8/16/2019 Report designer Manual - 17.Appendix II

    75/144

     Append ixⅡ

    . Report Designer Scrip t

    155

    4.1.29. EXECFILE

    Syntax

    EXECFILE DECLARE cursor

    EXECFILE FETCH INTO ;

    EXECSQL CLOSE ;

     Argument

    sting variable to designate . is designated in DELAREclause, and is closed in CLOSE clause.

    In case of main data, data variable list as many as numbers of field declared in field

    definition. In case of sub data, data variable list as many as declarefieldI() function isexecuted.

    Return Value

    Number type

    1: successother : failure

    Description

    Used for processing of values in a file connected by a script while file connection in fixedform document.

    This function is exactly the same as EXECSQL in DB Connection document. Except, there isno reconciliation with query paragraph in DECLARE paragraph. A query paragraph is not

    needed because EXECFILE gets data directly from a text file, whereas EXECSQL attemptsto get a data directly from a database.

    The logic for bringing data from Text file by using EXECFILE in static document created by

    script.

    DECLARE statement set cursor on the location of first record in query result table. FETCHstatement brings data from query result table by moving the cursor down one row and itends when cursor has reached the final record. Then, the cursor is closed by CLOSE

    statement.

    EXECSQL can have multi-query at the same time, but the report using EXECFILE can have

    only one cursor at a time cause it brings record from the first record to the final record one

    after another in text file

  • 8/16/2019 Report designer Manual - 17.Appendix II

    76/144

     Append ixⅡ

    . Report Designer Script

    156

    Use declarefield( ) to define field definition for each record set when you create a document

    (sub page document of table document) which has Master-detail structure or prints severalrecord set.

    Example

    Refer to the example of DECLAREFIELD()

    Reference

    EXECSQL, DECLAREFIELD(), DECLAREEOR()

  • 8/16/2019 Report designer Manual - 17.Appendix II

    77/144

     Append ixⅡ

    . Report Designer Scrip t

    157

    4.1.30. EXECSQL

    Syntax

    EXECSQL DECLARE CURSOR FOR [ON ];

    EXECSQL FETCH INTO ;

    EXECSQL CLOSE ;

    EXECSQL COMMAND [ON ];;

     Argument

    sting variable to designate . is designated in DELAREclause, and is closed in CLOSE clause.

    string variable including query statement to fetch data.

    connection id connected other database service by using ConnectDB() function.

    data variable list as many as numbers of field in” Select” clause of statement.

    Return Value

    Number type

    1: success

    other: failure

    Description

    Performs cursor declaration, data fetch, and exit cursor, etc. for execution of SQL paragraph.

    A FETCH paragraph gets data from database, which declared in a query paragraph asvariables (object variable, local variable, temporary variable). At every execution of FETCH

    paragraph, it gets one record. In order to get next data, you have to execute FETCH

    paragraph one more time.

    CLOSE paragraph ends the cursor declared by DECLARE paragraph.

    Here, we show Description with the result query table after executing SQLstatement.

    DECLARE statement sets cursor on the location of first record in query result table. FETCH

    statement brings data from query result table by moving cursor down one row and it ends

  • 8/16/2019 Report designer Manual - 17.Appendix II

    78/144

     Append ixⅡ

    . Report Designer Script

    158

    when cursor reaches the last record. The cursor is then closed by CLOSE statement.

    FETCH paragraph returns 1 for a successful execution, 0 for if there’s no more data, and –1for errors occurred, respectively. DECLARE and CLOSE paragraphs return 1 for successful

    execution and 0 for errors occurred respectively.

    To get data values from another database server under a scattered database server

    environment, you have to make cursor to connect with a specific database server by addingON at the end of DECLARE paragraph. Here, The is a connection

    handle made by CONNECTDB().

    Notice) it is possible to index host variable in SQL Clause. However identifier using as

    “Number” and “variable of “num “ type can be indexed and “expression” or “function” can notbe used.

    Example

      Example 1

    num employee, num I, tord;date tgord;num ret_m, ret_s, tunit, tquan, tprod;

    kname = :Employees.FirstName;

    ename = :Employees.LastName;sex = :Employees.TitleOfCourtesy;phone = :Employees.HomePhone;address = :Employees.Address;

    employee = :Employees.EmployeeID;

    /* like above example, in case that inputting data brought by Database-Query define Menu

    as a variable by substitution sentence */

    /* Use cursor and query as a SQL host variables for communication */

    cursor = "mycursor";

    query = "select orders.OrderID, orders.OrderDate, orders.CustomerID from orderswhere orders.EmployeeID = :employee";

    /*Input “:” infront of variable name in case that using script internal variable in conditionclause of Query statement */

    execsql declare :cursor cursor for :query;

    for(i=1; i

  • 8/16/2019 Report designer Manual - 17.Appendix II

    79/144

     Append ixⅡ

    . Report Designer Scrip t

    159

    endif

    /* Using :tored, the host variable, you can create a dynamic query. */

    cursor1 = "mycursor1";

    query1 = "select O.UnitPrice, O.Quantity, O.ProductID from [order details] Owhere O.orderid = :tord";

    execsql declare :cursor1 cursor for :query1;ret_s = execsql fetch :cursor1 into :tunit, :tquan, :tprod;

    if (ret_s != 1)

    execsql close :cursor1;continue;

    endif

    /* Important: Without using variables using index inside SQL, a object variable will be

    replaced after the successful fetch execution, in order not to printout incorrect values

    occurred by errors / the end of a data. */orderid[i] = tord;gorderdate[i] = tgord;

    unitprice[i] = tunit;quantity[i] = tquan;

    product[i] = tprod;

    total[i] = tunit * tquan;

    /* to reuse the cursor inside loop, you have to close with execsql close paragraph. */

    execsql close: cursor1;endfor

    execsql close :cursor;

      Example 2

    num I;

    date tgord;num ret_m, ret_s;num count;

    dbname1 = “mydb1”;

    /* For a connection to Oracle, using ServiceName, UserID, and Password in connectdbfunction will be enough. */Connectdb(dbname1, “ “, “ “, “halla”, “ “, “scott”, “tiger”);

    Cursordb = “mycursordb”;

    Querydb = “select kwnam, chasu, addr, kwcod, sogwan from cdkikw_f”;

    /* To connect to databases scattered, attach connection name connected by connectdb

  • 8/16/2019 Report designer Manual - 17.Appendix II

    80/144

     Append ixⅡ

    . Report Designer Script

    16

    function at the end while create a cursor for a query. (on :dbname1)

    */execsql declare : cursordb cursor for :squerydb on :dbname1;

    dbname2 = “mydb2”;

    connectdb(dbname2, ““, ““, “baekdu”, ““, “scott”, “tiger”);

    cursordb2 = “mycursordb2”;

    querydb2 = “select s_name, s_num, s_addr, s_code, s_birth from student”;execsql declare :cursordb2 cursor for :querydb2 on :dbname2;

    while(1)count = count + 1;

    if(count == 10)break;

    endif

    ret_s = execsql fetch :cursordb into :f1, :f2, :f3, :f4, :f5;if (ret_s != 1)

    AddDataBody(“EndAddDataBody”);

    break;endif

    ret_s = execsql fetch :cursordb2 into :f6, :f7, :f8, :f9, :f10;if (ret_s != 1)

    AddDataBody(“EndAddDataBody”);

    break;endif

    AddDataBody(“f2”);

    Endwhile

    // Close a cursor..

    execsql close :cursordb;execsql close :cursordb2;

    // Close the connected database

    disconnectdb(dbname1);disconnectdb(dbname2);

  • 8/16/2019 Report designer Manual - 17.Appendix II

    81/144

     Append ixⅡ

    . Report Designer Scrip t

    161

    4.1.31. FORMAT()

    Syntax

    FORMAT(varname, str, opt)

     Argument

    varname

    Variable to be changed into a specific string Format. Only number, date and timevariable are supported.

    strString to designate “Format”.

    opt

    0 : Show “meaningless Number”. Example) 2005-12-041 : No show “meaningless Number”. Example) 2005-12- 4

    Return Value

    StringString to be changed as “Format”

    Description fraction

    This function changes “ value of variable name” into “ String Format” . Return value

    is “ string” changed as “ String Format” . Usually “ Edit Format” allows defining

    “ String Format” , However if you want to use two or more kinds of data at the same

    place, this function is more useful. For typical example, after changing a specific

    format into a string, you can connect it to other data with & operator.

    Opt, “ meaningless number” is, for example, ‘ 0’ in front of ‘ 9’ of 2005-09-10

    so if those are removed, return value is “ 2005-9-10” .In case of decimal fraction,

    this function removes the last ‘ 0’ below decimal point.

    In case that “ varname” is “ number format” , only “ String Format” available in

    “ Edit Format” can be used.

    Example

    ret = format(dateval, “yyyy-mm-dd”, 0)// if date Foramt data “datival” is “Jan. 30, 2006”

    //return value: ret == “2006- 1-30”

    ret = format(numval, “#,###.###”, 1)

    //If numerical Fromat data “ numval is 1234.56, return valye: ret == “1,234.560”

  • 8/16/2019 Report designer Manual - 17.Appendix II

    82/144

     Append ixⅡ

    . Report Designer Script

    162

    ret = format(timeval, “hh:mm:ss”, 1)// Time Format data ‘ timeval” is “at noon”, return value: ret = “12:00:00”

    Reference

  • 8/16/2019 Report designer Manual - 17.Appendix II

    83/144

     Append ixⅡ

    . Report Designer Scrip t

    163

    4.1.32. GETGLOBAL()

    Syntax

    GETGLOBAL(varname);

     Argument

    varname

    string to display global variable name, must be tied by” “.

    Return Value

    stringvalue of global variable

    Description

    This function fetches “value” from a specific global variable.

    In Fixed Form Report, script is running per each record of main data and each script has a

    independent variable(Object, Local and Temporary ). When you want to apply a specificresult value of script to the next script, it would be passed as a global variable.

    SETGLOBAL() function sets a variable as a global variable, and GETGLOBAL() function

    gets data from a global variable.

    Example

    char dname, new_dname;

    dname = getglobal(“g_dname”);

    …if (new_dname != “”)

    setglobal(“g_dname”, new_dname);

    endif

    Reference

    SETGLOBAL()

  • 8/16/2019 Report designer Manual - 17.Appendix II

    84/144

     Append ixⅡ

    . Report Designer Script

    164

    4.1.33. GETPARAM()

    Syntax

    GETPARAM (arg);

     Argument

    arg

    string to display variable name inputted by Argument

    Return Value

    stringvalue of arg variable

    Description

    This function loads value passed by /rp, /rv Argument into script when it is executed as

    Viewer.

    The Arguments at GETPARAM function is an Argument name assigned in the ReportViewer execution. That is, when value is passed by /rp or /rpn Argument, it is $1, $2, etc.

    and when value is passed by /rv Argument, it is a variable name defined in /rv Argument

    definition.

    When the corresponding Argument is not found, errors occur during execution. TheArgument definition is performed in the second argument of FileOpen() Method in case of

    using OCX Viewer and is performed in execution Argument in case of executing EXE Viewer.

    Example

    CHAR s1;

    s1 = GETPARAM (“$1”); /* The value of s1 is the character string corresponding to $1*/

  • 8/16/2019 Report designer Manual - 17.Appendix II

    85/144

     Append ixⅡ

    . Report Designer Scrip t

    165

    4.1.34. GOTOPAGE()

    Syntax

    GOTOPAGE(pageno);

     Argument

    pageno

    Number to display page No.

    Return Value

    Nonexistence

    Description

    At crating a report with DRAWLINE(), DRAWTEXT() function, this function allows moving to

    other page from current page.

    pageno: page number

    Reference

    DRAWLINE(), DRAWTEXT()

  • 8/16/2019 Report designer Manual - 17.Appendix II

    86/144

     Append ixⅡ

    . Report Designer Script

    166

    4.1.35. LIBFREE()

    Syntax

    LIBFREE(filename);

     Argument

    filename

    DLL file name which rode from LIBLOAD()

    Return Value

    Nonexistence

    Description

    Report Designer provide a function allowing external libraries(Dynamic Linking Library:, DLL)

    in script. It is very useful because any libraries can be used. Refer to LIBLOAD().

    Free DLL (Dynamic Linking Library). A file name will be used as an Argument. The

    Argument should agree with the file name used as an Argument in LIBLOAD function.

    In order to use DLL file, those are modified to be suitable for Report Designer.

    Example

      Example of Script

    num n;num ret;

    char libname;char s;

    libname = "e:\testdll\release\example.dll";

    Libload(libname);

    ret = Hello(s, n);messagebox(s, "string", OK);

    messagebox(n, "count number", OK);

    ret = Hello(s, n);messagebox(n, "count number", OK);

    ret = Hello(s, n);

    messagebox(n, "count number", OK);

    LibFree(libname);

  • 8/16/2019 Report designer Manual - 17.Appendix II

    87/144

     Append ixⅡ

    . Report Designer Scrip t

    167

      EXAMPLE.DLL prepared using C

    The example DLL is compiled in Microsoft Visual C++ 5.0.

    /* ----------------------------------------------------------* Report Designer Example DLL *

    * FILE : Example.C ** Author : M2Soft *

    * Date : 1998.05.01. by T.H. Kim ** Compiler : Microsoft Visual C++ 5.0 *

    ---------------------------------------------------------- */

    #include #define DllExport __declspec( dllexport )

    /* ----------------------------------------------------------

    * > >* hello(str, num) ---> _M_HELLO(int argc, char *argv [])

    * ~~~ ~~~ argc == 2;* argv