Abstract:
An object of the invention is to provide a form processing technique relating to the outputting of a tabular-format object in a form generated by entering field data into a field, wherein the technique makes it possible to generate a form having an attractive appearance irrespective of the amount of data in the field data. To attain this object, a form processing program according to the invention has functions for determining whether a setting has been made to link and output the output position of the object to the output position of a variable-length table that will be output on a form; acquiring an offset value of the linked object if it has been determined that a setting has been made to link and output the output position of the object; and deciding and outputting the output position of the object based upon the output position of the variable-length table and the offset value. The program further includes a function for setting the form file of the form based upon an indication from the user in such a manner that the object will be linked to the table and then output, and a function for storing the setting that has been made.

Description:
CLAIM OF PRIORITY 
   This application claims priority from Japanese Patent Application No. 2003-279972 filed on Jul. 25, 2003, the entire contents of which are incorporated herein by reference. 
   FIELD OF THE INVENTION 
   This invention relates to a form processing technique for entering data that is described in a data file (this data shall be referred to as “field data” below) to into a “field” (a memory area in a program that accepts field data) defined beforehand in a “form file” that indicates the layout of a form, thereby generating a form that incorporates the field data. 
   BACKGROUND OF THE INVENTION 
   As shown in  FIG. 4 , conventionally a form is generated using a form file  400  indicative of the layout of a form ( 420 ). When field data  410  is entered into a field, control is performed in such a manner that the field data  410  will be output in an output area defined by a “field object”  402  [a graphic indicating the output area of the field data  410 , which has been entered into the field, on the form ( 420 )] described in the form file  400 . This control generates the form (for example, see the specification of Japanese Patent Application Laid-Open No. 2001-283140). 
   It is possible to specify the output style (output format) of the field data  410  with respect to the field object  402 . In general, a character for specifying the output format is referred to as an “output picture”. For example, if it has been so defined that an output picture “K” outputs just one character, control is performed so as to extract and output not a numerical value but only a character from the field data that has been entered. In a case where there are five “K”s, as shown in  FIG. 4 , control is performed in such a manner that up to five characters of field data will be output into the field object  402 . 
   Furthermore, with regard to the field object  402 , it is possible to define it so that a tabular object (table), for example, will be output using the entered field data  410 . Examples of tabular-format objects that can be defined so as to be output into the field object  402  are a variable table in which the number of table lines changes in accordance with the amount of data in the field data  410 , and a fixed table in which the number of table lines is constant irrespective of the amount of data in the field data  410 . 
     FIG. 5  is a diagram illustrating the manner in which a form  520  is generated by entering field data  510  into a form file  500  defined in such a manner that a tabular object (a variable table) will be output into a field object  502 . As illustrated in  FIG. 5 , the form (an invoice in this case)  520  that has been output spans three pages, on the third page of which the number of lines of the table is made two in conformity with the amount data in the field data  510 . 
   However, in a case where the form file has been defined in such a manner that a tabular object will be output into the field object, there are instances where, depending upon the amount of data in the field data, the form in which the field data has been incorporated takes on an unattractive appearance. 
   For example, as shown in  FIG. 6 , it is possible to place a separate object  604  underneath a field object  602  in the creation of a form file. With a variable table, however, if the amount of data in field data  610  is small, then an unnecessary blank space  621  is formed between the object  604  placed beneath the field object  602  and the last line of the table that is output into the field object  602 . In the case of a fixed table, on the other hand, it is possible to so arrange it that such a blank space will not be created. Instead, however, if the amount of data in the field data  610  is small, blank lines  631  in the field data  610  that are devoid of entries will be output. 
   Thus, if a form file is defined in such a manner that a tabular object will be output, then, in the case of a variable table, a blank space will be formed between the last line of the table that is output into the field object and an object placed beneath the field object. In the case of a fixed table, blank lines in which no field data has been entered will appear. A problem which arises, therefore, is that the form produced in either case will be unattractive depending upon the amount data in the field data. 
   SUMMARY OF THE INVENTION 
   Accordingly, an object of the present invention is to provide a form processing technique relating to the outputting of a tabular-format object in a form generated by entering field data into a field, wherein the technique makes it possible to generate a form having an attractive appearance irrespective of the amount of data in the field data. 
   According to the present invention, the foregoing object is attained by providing a form processing method for generating a form by entering data into a form file, which has a field object indicating an output area of the data to be entered into a field, and an object that appears in an area other than the field object, and causing the data to be output in the output area indicated by the field object, the method comprising a linkage determining step of determining whether a setting has been made to link an output position of the object to an output position of the field object into which a variable-length table is output by entering the data; if it has been determined at the linkage determination step that a setting has been made to link the output position of the object, an offset-value acquisition step of acquiring an offset value between the output position of the object and the output position of the field object into which the variable-length table is output; and an output step of deciding and outputting the output position of the object based upon the offset value and the output position of the field object into which the variable-length table is output. 
   Further, the form processing method includes a setting step of setting the form file, wherein the setting step includes a linkage setting step of making a setting, based upon an indication from a user, in such a manner that the output position of the object and the output position of the field object into which the variable-length table is output will be linked by way of the offset value, and a storing step of storing a set value that has been set at the linkage setting step. 
   Further, according to the present invention, the foregoing object is attained by providing a form processing program for causing a computer to implement a form processing method of generating a form by entering data into a form file, which has a field object indicating an output area of the data to be entered into a field, and an object that appears in an area other than the field object, and causing the data to be output in the output area indicated by the field object, the program including program code for causing the computer to execute the following steps: a linkage determining step of determining whether a setting has been made to link an output position of the object to an output position of the field object into which a variable-length table is output by entering the data; if has been determined at the linkage determination step that a setting has been made to link the output position of the object, an offset-value acquisition step of acquiring an offset value between the output position of the object and the output position of the field object into which the variable-length table is output; and an output step of deciding and outputting the output position of the object based upon the offset value and the output position of the field object into which the variable-length table is output. 
   Further, according to the present invention, the foregoing object is attained by providing a form processing apparatus for generating a form by entering data into a form file, which has a field object indicating an output area of the data to be entered into a field, and an object that appears in an area other than the field object, and causing the data to be output in the output area indicated by the field object, the apparatus comprising: a linkage determining unit configured to determine whether a setting has been made to link an output position of the object to an output position of the field object into which a variable-length table is output by entering the data; an offset-value acquisition unit configured to acquire an offset value between the output position of the object and the output position of the field object into which the variable-length table is output if it has been determined by the linkage determining unit that a setting has been made to link the output position of the object; and an output unit configured to decide and output the output position of the object based upon the offset value and the output position of the field object into which the variable-length table is output. 
   In accordance with the present invention, it is possible to generate a form having an attractive appearance irrespective of the amount of data in the field data when creating a tabular-format object in a form generated by entering field data into a field 
   Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof. 

   
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate an embodiment of the invention and, together with the description, serve to explain the principles of the invention. 
       FIG. 1  is a diagram illustrating the hardware implementation and external appearance of a form processing apparatus according to an embodiment of the present invention; 
       FIG. 2  is a diagram illustrating the structure of content recorded on a floppy disk; 
       FIG. 3  is a diagram illustrating a memory map in a state in which a form processing program according to this embodiment has been loaded into a RAM and is executable; 
       FIG. 4  is a diagram illustrating an example of generation of a form; 
       FIG. 5  is a diagram illustrating an example of generation of a form that includes a variable table; 
       FIG. 6  is a diagram useful in describing a case where a blank space and blank lines have been produced in a form processing apparatus according to the prior art; 
       FIG. 7  is a diagram illustrating an example of generation of a form in a case where a setting has been made to link an object to a variable table; 
       FIG. 8  is a diagram illustrating an example of generation of a form in a case where a setting has been made to link an object to the last line of the final column of a variable table; 
       FIG. 9  is a diagram illustrating an example of generation of a form in a case where a setting has been made to link an object to the last line of the first column of a variable table; 
       FIG. 10  is a flowchart illustrating the flow of form-file setting processing when a form is generated; 
       FIG. 11  is a flowchart illustrating the flow of output processing when a form is generated; 
       FIG. 12  is a diagram illustrating an example of a designating screen for validating linking of an object; and 
       FIG. 13  is a diagram illustrating an example of a designating screen for selecting an object linking method. 
   

   DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
   A preferred embodiment of the present invention will now be described in detail in accordance with the accompanying drawings. 
   [First Embodiment] 
   &lt;Structure of Form Processing Apparatus&gt; 
     FIG. 1  is a diagram illustrating a form processing apparatus according to this embodiment. The setting of a form file and the output of a form are performed using this form processing apparatus. Reference numeral  100  denotes the hardware configuration of the form processing apparatus and  101  the external appearance thereof. 
   As illustrated in  FIG. 1 , the form processing apparatus includes a central processing unit constituted by a CPU  10  or the like; a main storage device comprising a ROM/RAM  12  or the like; an external storage device constituted by a floppy-disk drive  13  or hard-disk drive  15  or the like; a designation input unit comprising a pointing device (coordinate designating means) such as a mouse  18  as well as a keyboard  16 ; a monitor comprising a CRT display  17  or the like; a printing apparatus  19  constituted by a printer or plotter; and a system bus  20  interconnecting these components. Further, the form processing apparatus  100  is capable of being connected to another computer system via a communication line such as a network. It should be noted that the form processing apparatus  100  can also be implemented by an information processing apparatus such as an ordinary workstation or personal computer. 
   The form processing apparatus  100  is operated by having the CPU execute a basic input/output program or operating system and a form processing program (a control program for implementing form processing, described later). The basic input/output program is written to the ROM  11  and the operating system is written to the hard-disk drive  15 . When the power supply of the form processing apparatus  100  is turned on, the operating system is read into the RAM  12  from the hard-disk drive  15  by IPL (Initial Program Loading) within the basic input/output program, thereby starting up operation of the operating system. 
   Further, the form processing program and related data are registered in a floppy disk  14 , the structure of the content of which is as illustrated in  FIG. 2 . Specifically, a form processing program execution file ( 33 ) and a related-data file ( 34 ) are loaded into the form processing apparatus  100  through the floppy-disk drive  13 , as illustrated in  FIG. 1 . When the floppy disk  14  is inserted into the floppy-disk drive  13 , the form processing program execution file ( 33 ) and related-data file ( 34 ) are read out of the floppy disk  14  and loaded into the RAM  12  under the control of the operating system and basic input/output program so that the operation becomes possible.  FIG. 3  illustrates a memory map in a state in which the form processing program has been loaded into the RAM  12  and is executable. 
   This embodiment illustrates an example in which processing is executed upon loading the form processing program execution file ( 33 ) and related-data file ( 34 ) directly into the RAM  12 . However, it may be so arranged that the form processing program execution file ( 33 ) and related-data file ( 34 ) are installed in the hard-disk drive  15  beforehand and files are then loaded from the hard-disk drive  15  to the RAM  12  when the form processing program execution file ( 33 ) is actuated. Further, it is possible for a medium that records the form processing program execution file to use a removable storage medium such as a CD-ROM or IC memory card besides the floppy disk  14 . Furthermore, it is possible to record the form processing program execution file in the ROM  11  and use this to form part of the memory map so that the CPU  10  can execute processing directly. Further, it is permissible to adopt an arrangement in which the form processing program execution file is read in from another apparatus via a network and then executed. 
   &lt;Flow of Form Processing in Form Processing Apparatus&gt; 
   The flow of form processing in the form processing apparatus  100  according to this embodiment will be described with reference to  FIGS. 10 and 11 . The generation of a form is divided into processing for setting a created form file (a form file that has a field object and an object that appears in an area other than that of the field object), and output processing for entering field data into the form file that has undergone setting processing and outputting a form.  FIG. 10  is a flowchart illustrating the flow of form-file setting processing executed when a form is generated, and a  FIG. 11  is a flowchart illustrating the flow of output processing when a form is generated. 
   In the setting of a form file in  FIG. 10 , it is determined whether a variable table exists in the form file created (step S 1 ). 
   If it is determined at step S 1  that a variable table exists, then it is determined at step S 2  whether a setting has been made to link an object to the variable table by an input operation performed by the user. It should be noted that the linkage setting is performed using an attribute dialog box relating to a field object (a field object into which the variable table will be output), as shown in  FIG. 12 . 
   If the fact that linkage has been set is determined at step S 2 , then a set value is written to the RAM  12  in association with the field object at step S 3 . Whether the object is linked to the table at the time of output processing can be changed over by the value that has been written in.  FIG. 7  is a diagram illustrating an example of generation of a form in a case where an object is linked to a table at the time of output processing. In a case where a field object  702  for outputting a variable table and an object  704  are set forth in a form file  700  and field data  710  has been entered, as shown in  FIG. 7 , a form  720  to be generated will be such that the number of lines in a table  721  will vary depending upon the amount of data in the field data  710 , and such that the object  704  will be output in a form linked to the table  721 . As a result, a needless blank space between the table  721  and object  704  vanishes, as indicated at  722 , and a blank line is no longer output in the table  721 . A more attractive form is thus obtained. 
   If it is determined at step S 2  that linkage has not been set, then a set value indicative of non-linkage is written in an processing is exited. 
   Next, at step S 4 , it is determined whether the variable table has two or more columns. If it is determined at step S 4  that the table has one column, then a setting is made to effect linkage to the last line of the table. 
   On the other hand, if it is determined at step S 4  that the table has two or more columns, then the user is allowed to set the object linking method. There are two types of object linking methods, as illustrated in  FIGS. 8 and 9 .  FIG. 8  is a diagram illustrating a method in which linkage is made to the last line of the final column of a variable table. This method is such that if a form file  800  describes a field object  802 , which is for outputting a two-column variable table, as well as an object  804 , then, when the amount of data in the field data is small and a table  821  of an output form  820  becomes a single-column table as a result, the object  804  is shifted horizontally and is linked to the last line of the final column of the table  821 . 
   On the other hand,  FIG. 9  is a diagram illustrating a method in which linkage is made to the last line of the first column of a variable table. This is method is such that if a form file  900  describes a field object  902 , which is for outputting a two-column variable table, as well as an object  904 , then, when the amount of data in the field data is small and a table  921  of an output form  920  becomes a single-column table as a result, and also when the amount of data in the field data is large and an output table  921 ′ of an output form  920 ′ becomes a table having two or more columns as a result, the object is linked to the last line of the first column of the table  921  (or  921 ′). In the case of this method, the object  904  is shifted vertically only in a case where the table ends in the middle of the first column. If the first column is filled, the object  904  will not be shifted regardless of the position in columns from the second column onward. 
   It should be noted that whether use is made of the method that links an object to the last line of the final column of a table or the method that links an object to the last line of the first column of a table is set via an attribute dialog box of the kind shown in  FIG. 13  by way of example. 
   When the linking method has been set at step S 5 , the value that has been set is written to the RAM  12  in association with the field object at step S 6 . When the object is linked to the table, it is possible, based upon the value written, to switch between linking to the last line of the final column and linking to the last line of the first column. 
   The offset value [distance (offset X, offset Y) between a field object and an object] in a case where an object is linked to a table is set at step S 7 . Form-file setting processing for generating a form is completed by the processing set forth above. 
   The flow of output processing at the time of form generation will now be described with reference to the flowchart of  FIG. 11 . 
   In the generation of a form by entering field data into a form file, first it is determined at step S 21  whether a table will fit onto the same page as the form. 
   If it is determined at step S 21  that the table will not fit onto the page, then, at step S 29 , the object is not linked and is output to a default position of the object, which prevails at the time of form-file generation, on a page other than the final page. 
   On the other hand, if it is determined at step S 21  that the table will fit onto the page, then it is determined at step S 22  whether linking has been set to be valid or not. 
   If it is determined at step S 22  that linking is invalid, then the object is not linked and is output to the default position of the object prevailing at the time of form-file creation. 
   On the other hand, if it is determined at step S 22  that linking is valid, then offset values (offset X, offset Y) of the object, which values were set at the time of form-file setting processing, are acquired at step S 23 . 
   Next, the object linking method is determined at step S 24 . 
   If it is determined at step S 24  that the method of linking the object to the last line of the final column has been set, then the position (X coordinate) of the final column and the position (Y coordinate) of the last line of the table that has been output are acquired at step S 25 . 
   On the other hand, if it is determined at step S 24  that the method of linking the object to the last line of the first column has been set, then it is determined at step S 27  whether the table that has been output has reached the last line of the first column. 
   If it is determined at step S 27  that the table has reached the last line of the first column, then the position (X coordinate) of the first column and the position (Y coordinate) of the last line of the table that has been output are acquired at step S 28 . 
   At step S 26 , the offset values (offset X, offset Y) of the object relative to the field object set at the time of form-file setting processing are added to the X and Y coordinates, respectively, acquired at steps S 25  and S 28 , the position at which the object is to be output is calculated and the object is output to this position. 
   Thus, in accordance with the form processing apparatus of this embodiment, as should be obvious from the described rendered above, a setting can be made that will not produce a needless blank space or blank line when a form is generated, thereby making it possible to generate a more attractive form. 
   Furthermore, in a form that includes a table having a plurality of columns, a setting can be made to link an object to the last time of the first column or to the last line of the final column of the table. Thus a form having a style desired by the user can be generated in a flexible manner. 
   [Second Embodiment] 
   In the first embodiment described above, whether or not linking is performed and the linking method are set using a field-object attribute dialog box. However, the present invention is not limited to this embodiment and the setting can be made by another method. 
   [Third Embodiment] 
   According to the first and second embodiments, a set value representing whether or not linking is performed or the linking method is set in association with a field object for every field object for which a variable table is output. However, the present invention is not limited to this embodiment and it may be so arranged that set values representing whether or not linking is performed and the linking method are set in association with individual objects to be linked. 
   Further, in order to so arrange it that a form-file setting operation can be performed while the user checks whether or not linking is to be performed as well as the linking method, it may be so arranged that symbols expressing whether or not linking is to be performed and the linking method are appended to a table and displayed when the form file is set. 
   The present invention is not limited to the above embodiments and various changes and modifications can be made within the spirit and scope of the present invention. Therefore, to apprise the public of the scope of the present invention, the following claims are made.