CN102201009B - Form generating method and device - Google Patents

Form generating method and device Download PDF

Info

Publication number
CN102201009B
CN102201009B CN 201110167154 CN201110167154A CN102201009B CN 102201009 B CN102201009 B CN 102201009B CN 201110167154 CN201110167154 CN 201110167154 CN 201110167154 A CN201110167154 A CN 201110167154A CN 102201009 B CN102201009 B CN 102201009B
Authority
CN
Grant status
Grant
Patent type
Prior art keywords
form
generating
method
device
form generating
Prior art date
Application number
CN 201110167154
Other languages
Chinese (zh)
Other versions
CN102201009A (en )
Inventor
张文星
Original Assignee
深圳市凯立德科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Grant date

Links

Abstract

本发明公开了一种表单生成方法和装置,其中表单生成方法包括:S1、将表单配置文件读取为独立数据集合,并将表单模板读取为字符串;S2、一一根据所述表单配置文件中的表单元素地址在表单模板字符串中查找对应的表单元素,并在查找到对应的表单元素后,将所述表单配置文件中该表单元素对应的配置信息赋予所述表单模板中的该表单元素;S3、将得到的表单模板输出为网页表单。 The present invention discloses a method and apparatus for generating the form, the form in which generation method comprising: S1, the profile forms independent data set to read, the read form template to a string; S2, eleven arranged according to the form form element address lookup file corresponding form elements in the form template string, and after finding the corresponding form elements, form the configuration file in the configuration information of the form given to the corresponding elements in the form of the template form elements; S3, the resulting form template output web form. 本发明生成的网页表单与纸质表格的样式完全一致,且提升了适用性,增强了灵活性,提高了效率,降低了难度,增强了移植性,简化了多任务办理工序。 The present invention generated web form entirely consistent with the style of paper forms, and to enhance the applicability and enhance flexibility, improve efficiency and reduce the difficulty, enhances portability and simplify the process of handling multiple tasks.

Description

一种表单生成方法和装置 Namely Forms generating method and apparatus

技术领域 FIELD

[0001] 本发明涉及计算机应用技术领域,尤其涉及一种表单生成方法和装置。 [0001] The present invention relates to a computer application technology, and in particular, to a method and apparatus for generating form.

背景技术 Background technique

[0002]目前,网页表单通常利用.net中已封装好的控件或者自定义控件,在一个页面上进行固定的布局,并对某些控件做相应的验证设置,然后循环当前页面上所有的控件并获取控件的值,最后将获取的控件值通过POST方式提交到后台并保存到数据库中。 [0002] Currently, .net web forms typically utilize controls that have been encapsulated or custom, fixed layout on a page, and accordingly some controls authentication settings, and then loop through all the controls on the current page and get the value of the control, and finally get control value submit to background and saved to the database via the POST method.

[0003] 传统的网页表单无法或者很难将纸质的表格的样式完整地表现出来,因而当业务需要套打证件或者需要直接打印时,会产生诸多不便。 [0003] The traditional web form or not is difficult to form a complete style paper demonstrated, so when business needs require or direct printing Printing documents, will produce a lot of inconvenience. 其次,传统的网页表单缺乏灵活性与通用性,加大了业务系统的开发难度,降低了开发效率。 Secondly, the traditional web forms lack of flexibility and versatility, increased the difficulty of developing business systems, reducing development efficiency. 再次,传统网页表单在业务需求发生变化时,一定要重新对页面或者自定义控件进行修改,无法最大化实现代码的重用性。 Again, the traditional web form when business needs change, be sure to re-edit the page or custom control, you can not maximize code reuse. 最后,传统网页表单在操作多任务时不能同时处理多张表单,加大了业务办理的难度。 Finally, the traditional web form at the time of operating a multi-task can not handle more than one form, increased the difficulty of handling business.

发明内容 SUMMARY

[0004] 本发明要解决的技术问题在于,针对现有技术中网页表单难以完整表现纸质表格、缺乏灵活通用性、缺乏代码重用性以及多任务时造成业务办理难度大等缺陷,提供一种能够完整表现纸质表格、灵活通用、代码重用性高以及易于处理多任务的表单生成方法和 [0004] The present invention to solve the technical problem is that the prior art is difficult to complete web forms in paper form performance, the lack of flexible and versatile, lack of code reuse and multi-tasking business caused when handling difficult defects, provided a be able to complete paper forms performance, flexible and versatile, high code reuse and easy to handle multiple tasks and form generation method

>JU ρςα装直。 > JU ρςα loaded straight.

[0005] 本发明解决其技术问题所采用的技术方案是: [0005] aspect of the present invention to solve the technical problem are:

[0006] 提供一种表单生成方法,包括: [0006] there is provided a method for generating a form, comprising:

[0007] SI、将表单配置文件读取为独立数据集合,并将表单模板读取为字符串; [0007] SI, the profile forms independent data set to read, the read form template as a string;

[0008] S2、--根据所述表单配置文件中的表单元素地址在表单模板字符串中查找对应 [0008] S2, - in the form to find the corresponding template string form elements according to the address of the configuration file form

的表单元素,并在查找到对应的表单元素后,将所述表单配置文件中该表单元素对应的配置信息赋予所述表单模板中的该表单元素; Form elements, and after finding the corresponding form elements, form the configuration file in the configuration information of the form given to the corresponding elements in the form of the form template element;

[0009] S3、将得到的表单模板输出为网页表单。 [0009] S3, the obtained output form template web form.

[0010] 本发明表单生成方法中,步骤SI中,使用类库读取所述表单配置文件和所述表单模板。 [0010] Form generating process of the invention, step SI, a form library to read the configuration file and the form template.

[0011] 本发明表单生成方法中,步骤SI中,使用ADO. NET读取所述表单配置文件,并使用.NET类库通过流的方式读取所述表单模板。 [0011] Form generation method of the present invention, the step SI using ADO. NET form reading the configuration file and read the .NET class library template form through the flow way.

[0012] 本发明表单生成方法中,步骤S3还包括接收用户输入的数据,并保存或更新到数据库中。 [0012] Form generation method of the present invention, the step S3 further comprising receiving user input data, and stores or updates to the database.

[0013] 本发明表单生成方法中,再次生成所述表单时,判断是否存在包含数据的表单模板,若是则在所述步骤Si中直接读取所述包含数据的表单模板。 [0013] The present invention form generation method, when generating the form again, determines whether there is a form template contains data, if the step is read directly on the Si contained in the form template data.

[0014] 本发明还提供一种表单生成装置,包括: [0014] The present invention also provides a form generation apparatus, comprising:

[0015] 数据库,用于存储表单配置文件和表单模板; [0015] database to store form templates and form profile;

[0016] 读取模块,用于将表单配置文件读取为独立数据集合,并将表单模板读取为字符串; [0016] The reading module configured to read the profile forms independent data set, the read form template as a string;

[0017] 匹对模块,用于一一根据所述表单配置文件中的表单元素地址在表单模板字符串中查找对应的表单元素,并在查找到对应的表单元素后,将所述表单配置文件中该表单元素对应的配置信息赋予所述表单模板中的该表单元素; After [0017] matching module configured to find the eleven form element in the form corresponding to the form template string element according to the address of the profile form, and find the corresponding form elements, form the configuration file configuration information element corresponding to the form element is given the form of the form template;

[0018] 输出模块,用于将所述匹对模块处理后的所述表单模板字符串输出为网页表单。 [0018] Output module, configured to match the character string of the form template module outputs the processed into web form.

[0019] 本发明表单生成装置中,所述读取模块使用类库读取所述表单配置文件和所述表单模板。 [0019] Form generating apparatus of the present invention, the read module reads the library configuration file forms and the form template.

[0020] 本发明表单生成装置中,所述读取模块使用ADO. NET读取所述表单配置文件,并使用.NET类库通过流的方式读取所述表单模板。 [0020] Form generating apparatus of the present invention, the reading module ADO. NET form reading the configuration file and read the .NET class library template form through the flow way.

[0021] 本发明表单生成装置中,所述表单生成装置还包括输入模块,所述输入模块用于接收用户输入的数据,并将所述数据保存或更新到所述数据库中。 [0021] generating apparatus of the present invention in form, said form generating means further comprises an input module, the input module configured to receive user input data, and the data is stored or updated to the database.

[0022] 本发明表单生成装置中,所述读取模块还用于在再次生成所述表单时,判断是否存在所述包含数据的表单模板,若是则直接读取所述包含数据的表单模板。 [0022] Form generating apparatus of the present invention, the reading module is further used in generating the form again, it determines whether there is a form containing data of the template, if the template contains a form directly read the data.

[0023] 本发明一种表单生成方法和装置的有益效果为:通过自定义表单,使用户可以根据具体的业务需求制定出相应的表单,不仅提升了效率,而且业务内容一目了然;自定义网页表单提高了业务适用性,增强了灵活性;另外,通过表单配置文件和表单模版结合生成自定义网页表单,降低了业务系统开发的难度,并且提供了众多实现接口,实现了与业务系统完全分离的效果,此二者是完全独立的,所以在业务系统开发过程中可以重复利用表单,不需要为具体的业务编写具体的表单页面,提高效率,降低难度;而且,自定义表单与数据库的交互也是由配置实现,有很强的移植性,在不同的业务系统之间,只要表单配置文件中配置的数据库表名与字段完全符合,表单就能够将客户录入的数据写入或更新到相应的数据库表中;最后,自定义表单简化了多任 [0023] Advantageous effects of the present invention, one kind of a form of generating method and apparatus: By custom form, so that the user can work out the appropriate forms depending on the particular business requirements, not only to enhance efficiency and service content at a glance; custom web form improved business applicability, enhanced flexibility; in addition, the form templates and form in conjunction with the configuration file to generate a custom web form, reducing the difficulty of the development of the service system, and provides a number of interfaces implemented to achieve a completely separate system and business effect, both of which are completely independent, so the business system development process can be repeated using the form, do not need to write specific business specific form page, improve efficiency, reduce the difficulty; moreover, custom forms from the interaction with the database is the configurations, has a strong portability between different business systems, as long as the form configuration file is a database table names and field full compliance, the form will be able to enter the customer's data is written or updated to the appropriate database table; Finally, custom form simplifies multitasking 务同时办理的工序,当某一任务需处理多个表单时,自定义表单可以提供分页进行一次性处理,这样不仅简化了工序,同时也提高了工作效率。 While for the service step, when a plurality of tasks to be processed forms, custom form tabs may be provided a one-time process, so that not only simplifies the process, but also improve the work efficiency.

附图说明 BRIEF DESCRIPTION

[0024] 下面将结合附图及实施例对本发明作进一步说明,附图中: [0024] The accompanying drawings and the following embodiments of the present invention is further illustrated drawings in which:

[0025] 图I是根据本发明一个实施例的表单生成装置的结构示意图; [0025] FIG. I is a schematic diagram of the apparatus is generated according to a form of embodiment of the present invention;

[0026] 图2是根据本发明另一个实施例的表单生成装置的结构示意图; [0026] FIG. 2 is a schematic structural diagram of a form of embodiment of the generating apparatus according to another embodiment of the present invention;

[0027] 图3是根据本发明一个实施例的WORD生成的表单模板的示意图; [0027] FIG. 3 is a schematic diagram WORD form template generated according to one embodiment of the present invention;

[0028] 图4是根据本发明一个实施例的EXCEL生成的表单配置文件的示意图; [0028] FIG. 4 is a schematic view of the configuration file according to an embodiment of the EXCEL form of the present invention is generated;

[0029] 图5是根据本发明一个实施例的操作前的表单模板的示意图; [0029] FIG. 5 is a schematic view of the present invention, a form template before the operation of the embodiment;

[0030] 图6是根据本发明一个实施例的操作后的表单模板的示意图; [0030] FIG. 6 is a schematic view of a template according to a form the operation of one embodiment of the present invention;

[0031] 图7是根据本发明一个实施例的包含数据的表单的示意图; [0031] FIG. 7 is a schematic view of a form containing the data to one embodiment of the present invention;

[0032] 图8是根据本发明一个实施例的表单生成方法的流程图。 [0032] FIG 8 is a flowchart of a method for generating a form of embodiment of the present invention.

具体实施方式 detailed description

[0033] 为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。 [0033] To make the objectives, technical solutions and advantages of the present invention will become more apparent hereinafter in conjunction with the accompanying drawings and embodiments of the present invention will be further described in detail. 应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。 It should be understood that the specific embodiments described herein are only intended to illustrate the present invention and are not intended to limit the present invention. [0034] 图I是根据本发明一个实施例的表单生成装置的结构示意图。 [0034] FIG. I is a schematic diagram of the apparatus is generated according to a form of embodiment of the present invention. 在本实施例中,表单生成装置包括数据库100、读取模块200、匹对模块300和输出模块400。 In the present embodiment, the generating means includes a form database 100, the read module 200, a matching module 300 and output module 400.

[0035] 数据库100可以用于存储表单配置文件和表单模板。 [0035] Database 100 can be used to store the configuration file forms and form templates. 表单配置文件可以通过EXCEL生成,如图4所示。 EXCEL profile forms can be generated, as shown in FIG. 在表单配置文件中,可以包含各种配置信息,例如表单元素的布局、数据的验证、数据的来源和数据的入库配置信息等。 The profile form, may contain various configuration information, such as form elements of the layout, validation data, profile data storage and data sources and the like. 表单模板可以通过WORD或dreamweaver生成,利用WORD生成的表单模板如图3所示。 WORD form template can be generated or dreamweaver, WORD generated using the template form as shown in FIG. 表单配置文件和表单模板都可以由用户预先写入数据库100中,或在需要时在数据库100中进行更新。 Forms and form templates configuration file can be written in advance by the user database 100, 100 or updated in the database when needed. 表单配置文件中的控件ID与表单模板中的控件ID对应。 Form configuration control ID corresponding to the file control ID with the form template.

[0036] 读取模块200可以用于将表单配置文件读取为独立数据集合,并将表单模板读取为字符串。 [0036] The reading module 200 may be used to read the configuration file form independent data set, the read character string of the form template. 例如,读取模块200可以利用各种类库来读取表单配置文件和表单模板,类库(class library)是实现各种功能的类的集合,其中类是用来描述一组具有共同属性和功能的对象的一些语句的集合。 For example, the read module 200 may utilize various forms library to read the configuration file and the form template library (class library) is a collection class that implements various functions, wherein the class is used to describe a group having common attributes and a collection of statements of object function. 这些类库可以是面向对象类库,其中面向对象(Object Oriented)是指在编程过程中采用封装、继承、多态等设计方法。 These libraries can be object-oriented class library, wherein the object-oriented (Object Oriented) refers to the use package during programming, inheritance, and polymorphism design methods. 具体地,读取模块200可以利用ADO. NET来将EXCEL表单配置文件的内容读取为一个DataSet。 Specifically, the read module 200 may utilize ADO. NET EXCEL to form the configuration file to read the contents of a DataSet. 其中ADO. NET是一组用于和数据源进行交互的面向对象类库,该数据源可以是数据库(例如数据库100),也可以是文本文件、Excel表格或者XML文件。 Wherein ADO. NET is a set of object-oriented data source and the interaction library, the data source may be a database (e.g., database 100), or may be a text file, Excel spreadsheet or an XML file. DataSet相当于内存中的数据库,但是它是不依赖于数据库的独立数据集合。 DataSet equivalent in-memory database, but it is not dependent on a set of independent data in the database. 读取模块200还可以利用.NET提供的类库通过流的方式读取表单模板,通过读取文件的方式将表单模板直接读取为一个长字符串,该字符串为表单模板文件的内容。 Read module 200 may also use the .NET class library form template provided by the flow reading mode, to read the file by way of the form template to directly read a long string, the string is the content of the form template file. 但是,以上示例仅仅用于解释本发明,而不用于限制本发明,本领域技术人员所熟知其它常用于读取文本、ECXEL, WORD、XML、dreamweaver等文件的方法,都包含在本发明中。 However, the above examples are merely to illustrate the invention, but not to limit the present invention, those skilled in the art other often used to read text, ECXEL, WORD, XML, dreamweaver method other documents, are included in the present invention.

[0037] 匹对模块300可以用于一一根据表单配置文件中的表单元素地址(或控件ID)在表单模板字符串中查找对应的表单元素(或控件),并在查找到对应的表单元素后,将表单配置文件中该表单元素对应的配置信息赋予表单模板中的该表单元素。 [0037] The matching module 300 may be used to form elements according to the eleven address (or control ID) in the configuration file to find a form corresponding to the form template string form elements (or control), and find the corresponding form element after the configuration information in the configuration file forms corresponding to the form elements assigned to the form elements in the form template. 例如,匹对模块300可以将表单配置文件中的配置信息赋值到对应类型的表单元素实体类中的属性节点,利用正则表达式匹对已填充属性的表单元素实体并替换或者赋值表单模板中对应控件的属性。 For example, matching module 300 may be configured to form information configuration file assigned to the attribute corresponding to the node type of form elements of the attribute classes, regular expressions matching form elements entities fill properties and replace or assignment form template corresponding to property control.

[0038] 图5和图6分别是根据本发明一个实施例的匹对操作前和匹对操作后的表单模板的示意图。 [0038] Figures 5 and 6 are a front schematic view of the operation and the form template matching operation for matching according to one embodiment of the present invention. 以下是匹对操作前读取模块200对表单模板进行读取得到的表单模板字符串中关于表单头部和控件“登记类型”的一部分: The following is a matching operation before the read module 200 to form part of the template to form a template character string reading obtained for 'Registration type "form of the head and controls were:

[0039] [0039]

Figure CN102201009BD00061
Figure CN102201009BD00071

[0041 ] 匹对模块300在DataSet循环用正则表达式将表单配置文件中的内容压入上述表单模板里对应的控件(或表单元素)后,表单模板字符串中关于表单头部和控件“登记类型”的一部分如下: [0041] The matching module 300 after circulating in the DataSet contents of form regular expression profile is pressed into the control (or form elements) corresponding to the above-described form templates, form template string head and controls on the form "Registration part of the type "is as follows:

[0042] [0042]

Figure CN102201009BD00072
Figure CN102201009BD00081

[0045] 对比以上字符串可知,在赋值后的表单元素中,对输入框的输入宽度、输入字体、字符位置以及与数据库的同步(入库配置信息)等都做了具体限定。 [0045] The above comparison string found in the form elements after the assignment, the width of the input of the input frame synchronization (storage configuration information) input font, character position, and so do the database particularly limited.

[0046] 输出模块400可以用于将匹对模块300处理后的表单模板字符串输出为html格式的网页表单。 [0046] The output module 400 may be used to form template matching string 300 outputs the processing module web form html format. 例如,上述字符串就是HTML表单文件的一部分内容。 For example, the character string is part of an HTML form file.

[0047] 在工作过程中,读取模块200可以从数据库100中将表单配置文件读取为独立数据集合,并将表单模板读取为字符串。 [0047] In operation, the read module 200 may read the configuration file in the form of an independent set of data from the database 100, the read form template string. 其中数据库100用于存储表单配置文件和表单模板。 Form 100 is used to store database which profiles and form templates. 表单配置文件可以通过EXCEL生成,表单模板可以通过WORD或dreamweaver生成。 Form configuration files can be generated by EXCEL, WORD form template can be generated by or dreamweaver. 读取模块200可以利用各种面向对象类库来读取表单配置文件和表单模板。 Read module 200 may read the object-oriented class library to form templates and form configuration files using various. 例如,读取模块200可以利用ADO. NET来将EXCEL表单配置文件的内容读取为一个DataSet。 For example, the read module 200 may utilize ADO. NET to read the contents of a DataSet EXCEL form profile. 又例如,读取模块200还可以利用.NET提供的类库通过流的方式读取表单模板,通过读取文件的方式将表单模板直接读取为一个长字符串,该字符串为表单模板文件的内容。 As another example, the read module 200 may also use the .NET class library form template provided by the flow reading mode, to read the file by way of the form template to a direct read long string form template file Content. 然后,匹对模块300可以 Then, match module 300 may

--根据表单配置文件中的表单元素地址(或控件ID)在表单模板字符串中查找对应的表 - in the lookup table corresponding to the form template string form elements according to the addresses (or control ID) of the profile form

单元素(或控件),并在查找到对应的表单元素后,将表单配置文件中该表单元素对应的配置信息赋予表单模板中的该表单元素。 Single-element (or control), and after finding form elements corresponding to the configuration file form configuration information corresponding to the elements in the form given to the form elements in the form template. 最后,输出模块400可以将匹对模块300处理后的表单模板字符串输出为网页表单。 Finally, the output module 400 may form template matching module 300 outputs the character string is processed web form.

[0048] 本发明提供的表单生成装置通过自定义表单,使用户可以根据具体的业务需求制定出相应的表单,不仅提升了效率,而且业务内容一目了然;自定义网页表单提高了业务适用性,增强了灵活性;另外,通过表单配置文件和表单模版结合生成自定义网页表单,降低了业务系统开发的难度,并且提供了众多实现接口,实现了与业务系统完全分离的效果,此二者是完全独立的,所以在业务系统开发过程中可以重复利用表单,不需要为具体的业务编写具体的表单页面,提高效率,降低难度;而且,自定义表单与数据库的交互也是由配置实现,有很强的移植性,在不同的业务系统之间,只要表单配置文件中配置的数据库表名与字段完全符合,表单就能够将客户录入的数据写入或更新到相应的数据库表中;最后,自定义表单简化了多任务同时办理的工序, [0048] Forms of the present invention provides means by generating a custom form, so that the user can work out the appropriate forms depending on the particular business requirements, not only to enhance efficiency and service content at a glance; custom business web form improved applicability, enhanced flexibility; in addition, the form templates and form in conjunction with the configuration file to generate a custom web form, reducing the difficulty of the development of the service system, and provides a number of interfaces implemented to achieve a complete separation of the business system effects, both of which are completely independent, business systems development process can be repeated using the form, do not need to write specific business specific form page, improve efficiency, reduce the difficulty; moreover, custom forms from the interaction with the database is realized by the configuration, there is a strong portability between different business systems, as long as the configuration of the configuration file form database table names in full compliance with the field, it is possible to form the customer entered or updated data is written into the corresponding database table; Finally, custom forms can simplify the process of handling multiple tasks at the same time, 当某一任务需处理多个表单时,自定义表单可以提供分页进行一次性处理,这样不仅简化了工序,同时也提高了工作效率。 When a plurality of tasks to be processed forms, custom form tabs may be provided a one-time process, so that not only simplifies the process, but also improve the work efficiency.

[0049]图2是根据本发明另一个实施例的表单生成装置的结构示意图。 [0049] FIG. 2 is a schematic structural diagram of a form of embodiment of the generating apparatus according to another embodiment of the present invention. 在本实施例中,表单生成装置包括数据库100、读取模块200、匹对模块300、输出模块400、输入模块500、错误提不模块600和模板生成模块700。 In the present embodiment, the generating means includes a form database 100, the read module 200, a matching module 300, output module 400, an input module 500, error module 600, and not to mention the template generation module 700. 其中输入模块500、错误提不模块600和模板生成模块700都是可选模块,即本发明的各种实施例可以包括这些模块中的任意一个和/或其任意组合。 Wherein the input module 500, error module 600, and not to mention the template generation module 700 is an optional module, i.e., the various embodiments of the present invention may include any / or any combination of these modules and.

[0050] 输入模块500可以用于接收用户输入的数据,并将这些数据保存或更新到数据库100中。 [0050] The input module 500 may receive data input by a user, and stores or updates the database 100 to the data. 在生成表单之后,还要将表单与相关的业务流程挂钩,输入模块500就用于接收用户录入的数据,这些数据分别对应于各自的表单元素(或控件),例如,数据“ 100平方米”对应于控件“面积”。 After generating the form, the form also related business processes linked to the input module 500 for receiving data entered by the user, the data corresponding to a respective form element (or control), for example, data "100 m2" It corresponds to control "area." 显示网页表单时,同时在对应位置显示这些数据。 Web form is displayed, displaying the data in the corresponding position.

[0051] 错误提示模块600可以用于在输入模块500接收的用户输入数据存在异常或不符合规则时,对用户进行提示。 When the [0051] error module 600 may be used to input data there is an abnormality in the user input module 500 receives or does not comply with the rules, the user is prompted. 例如错误提示模块600可以通过发出语音报警提示用户重新输入。 E.g. error alarm module 600 may re-enter a user by a voice. 又例如,错误提示模块600还可以通过定位到对应的表单元素来提示用户并指示用户重新输入。 As another example, error module 600 may also be positioned by the user and prompt the user to re-input an indication corresponding to the form elements. 利用错误提示模块600,可以保证正确输入数据,增加自定义表单的精确度,且便于用户更改错误。 Using the error module 600, can ensure the correct input data, increase the accuracy of the custom form, and facilitates the user to change the error. [0052] 模板生成模块700可以用于在输入模块500接收的用户输入数据全部正确时,将全部数据保存或更新到数据库100中,并重新生成包含数据的表单模板保存在数据库100中。 [0052] The template generation module 700 may be used when the user inputs data input module 500 receives all correct, update or save all the data in the database 100, and regenerates the form template data stored in the database contains 100. 图7就是根据本发明一个实施例的包含数据的表单的示意图。 FIG 7 is a schematic view of a form containing the data to an embodiment of the present invention. 再次生成该表单时,读取模块200可以用于判断数据库100中是否存在包含数据的表单模板,若是则直接读取或加载上述包含数据的表单模板,若否则读取或加载空的表单模板。 The form is generated again, the reading module 200 may be configured to determine whether there is a database 100 containing data form template, or if the load is directly read the above form templates with data, reading or otherwise form template when loading empty. 这样,可以减少与数据库100交互的次数,从而提高工作效率。 In this way, the number of 100 to interact with the database can be reduced, thereby improving efficiency.

[0053] 另外,在本发明的一个优选实施例中,表单配置文件中的控件ID虽然与表单模板中的控件ID对应,但不是一一对应。 [0053] Further, in a preferred embodiment of the present invention, forms a control profile ID corresponding to the ID control although the form template, but not one to one. 即表单模板中的每个控件(或表单元素)不一定都能在表单配置文件中找到对应的控件配置,表单配置文件中的每个控件配置也不一定在表单模板中都有对应的控件。 That is, each control (or form elements) are not necessarily in the form template can be found in the corresponding configuration control form configuration file, the form configuration file for each control configuration is not necessarily in a form template has a corresponding controls. 例如,同一表单配置文件可以对应多个表单模板,表单生成装置可以一次根据多个表单模板以及多个表单配置文件生成多页的表单文件。 For example, the same configuration file may correspond to a plurality of sheet form templates, form a profile generating means may generate a plurality of pages form a plurality of document templates and form a plurality of forms. 又例如,表单模板中可能会有扩展预留项,这些扩展预留项在表单配置文件中没有对应的配置信息。 As another example, the form template might be extended to reserve items, these items do not extend to reserve corresponding configuration information in the form configuration file. 这种非一一对应的关系,可以简化多任务办理工序、提高灵活性以及增强可扩展性。 This non one to one relationship, you can simplify the process of handling multiple tasks, increase flexibility and enhanced scalability.

[0054] 图8是根据本发明一个实施例的表单生成方法的流程图。 [0054] FIG 8 is a flowchart of a method for generating a form of embodiment of the present invention. 在本实施例中,表单生成方法从步骤SI开始。 In the present embodiment, a form generating method starts from step SI.

[0055] 在步骤SI中,将表单配置文件读取为独立数据集合,并将表单模板读取为字符串。 [0055] In step SI, the profile forms independent data set to read, the read form template string. 表单配置文件可以通过EXCEL生成,如图4所示。 EXCEL profile forms can be generated, as shown in FIG. 在表单配置文件中,可以包含各种配置信息,例如表单元素的布局、数据的验证、数据的来源和数据的入库配置信息等。 The profile form, may contain various configuration information, such as form elements of the layout, validation data, profile data storage and data sources and the like. 表单模板可以通过WORD或dreamweaver生成,利用WORD生成的表单模板如图3所示。 WORD form template can be generated or dreamweaver, WORD generated using the template form as shown in FIG. 表单配置文件和表单模板都可以由用户预先写入数据库中,或在需要时在数据库中进行更新。 Forms and form templates configuration file can be written in advance by the user in the database, or updated in the database when needed. 表单配置文件中的控件ID与表单模板中的控件ID对应。 Form configuration control ID corresponding to the file control ID with the form template. 可以利用各种类库来读取表单配置文件和表单模板,类库(class library)是实现各种功能的类的集合,其中类是用来描述一组具有共同属性和功能的对象的一些语句的集合。 Library may be utilized to read a variety of forms and form templates configuration file, library (class library) is a collection class that implements various functions, wherein the class is used to describe a set of statements of some objects having common properties and functions collection. 这些类库可以是面向对象类库,其中面向对象(Object Oriented)是指在编程过程中采用封装、继承、多态等设计方法。 These libraries can be object-oriented class library, wherein the object-oriented (Object Oriented) refers to the use package during programming, inheritance, and polymorphism design methods. 例如,可以利用ADO. NET来将EXCEL表单配置文件的内容读取为一个DataSet。 For example, using ADO. NET to read the contents of a DataSet EXCEL form profile. 其中ADO. NET是一组用于和数据源进行交互的面向对象类库,该数据源可以是数据库,也可以是文本文件、Excel表格或者XML文件。 Wherein ADO. NET is a set of object-oriented data source and the interaction library, the data source may be a database, a text file may be, Excel spreadsheet or an XML file. DataSet相当于内存中的数据库,但是它是不依赖于数据库的独立数据集合。 DataSet equivalent in-memory database, but it is not dependent on a set of independent data in the database. 又例如,可以利用.NET提供的类库通过流的方式读取表单模板,通过读取文件的方式将表单模板直接读取为一个长字符串,该字符串为表单模板文件的内容。 As another example, .NET class library may be utilized to provide a form template read by way of the flow, by means of reading the file will be read directly into a form template long string form template file content. 但是,以上示例仅仅用于解释本发明,而不用于限制本发明,本领域技术人员所熟知其它常用于读取文本、ECXEL> WORD、XML、dreamweaver等文件的方法,都包含在本发明中。 However, the above examples are merely to illustrate the invention, but not to limit the present invention, those skilled in the art other often used to read text, ECXEL> WORD, XML, dreamweaver method other documents, are included in the present invention.

[0056] 在步骤S2中,--根据表单配置文件中的表单元素地址(或控件ID)在表单模板 [0056] In step S2, - in accordance with the address form elements form configuration file (or control ID) form template

字符串中查找对应的表单元素(或控件),并在查找到对应的表单元素后,将表单配置文件中该表单元素对应的配置信息赋予表单模板中的该表单元素。 After the string to find the corresponding form elements (or control), and find the corresponding form element, configuration information corresponding form in the configuration file form elements assigned to the form elements in the form template. 例如,可以将表单配置文件中的配置信息赋值到对应类型的表单元素实体类中的属性节点,利用正则表达式匹对已填充属性的表单元素实体并替换或者赋值表单模板中对应控件的属性。 For example, the configuration information form the configuration file may be assigned to the attribute corresponding to the node type of form elements of the attribute classes, regular expressions matching have been filled attribute form elements entity and replaced or assignment form template corresponding to the control attribute.

[0057] 在步骤S3中,将步骤S2中处理后得到的表单模板输出为html格式的网页表单。 [0057] In step S3, after the processing in step S2 is output form template obtained web form html format.

[0058] 本发明提供的表单生成方法通过自定义表单,使用户可以根据具体的业务需求制定出相应的表单,不仅提升了效率,而且业务内容一目了然;自定义网页表单提高了业务适用性,增强了灵活性;另外,通过表单配置文件和表单模版结合生成自定义网页表单,降低了业务系统开发的难度,并且提供了众多实现接口,实现了与业务系统完全分离的效果,此二者是完全独立的,所以在业务系统开发过程中可以重复利用表单,不需要为具体的业务编写具体的表单页面,提高效率,降低难度;而且,自定义表单与数据库的交互也是由配置实现,有很强的移植性,在不同的业务系统之间,只要表单配置文件中配置的数据库表名与字段完全符合,表单就能够将客户录入的数据写入或更新到相应的数据库表中;最后,自定义表单简化了多任务同时办理的工序, [0058] The present invention provides a method for generating a form by custom form, so that the user can work out the appropriate forms depending on the particular business requirements, not only to enhance efficiency and service content at a glance; custom business web form improved applicability, enhanced flexibility; in addition, the form templates and form in conjunction with the configuration file to generate a custom web form, reducing the difficulty of the development of the service system, and provides a number of interfaces implemented to achieve a complete separation of the business system effects, both of which are completely independent, business systems development process can be repeated using the form, do not need to write specific business specific form page, improve efficiency, reduce the difficulty; moreover, custom forms from the interaction with the database is realized by the configuration, there is a strong portability between different business systems, as long as the configuration of the configuration file form database table names in full compliance with the field, it is possible to form the customer entered or updated data is written into the corresponding database table; Finally, custom forms can simplify the process of handling multiple tasks at the same time, 当某一任务需处理多个表单时,自定义表单可以提供分页进行一次性处理,这样不仅简化了工序,同时也提高了工作效率。 When a plurality of tasks to be processed forms, custom form tabs may be provided a one-time process, so that not only simplifies the process, but also improve the work efficiency.

[0059] 在生成表单之后,还要将表单与相关的业务流程挂钩。 [0059] After generating the form, the form will also be linked to related business processes. 这时,可以接收用户输入的数据,并将这些数据保存或更新到数据库中。 In this case, a user may receive data input, and stores or updates the database data. 这些数据分别对应于各自的表单元素(或控件),例如,数据“100平方米”对应于控件“面积”。 These data correspond to a respective form element (or control), for example, data "100 square meters" corresponds to the control "area." 显示网页表单时,同时在对应位置显示这些数据。 Web form is displayed, displaying the data in the corresponding position.

[0060] 在本发明的一个优选实施例中,当接收用户输入数据后,还可以判断输入的这些数据是否正确。 [0060] embodiment, after receiving the user input data may also be determined whether the data entered is correct in a preferred embodiment of the present invention. 当接收的用户输入数据存在异常或不符合规则时,可以对用户进行提示。 When there is an abnormality of the user input data received or not comply with the rules, the user can be prompted. 例如,可以通过发出语音报警提示用户重新输入。 For example, by a voice alarm to prompt the user to re-enter. 又例如,可以通过定位到对应的表单元素来提示用户并指示用户重新输入。 As another example, it is possible to form elements corresponding to the indicated position and prompt the user to re-enter. 通过错误提示,可以保证正确输入数据,增加自定义表单的精确度,且便于用户更改错误。 By error, you can ensure the correct input data, increase the accuracy of the custom form, and facilitates the user to change the error.

[0061] 若接收的用户输入数据全部正确,则将全部数据保存或更新到数据库中,并重新生成及保存包含数据的表单模板,图7就是根据本发明一个实施例的包含数据的表单的示意图。 [0061] If the user input data received all correct, all data will be saved to the database or update, and re-generate and store form templates comprising data 7 is a schematic view of a form containing the data to an embodiment of the present invention. .

[0062] 在本发明的另一个优选实施例中,再次生成该表单时,可以判断是否存在包含数据的表单模板,若是则在步骤Si中直接读取或加载该包含数据的表单模板,若否则读取或加载空的表单模板。 When [0062] In another preferred embodiment of the present invention, the form generated again, the template can determine whether there is a form containing data, or if the loaded directly read the data in a form template comprising the step Si, if otherwise read or load a blank form template. 这样,可以减少与数据库交互的次数,从而提高工作效率。 In this way, the number of interactions with the database can be reduced, thereby improving efficiency.

[0063] 另外,在本发明的又一个优选实施例中,表单配置文件中的控件ID虽然与表单模板中的控件ID对应,但不是一一对应。 [0063] Further, in a further preferred embodiment of the present invention, the form control profile ID corresponding to the ID control although the form template, but not one to one. 即表单模板中的每个控件(或表单元素)不一定都能在表单配置文件中找到对应的控件配置,表单配置文件中的每个控件配置也不一定在表单模板中都有对应的控件。 That is, each control (or form elements) are not necessarily in the form template can be found in the corresponding configuration control form configuration file, the form configuration file for each control configuration is not necessarily in a form template has a corresponding controls. 例如,同一表单配置文件可以对应多个表单模板,这样可以一次根据多个表单模板以及多个表单配置文件生成多页的表单文件。 For example, the same configuration file may correspond to a plurality of sheet form templates, which can generate a profile form a plurality of pages according to a plurality of document templates and form a plurality of forms. 又例如,表单模板中可能会有扩展预留项,这些扩展预留项在表单配置文件中没有对应的配置信息。 As another example, the form template might be extended to reserve items, these items do not extend to reserve corresponding configuration information in the form configuration file. 这种非一一对应的关系,可以简化多任务办理工序、提高灵活性以及增强可扩展性。 This non one to one relationship, you can simplify the process of handling multiple tasks, increase flexibility and enhanced scalability.

[0064] 以上只是本发明的一些优选实施例,列举这些优选实施例只是为了解释本发明,而不用于限制本发明。 [0064] These are just some preferred embodiments of the present invention, preferred embodiments include those embodiments of the present invention for purposes of explanation and not intended to limit the present invention. 在本发明的其他实施例中,还可以包括本发明的上述任意特征和/或这些特征的任意组合。 In other embodiments of the present invention may further comprise any combination of any features and / or combinations of these features of the present invention.

[0065] 本发明提供的自定义表单采用网页表单格式,利用BS模式和JS及C#开发语言进行开发。 [0065] The present invention provides a custom form using a web form format, using the BS mode, and JS C # programming language and development. 具体地,在前台利用JS语言控制表单元素的验证和定位,在后台利用C#语言结合EXCEL配置文件封装表单元素,生成表单页面并实现业务逻辑的控制。 Specifically, in the foreground and verification using a control language JS positioning elements form, in the background using the C # language binding profile package EXCEL form elements, form page to generate and implement business logic control. 本发明提供的这种自定义表单能够做到与纸质表格的样式完全一致,达到所见即所得的效果,用户可以根据具体的业务需求制定出相应的表单,不仅提升了效率,而且业务内容一目了然。 This invention provides custom forms can do exactly the same style paper forms, to the effect WYSIWYG, the user can work out the appropriate form according to the specific business needs, not only improves the efficiency, and business content at a glance. 由于该自定义表单是通过EXCEL配置文件和WORD或者DREAMWEAVER画成的表单模版结合而生成,并且EXCEL配置文件和表单模版完全是由客户定制而成,故自定义表单有很强的业务适用性,即使业务发生了改变,但是表单生成系统并不需要做出任何的改变。 Since the custom form is generated by the configuration file and WORD or EXCEL DREAMWEAVER drawn form template binding, and the profile and forms EXCEL template is completely customizable by the customer together, so custom business form has a strong applicability, even if the business has changed, but the form generation system does not require to make any changes. 而且,由于自定义表单全部由可配置文件生成,并且提供了众多实现接口,实现了与业务系统完全分离的效果,所以在业务系统开发过程中可以重复利用表单,不需要为具体的业务编写具体的表单页面,提高效率,降低难度。 Further, since all the custom forms generated by a configuration file, and provides numerous implementation-interface, the system is fully operational with the effect of separation, so the service system development process can be recycled form, does not need to write a specific service specific the form page, improve efficiency, reduce the difficulty. 另外,自定义表单与数据库的交互也是由配置实现,有很强的移植性,在不同的业务系统之间,只要客户配置文件中配置的数据库表名与字段完全符合,表单就能够将客户录入的数据写入或更新到相应的数据库表中。 In addition, custom forms from the interaction with the database is realized by the configuration, there is a strong portability between different business systems, as long as the customer profile in the configuration database table names and field full compliance, the form will be able to enter the customer data writing or updating the corresponding database tables. 除此以外,自定义表单还可以简化多任务同时办理的工序,当某一任务需处理多个表单时,自定义表单可以提供分页进行一次性处理,这样不仅简化了工序,同时也提高了工作效率。 In addition, custom form may further simplify the step of handling multiple tasks at the same time, when a plurality of tasks to be processed forms, custom form tabs may be provided a one-time process, so that not only simplifies the process, but also improve the work effectiveness. [0066] 虽然本发明是通过具体实施例进行说明的,本领域技术人员应当明白,在不脱离本发明范围的情况下,还可以对本发明进行各种变换及等同替代。 [0066] While the present invention has been described with reference to specific embodiments, those skilled in the art will appreciate, without departing from the scope of the present invention, various changes may be made and equivalents may be an alternative to the present invention. 另外,针对特定情形或材料,可以对本发明做各种修改,而不脱离本发明的范围。 Further, for a particular situation or material, various modifications may be made to the invention without departing from the scope of the invention. 因此,本发明不局限于所公开的具体实施例,而应当包括落入本发明权利要求范围内的全部实施方式。 Accordingly, the present invention is not limited to the particular embodiment disclosed, but shall include within the claims of the invention fall within the scope of all embodiments.

Claims (10)

  1. 1. 一种表单生成方法,其特征在于,包括: 51、将表单配置文件读取为独立数据集合,并将表单模板读取为字符串; 52、 根据所述表单配置文件中的表单兀素地址在表单模板字符串中查找对应的表单元素,并在查找到对应的表单元素后,将所述表单配置文件中该表单元素对应的配置信息赋予所述表单模板中的该表单元素; 53、将得到的表单模板输出为网页表单。 CLAIMS 1. A method for generating a form, which is characterized in that, comprising: 51, reads the profile to form an independent data set, the read form template to a string; 52, according to the form of the profile element forms Wu address lookup in the form template string corresponding form elements, and after finding the corresponding form elements, form the configuration file in the configuration information of the form given to the corresponding elements in the form of the element in the form template; 53, form template output the result to a web form.
  2. 2.根据权利要求I所述的表单生成方法,其特征在于,步骤SI中,使用类库读取所述表单配置文件和所述表单模板。 2. Form I according to claim generation method, wherein, in step SI, a form library to read the configuration file and the form template.
  3. 3.根据权利要求2所述的表单生成方法,其特征在于,步骤SI中,使用ADO. NET读取所述表单配置文件,并使用.NET类库通过流的方式读取所述表单模板。 3. The method of claim 2 form generation claim, wherein the step SI using ADO. NET form reading the configuration file and read the .NET class library template form through the flow way.
  4. 4.根据权利要求1-3中任一项所述的表单生成方法,其特征在于,步骤S3还包括接收用户输入的数据,并保存或更新到数据库中。 The form generation method according to any one of the preceding claims, wherein step S3 further comprising receiving user input data, and stores or updates to the database.
  5. 5.根据权利要求4所述的表单生成方法,其特征在于,再次生成所述表单时,判断是否存在包含数据的表单模板,若是则在所述步骤SI中直接读取所述包含数据的表单模板。 The form generation method according to claim 4, wherein generating the form again, it is determined whether there is a form template contains data, if the reading of the data contained directly in the form in the step SI template.
  6. 6. 一种表单生成装置,其特征在于,包括: 数据库,用于存储表单配置文件和表单模板; 读取模块,用于将表单配置文件读取为独立数据集合,并将表单模板读取为字符串; 匹对模块,用于根据所述表单配置文件中的表单兀素地址在表单模板字符串中查找对应的表单元素,并在查找到对应的表单元素后,将所述表单配置文件中该表单元素对应的配置信息赋予所述表单模板中的该表单元素; 输出模块,用于将所述匹对模块处理后的所述表单模板字符串输出为网页表单。 A form generation apparatus comprising: a database configured to store form templates and form profile; reading module configured to read the profile forms independent data set, the read form template is string; match module configured to find the corresponding form elements in the form according to the form template string form Wu profile element address, and after finding the corresponding form elements, form the configuration file configuration information of the form elements corresponding to elements of the form given to the form template; an output module for the web form to match the form template module for processing the output string.
  7. 7.根据权利要求6所述的表单生成装置,其特征在于,所述读取模块使用类库读取所述表单配置文件和所述表单模板。 7. The form of the generating apparatus according to claim 6, characterized in that the read module reads the library configuration file forms and the form template.
  8. 8.根据权利要求7所述的表单生成装置,其特征在于,所述读取模块使用ADO. NET读取所述表单配置文件,并使用.NET类库通过流的方式读取所述表单模板。 Form according to claim 7, wherein said generating means, wherein the reading module ADO. NET form reading the configuration file and read the .NET class library template form by way of flow .
  9. 9.根据权利要求6-8中任一项所述的表单生成装置,其特征在于,所述表单生成装置还包括输入模块,所述输入模块用于接收用户输入的数据,并将所述数据保存或更新到所述数据库中。 9. The form as claimed in any one of claims 6-8 generating means, wherein said form generating means further comprises an input module, the input module for receiving user input data and said data save or update the database.
  10. 10.根据权利要求9所述的表单生成装置,其特征在于,所述读取模块还用于在再次生成所述表单时,判断是否存在包含数据的表单模板,若是则直接读取所述包含数据的表单模板。 10. A form according to claim 9 generating apparatus, wherein the reading module is further used in generating the form again, determines whether there is a form template contains data, if said read directly comprising form template data.
CN 201110167154 2011-06-21 2011-06-21 Form generating method and device CN102201009B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201110167154 CN102201009B (en) 2011-06-21 2011-06-21 Form generating method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201110167154 CN102201009B (en) 2011-06-21 2011-06-21 Form generating method and device

Publications (2)

Publication Number Publication Date
CN102201009A true CN102201009A (en) 2011-09-28
CN102201009B true CN102201009B (en) 2013-02-27

Family

ID=44661684

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201110167154 CN102201009B (en) 2011-06-21 2011-06-21 Form generating method and device

Country Status (1)

Country Link
CN (1) CN102201009B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102682126B (en) * 2012-05-16 2016-08-03 深圳市凯立德科技股份有限公司 A method of accessing data in a form and means
CN102799574A (en) * 2012-06-29 2012-11-28 无锡永中软件有限公司 Data partitioning and merging method for electronic forms
CN104375818A (en) * 2013-10-11 2015-02-25 北京金辉东方科技有限公司 System and method for achieving general data form inputting through configuration files
CN104572131A (en) * 2015-02-04 2015-04-29 浪潮软件股份有限公司 Method and device for configuring business form
CN104899031B (en) * 2015-05-29 2018-01-09 北京京东尚科信息技术有限公司 Logistic data stream generating method and apparatus and a method and apparatus configure client

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7421648B1 (en) * 1999-05-21 2008-09-02 E-Numerate Solutions, Inc. Reusable data markup language
CN101957936A (en) * 2009-07-15 2011-01-26 深圳市艾派应用系统有限公司 Method and system for implementing workflow form
CN101650712A (en) * 2009-08-18 2010-02-17 深圳市科陆电子科技股份有限公司 Generating management method and system of self-defined report

Also Published As

Publication number Publication date Type
CN102201009A (en) 2011-09-28 application

Similar Documents

Publication Publication Date Title
US20070061752A1 (en) Cross-application support of charts
US8239882B2 (en) Markup based extensibility for user interfaces
US20060150088A1 (en) System and method for dynamically creating a destination template
US20140033010A1 (en) Method and system for dynamic assembly of form fragments
US8112738B2 (en) Apparatus and method of customizable model import and export to and from XML schema formats
US20060059418A1 (en) Data insertion from a database into a fixed electronic template form that supports overflow data
Bächle et al. Ruby on rails
US20050063010A1 (en) Multiple flow rendering using dynamic content
US20090158134A1 (en) Method and apparatus for form adaptation
US7721254B2 (en) Programming interface for a computer platform
US20100318894A1 (en) Modifications to Editable Elements of Web Pages Rendered in Word Processor Applications
US8516435B2 (en) System and method for generating implementation artifacts for contextually-aware business applications
US20060195777A1 (en) Data store for software application documents
US20060277523A1 (en) Annotations for tracking provenance
CN102609271A (en) Metadata-driven visual SaaS (Software as a Service) application customizing method and metadata-driven visual SaaS application customizing system
CN101650712A (en) Generating management method and system of self-defined report
CN102646039A (en) Software interface generating system and method based on extensible markup language (XML) Schema
CN101968800A (en) Metadata driving based method for realizing dynamic form
US20090282389A1 (en) Abstracting Test Cases From Application Program Interfaces
CN102156741A (en) Custom dynamic report system and implementation method thereof
CN1794167A (en) Method of setting printing parameter
CN101727324A (en) Code generation method and device
CN102609252A (en) Intelligent configuration method for logic menu resources on basis of measurement instruments
Schippers et al. Leveraging UML profiles to generate plugins from visual model transformations
CN101706716A (en) VO-based form customization, configuration and parsing operation method

Legal Events

Date Code Title Description
C06 Publication
C10 Request of examination as to substance
C14 Granted