CN110032720A - A kind of visualization report typesetting and automatic generation method and system based on XML - Google Patents

A kind of visualization report typesetting and automatic generation method and system based on XML Download PDF

Info

Publication number
CN110032720A
CN110032720A CN201811627389.7A CN201811627389A CN110032720A CN 110032720 A CN110032720 A CN 110032720A CN 201811627389 A CN201811627389 A CN 201811627389A CN 110032720 A CN110032720 A CN 110032720A
Authority
CN
China
Prior art keywords
report
template
xml
file
style
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN201811627389.7A
Other languages
Chinese (zh)
Inventor
薛成海
雷文婕
龚永辉
曲亚楠
刘倩茹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wankangyuan (tianjin) Gene Technology Co Ltd
Original Assignee
Wankangyuan (tianjin) Gene Technology Co Ltd
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
Application filed by Wankangyuan (tianjin) Gene Technology Co Ltd filed Critical Wankangyuan (tianjin) Gene Technology Co Ltd
Priority to CN201811627389.7A priority Critical patent/CN110032720A/en
Publication of CN110032720A publication Critical patent/CN110032720A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/189Automatic justification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Abstract

The present invention proposes that typesetting and automatic generation method and system are reported in a kind of visualization based on XML, comprising: design XML report template style;The XML report template style directly maps report batch production program;XML report template is automatically generated based on visual means;The visual means are realized in such a way that the online page is applied;XML report template extracts automatically can map report content template file;And XML report template is backfilled automatically after replacing content;It is reported based on XML report template generation.Invention defines the XML report template generation methods that one kind can directly map report batch production program, it realizes and the content of the non-pattern of report is individually extracted and forms simple mapping format, convenient for the docking of report content generating routine, rapid batch production report, on the one hand the efficiency of report template exploitation is improved, visible i.e. resulting report generation mode is on the other hand also achieved.

Description

A kind of visualization report typesetting and automatic generation method and system based on XML
Technical field
The invention belongs to field of information system, a kind of visualization report typesetting based on XML and automatic is especially related to Generation method and system.
Background technique
It report visualization typesetting and automatically generates and quick and precisely transmits in realization information, meets and compare on users ' individualized requirement The single pattern of tradition or can not the mode of report of Mass production there is apparent advantage.Therefore, how What You See Is What You Get is realized Visualization typesetting and automatic report generation, be the crucial technical problem that must be solved.Report typesetting is realized on current market And it generates the mainly Automatic Typesetting by three kinds of approach (1) based on algorithm and generates the report that report (2) is directly based upon pattern template It accuses generation (3) to generate by hand with composing tools, as Word software generates report one by one.Wherein Automatic Typesetting and report based on algorithm Report generation can be fast implemented although accusing and generating, can not accurately realize that report element arranges or even causes according to customer demand Ambiguity is interpreted in report;Although and the report generation for being directly based upon pattern template can meet user by adjusting pattern and customize report It accuses, but the pattern template that adjustment needs modification complicated every time is lower in intuitive and efficiency;It is last to pass through existing tool by hand Although generating report realizes What You See Is What You Get but is unable to satisfy the reporting requirements for producing similar typesetting in batches.
Summary of the invention
In view of this, the present invention proposes that typesetting and automatic generation method and system are reported in a kind of visualization based on XML, lead to It crosses and parses and define basic element type in report, realize that page visualization pulls report element and pattern is modified and then generates institute See that i.e. resulting visualization report XML template, the XML template are docked based on the mapping relations of setting with report production routine, most The automated production of report is realized eventually.
In order to achieve the above objectives, the technical scheme of the present invention is realized as follows:
A kind of visualization report typesetting and automatic generation method based on XML, comprising:
S1, design XML report template style;The XML report template style directly maps report batch production program;
S2, XML report template is automatically generated based on visual means;The visual means are by online page application Mode realize;
S3, XML report template extracts automatically can map report content template file;And it is backfilled automatically after replacing content XML report template;
S4, it is reported based on XML report template generation.
Further, in step S1, the specific design method of the XML report template style includes:
S1.1, design document.xml configuration file;The document.xml configuration file defines the whole of report Body page configuration;
S1.2, design template.xml configuration file;The template.xml configuration file storage report element and Element structure information;
S1.3, design template_style.xml configuration file;The template_style.xml configuration file is Style information configuration file configures the style information of primary clustering.
Further, in step S2, the design method of the application on site page includes:
S2.1, design tool column, all components in definition report;The component clicked in toolbar generates one on interface A svg figure pulled;
S2.2, design page setup panel, for be arranged the page size and up and down margin away from size;
S2.3, design attributes panel, the specific object value that can be modified for defining various components;
S2.4, design scale component, depict equidistant scale in the left side at interface and upside in div layers of form The transforming relationship of line, customized pixel and cm simultaneously mark scale on interface, can mark when user's mobile mouse on interface Current location is marked out on ruler in the form of vertical line;
S2.5, design measuring tool panel, for showing the specific numerical value in current location;
S2.6, design interactive display interface, are mainly used to typesetting and displaying, define each component and need to be placed on blank page Rule, and verified on interface, only meeting the rule just can be carried out drag and drop.Alignment is configured with during dragging Reference line is used to be aligned the edge or central point of various components;
S2.7, design operation button, for generating template file and addition template file, generation template file is will be global The data saved in variable are reduced into meet specification xml template file and be supplied to user again and be downloaded and subsequent use. Addition template file refers to using on ajax local loading one or more template file to current interface, quickly shows this The report interface effect of template file.
Further, in step S3, the text file is designed as the tab-delimited text file of biserial;First It is classified as the identifier of content element, second is classified as the report content that corresponding identifier is directed toward;Content is extracted from creation data to replace This article this document corresponding content is changed, during report generation, this article this document is backfilled back automatically in template.xml file, Form the template data for the report to be generated.
Further, in step S4, the generation method of the report includes:
S4.1, selection generate PDF format report or html format report;
S4.2, such as selection generate PDF format report, generate program and are divided into five assembly modules, are respectively main report generation Module, Reporting entities module, headerfooter module, model module and toolkit module;
Wherein: main report generation module definition global variable saves Document doc object, reports inlet flow Writer object, the catalogue of output report, the title of output report, the path of resource file define in LoadResources Method load document.xml template file by variable save in each corresponding variable of ConfigConstant class with Just it uses later, load template_style.xml style content file is stored in variable, loads in template.xml acquisition Hold file and creates report;
It is all model corresponding with configuration file in Reporting entities module, the parent of all models is all Report Class, table attached bag is for reading and storing the table content in resource file;Data in CusCell entity are used in In TableModel, used in addition table into report;Data in UtilCell entity, which are used in, to be merged in table;
Headerfooter module is divided into footer, and tri- components of header, pageNum, all headerfooters and the page number are all Realize corresponding abstract class, the implementation method of implementation method and verso including recto;
Model module is divided into GraphModel for graphing;ParModel is for loading addition paragraph, replacement line feed Symbol, reads parameter setting section front distance, and the style informations such as first trip retraction simultaneously read specific paragraph content information and are loaded into report On the page;TabModel obtains corresponding style information and merges place to table for adding table on the reporting page Reason;
Tool-class is defined in toolkit module, copyEntity tool-class is used to from map turn data by Report class Turn to the operation of subclass;SortData tool-class is used in Merge Cells, is operated according to the weight sequencing of cell; DataMapping is used to the value in configuration file being converted to the available value of program;UnitConverter is the work of Conversion of measurement unit Has class;
S4.3, such as selection generate html format report, read template.xml configuration file, and corresponding format is converted into Html, css format, picture turn Base64 coding, generate html editions static reports.
Another aspect of the present invention, it is also proposed that a kind of visualization report typesetting and automatic creation system based on XML, packet It includes:
Template style designs module, for designing XML report template style;The XML report template style directly maps Report batch production program;
Visual Production module automatically generates XML report template based on visual means;The visual means are to pass through The mode of online page application is realized;
Replacement backfill module, can map report content template file for extracting XML report template automatically;And it is replacing Automatically XML report template is backfilled after content;
Reporting modules are reported based on XML report template generation.
Further, the template style design module includes:
First configuration unit, for designing document.xml configuration file;The document.xml configuration file is fixed The overall page configuration of justice report;
Second configuration unit, for designing template.xml configuration file;The template.xml configuration file is deposited Store up report element and element structure information;
Third configuration unit, for designing template_style.xml configuration file;The template_ Style.xml configuration file is style information configuration file, is configured to the style information of primary clustering.
Further, the Visual Production module includes:
Toolbar design cell is used for design tool column, all components in definition report;Click the component in toolbar A svg figure that can be pulled is generated on interface;
Page setup panel design cell, size and a left side up and down for designing page setup panel, for the page to be arranged Right margin away from size;
Properties palette design cell is used for design attributes panel, the specific object that can be modified for defining various components Value;
Scale component design cell is drawn for designing scale component in the left side at interface and upside in div layers of form The transforming relationship of equidistant scale line, customized pixel and cm simultaneously mark scale on interface, when user moves up at interface Current location can be marked out in the form of vertical line on scale when dynamic mouse;
Measuring tool panel design cell, for designing measuring tool panel, for showing the specific numerical value in current location;
Interactive display interface unit is mainly used to typesetting and displaying, defines each group for designing interactive display interface Part needs to be placed on the rule on blank page, and is verified on interface, and only meeting the rule just can be carried out drag and drop.It is dragging Edge or central point that alignment guide is used to be aligned various components are configured with during dragging;
Operation button design cell is used for design operation button, for generating template file and addition template file, generates Template file be the data that will be saved in global variable be reduced into again meet specification xml template file and be supplied to user progress Downloading and subsequent use.Addition template file, which refers to, utilizes ajax local loading one or more template file to current interface On, quickly show the report interface effect of this template file.
Further, the replacement backfill module includes:
Text unit, for text file to be designed as the tab-delimited text file of biserial;First be classified as in Hold the identifier of element, second is classified as the report content that corresponding identifier is directed toward;
Replacement unit replaces this article this document corresponding content for extracting content from creation data;
Backfilling unit is used for during report generation, and this article this document is backfilled back automatically in template.xml file, Form the template data for the report to be generated.
Further, the reporting modules include:
Selecting unit generates PDF format report or html format report for selecting;
PDF report generation unit: for generating PDF format report, generating program and be divided into five assembly modules, respectively based on Report generation module, Reporting entities module, headerfooter module, model module and toolkit module;
Wherein: main report generation module definition global variable saves Document doc object, reports inlet flow Writer object, the catalogue of output report, the title of output report, the path of resource file define in LoadResources Method load document.xml template file by variable save in each corresponding variable of ConfigConstant class with Just it uses later, load template_style.xml style content file is stored in variable, loads in template.xml acquisition Hold file and creates report;
It is all model corresponding with configuration file in Reporting entities module, the parent of all models is all Report Class, table attached bag is for reading and storing the table content in resource file;Data in CusCell entity are used in In TableModel, used in addition table into report;Data in UtilCell entity, which are used in, to be merged in table;
Headerfooter module is divided into footer, and tri- components of header, pageNum, all headerfooters and the page number are all Realize corresponding abstract class, the implementation method of implementation method and verso including recto;
Model module is divided into GraphModel for graphing;ParModel is for loading addition paragraph, replacement line feed Symbol, reads parameter setting section front distance, and the style informations such as first trip retraction simultaneously read specific paragraph content information and are loaded into report On the page;TabModel obtains corresponding style information and merges place to table for adding table on the reporting page Reason;
Tool-class is defined in toolkit module, copyEntity tool-class is used to from map turn data by Report class Turn to the operation of subclass;SortData tool-class is used in Merge Cells, is operated according to the weight sequencing of cell; DataMapping is used to the value in configuration file being converted to the available value of program;UnitConverter is the work of Conversion of measurement unit Has class;
HTML report generation unit reads template.xml configuration file, corresponding lattice for generating html format report Formula is converted into html, css format, and picture turns Base64 coding, generates html editions static reports.
Compared with prior art, the present invention have it is following the utility model has the advantages that
(1) real invention defines the XML report template generation method that one kind can directly map report batch production program Showed the element type (such as figure, text, table, headerfooter, catalogue etc.) that report typesetting process is related to and element pattern (such as grow, Width, font, color, font size, back gauge etc.) standardization definition.Standardization definition based on the XML template, realizes to report The content of non-pattern individually extracts and is formed simple mapping format, docks convenient for report content generating routine, rapid batch production Report.
(2) the present invention is based on visual means to realize automatically generating for XML report template.The side that page visualization pulls On the one hand formula improves the efficiency of report template exploitation, on the other hand also achieves visible i.e. resulting report generation mode, both Client adjusts report number during reducing template development, and improves adjustment report style efficiency.
Detailed description of the invention
Fig. 1 is report element node DOM structure tree in the document.xml of the embodiment of the present invention;
Fig. 2 is report element node DOM structure tree in the template.xml of the embodiment of the present invention;
Fig. 3 is text box node dom structure tree and the example value of the embodiment of the present invention;
Fig. 4 is paragraph node dom structure tree and the example value of the embodiment of the present invention;
Fig. 5 is a kind of table dom structure tree and the example value of the embodiment of the present invention;
Fig. 6 is the two of the embodiment of the present invention, three classes table dom structure tree and example value;
Fig. 7 is the visualization typesetting application on site interface of the embodiment of the present invention;
Fig. 8 is the report generation flow diagram of the embodiment of the present invention.
Specific embodiment
It should be noted that in the absence of conflict, the feature in embodiment and embodiment in the present invention can phase Mutually combination.
Technical solution of the present invention is described in further detail with reference to the accompanying drawing:
The contents of the present invention include:
Step 1: design can directly map the XML report template style of report batch production program;The format has accepted mould Plate visual template automatically generates and reports batch production program.
The XML format is started with report node, and a document child node and multiple is contained under report node Page child node stores the information such as page-size and margin of overall page in document node away from information, page section Point corresponds to the specific page of report, includes multiple paragraph child nodes, picture child node and table child node under page node and determines Header, footer and the page number of justice itself.Defined again in the attribute of each node the size of the element, position, color, font, The style informations such as font size.The report template of design includes three files in total, is respectively as follows: document.xml, Template.xml, template_style.xml.Wherein document.xml storage report page Global Information, Template.xml storage report element and element structure information, template_style.xml storage report style information, tool Body is as follows:
(1) document.xml configuration file
Document.xml configuration file defines the overall page configuration of report, is specifically defined relationship such as Fig. 1:
Size defines Report Page type and size, mar define margin away from size, with~segmentation left and right up and down four A margin is away from unit pt is configuration file example below
<document>
<size>A4_rotate</size>
<mar>80.5~80.5~150~63</mar>
</document>
(2) template.xml configuration file
Template.xml storage report element and element structure information, specific node definition are shown in Fig. 2 and table 1.
Report element node details table in table 1.template.xml
(3) template_style.xml configuration file
Template_style.xml is style information configuration file, is matched to the style information of three primary clusterings It sets, text box specific element node definition and example values are shown in Fig. 3.
Paragraph specific element node definition and example values are shown in Fig. 4.
The definition of table element is divided into three types in report, and a kind of table is the table of fixed type, and program is not to this The table of type carries out any specially treated,<cell_layout>of the pattern of whole cells all in configuration file and< It is arranged in cell_style > two node, Fig. 5 is shown in specific node configuration;Two class tables are that gauge outfit pattern is identical with content genres Or regularity repetition such as even column pattern is identical, odd column pattern is identical, and such table can only define certain a line Pattern, program, which automatically processes, generates other rows, defines<table_header_layout>and<table_content_ Layout>definition gauge outfit pattern and content genres, without the section of<cell_layout>and<cell_style>of one kind table Point;The third table is when in table containing repeating to arrange, and program can merge automatically table content, such as 2 program of table It can be merged into table 3 automatically.Second class table does not need configuration merging sequentially compared with third class table, i.e. and two class tables < Merge_order > nodal value is sky, and three classes table cannot all be consistent for sky, other attributes.Fig. 6 is shown in specific node configuration.
Table 2. does not merge table example
a b
a c
d d
Table 3. merges table example automatically
Step 2: XML report template is automatically generated based on visual means
Based on visual means generate report template not only improved report template exploitation efficiency and realize report it is visible I.e. resulting generating mode.The visualization approach realizes in such a way that the online page is applied, as shown in Figure 7;The page apply by Toolbar, page setup panel, Properties palette, scale, measuring tool panel, operation button, seven part group of interactive display interface At.
(1) toolbar defines all components element in report, and clicking the component in toolbar can generate on interface One svg figure that can be pulled.Paragraph component default is the rectangle of a 100px*80px, and can be generated by double-clicking the component by one Div layers, the contenteditable=that sets property " true " allows user's typing text in the layer, after the completion of typing Text is stored under<text>child node, the display work of paragraph text is completed.Picture component default is a 200px* The rectangle of 200px can modify the href attribute value of<image>child node after inputting picture path, be changed to the picture of user's typing Path, thus by picture presentation on interface.Form component default is the rectangle of a 400px*200px.Blank page component is silent Recognize be a 1188px*840px rectangle, inside be a default size be 961.5px*539.6px dashed rectangle, represent Remove margin away from rear really for the range of user's operation, while designating two center lines with dotted line, designated with dot Central point.The size of blank page and up and down margin away from size can be modified by the page setup panel on right side, Meeting Local hydrodynamic unit current page after saving is clicked, blank page component is rendered again and completes to update operation.Choice box component can be with Disposable frame selects multiple components.All components finish message such as the following table 4:
4. module information table of table
(2) Properties palette defines the specific object value that various components can be modified, and introduces and realizes by taking paragraph component as an example Method.The Properties palette of after paragraph component it can be seen that right side paragraph, attribute value have font, font size, font type in elected Equal attributes, when selecting font as the attribute style=" font-family:SimSun of<text>can be set dynamically when the Song typeface;" from And the modification to font is completed, font-size attribute can be dynamically arranged in same font size, and font type is dynamically arranged Two attributes of font-weight and font-style, other attributes are also equally by changing some nodal community of svg come complete At the modification of pattern.While dynamic modification shows interface, to be modified to ground respective attributes value is saved in global variable, from And the consistency for keeping template file and current interface to configure.
(3) scale component is to depict equidistant scale line in the left side at interface and upside in div layers of form, is made by oneself The transforming relationship of adopted pixel and cm simultaneously mark scale on interface, can be on scale with perpendicular when user's mobile mouse on interface The form of line marks out current location, while specific numerical value is shown on measuring tool panel, and user is facilitated to measure.
(4) interactive display interface is mainly used to typesetting and displaying, defines paragraph, picture, and form component needs are placed on Rule on blank page, and verified on interface, only meeting the rule just can be carried out drag and drop.Match during dragging Edge or central point that alignment guide is used to be aligned various components are set.
(5) operation button includes generating template file and addition template file two parts, and generation template file is exactly will be complete The data saved in office's variable are reduced into meet specification xml template file and be supplied to user and be downloaded again to be made with subsequent With.Addition template file refers to using on ajax local loading one or more template file to current interface, quickly shows The report interface effect of this template file.
Step 3: report content template can be mapped based on visualizing the report template that online page application generates and extracting automatically File
Visualizing the report template that online page application generates is XML format, because containing report style and report element Node structure information, directly operation can be more complicated and be unfavorable for reporting that developer quickly develops routine interface, thus from this The biserial that report content one simple format of formation for needing to refill further is extracted in XML report template is tab-delimited Text file.First is classified as the identifier of content element, and second is classified as the report content that corresponding identifier is directed toward.Developer By checking this article this document, content can be quickly extracted from creation data and replaces this article this document corresponding content.Hereafter, exist During report generation, this article this document is backfilled back automatically in template.xml file, forms the template for the report to be generated Data.
Step 4: it is reported based on XML report template generation
It generates report and supports two kinds of reporting formats, respectively PDF format report and html format report.PDF format report Client is conveniently supplied to print, and html format report facilitates user to be checked online.
(1) PDF format report generation, the program of this report generation method are divided into five assembly modules, respectively based on report Generation module, Reporting entities module, headerfooter module, model module and toolkit module.
Main report generation module is the main body program of production report, defines global variable and saves Document doc couple As reporting inlet flow Writer object, the catalogue of output report, the title of output report, path (such as the font of resource file File), method load document.xml template file is defined in LoadResources, and variable save exists To use later in each corresponding variable of ConfigConstant class, template_style.xml style content is loaded File is stored in variable, and load template.xml obtains content file and creates report.
It is all model corresponding with configuration file in Reporting entities module, the parent of all models is all Report Class, table attached bag is for reading and storing the table content in resource file.Data in CusCell entity are used in In TableModel, used in addition table into report.Data in UtilCell entity, which are used in, to be merged in table.
Headerfooter module is divided into footer, and tri- components of header, pageNum, all headerfooters and the page number are all Realize corresponding abstract class, the implementation method of implementation method and verso including recto.
Model module is divided into GraphModel for graphing, and ParModel is for loading addition paragraph, replacement line feed Symbol, reads parameter setting section front distance, and the style informations such as first trip retraction simultaneously read specific paragraph content information and are loaded into report On the page.TabModel obtains corresponding style information and merges place to table for adding table on the reporting page Reason.Some tool-class are defined in toolkit module, copyEntity tool-class is used to from map turn data by Report class Turn to the operation of subclass.SortData tool-class is used in Merge Cells, is operated according to the weight sequencing of cell. DataMapping is used to the value in configuration file being converted to the available value of program.UnitConverter is the work of Conversion of measurement unit Has class.
(2) html format report generation, reads template.xml configuration file, and corresponding format is converted into html, css lattice Formula, picture turn Base64 coding, generate html editions static reports.Specific XML and css conversion map contextual definition such as the following table 5:
Table 5.XML template and CSS convert mapping table
Specific template.xml mapping relations such as the following table 6 corresponding with html:
Table 6.XML template and HTML convert mapping table
The above-mentioned content later from step 2 is the specific report generation process in the embodiment of the present invention, as shown in Figure 8.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention Within mind and principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (10)

1. a kind of visualization report typesetting and automatic generation method based on XML characterized by comprising
S1, design XML report template style;The XML report template style directly maps report batch production program;
S2, XML report template is automatically generated based on visual means;The visual means are the sides applied by the online page Formula is realized;
S3, XML report template extracts automatically can map report content template file;And backfill XML report automatically after replacing content Slide former;
S4, it is reported based on XML report template generation.
2. the method according to claim 1, wherein the XML report template style is specifically set in step S1 Meter method includes:
S1.1, design document.xml configuration file;The document.xml configuration file defines the whole page of report Face configuration;
S1.2, design template.xml configuration file;The template.xml configuration file storage report element and element Structural information;
S1.3, design template_style.xml configuration file;The template_style.xml configuration file is pattern Information configuration file configures the style information of primary clustering.
3. the method according to claim 1, wherein in step S2, the design method of the application on site page Include:
S2.1, design tool column, all components in definition report;Click the component in toolbar one is generated on interface can The svg figure of dragging;
S2.2, design page setup panel, for be arranged the page size and up and down margin away from size;
S2.3, design attributes panel, the specific object value that can be modified for defining various components;
S2.4, design scale component, depict equidistant scale line in the left side at interface and upside in div layers of form, from The transforming relationship for defining pixel and cm simultaneously marks scale on interface, when user's mobile mouse on interface can on scale with The form of vertical line marks out current location;
S2.5, design measuring tool panel, for showing the specific numerical value in current location;
S2.6, design interactive display interface, are mainly used to typesetting and displaying, define each component and need to be placed on rule on blank page Then, and on interface it is verified, only meeting the rule just can be carried out drag and drop.Alignment reference is configured with during dragging Line is used to be aligned the edge or central point of various components;
S2.7, design operation button, for generating template file and addition template file, generating template file is by global variable In the data that save be reduced into meet specification xml template file and be supplied to user again and be downloaded and subsequent use.Addition Template file refers to using on ajax local loading one or more template file to current interface, quickly shows this template The report interface effect of file.
4. the method according to claim 1, wherein the text file is designed as a biserial in step S3 Tab-delimited text file;First is classified as the identifier of content element, and second is classified as in the report that corresponding identifier is directed toward Hold;Content is extracted from creation data and replaces this article this document corresponding content, and during report generation, this article this document is automatic It backfills back in template.xml file, forms the template data for the report to be generated.
5. the method according to claim 1, wherein in step S4, the generation method of the report includes:
S4.1, selection generate PDF format report or html format report;
S4.2, such as selection generate PDF format report, generate program and are divided into five assembly modules, are respectively main report generation module, Reporting entities module, headerfooter module, model module and toolkit module;
Wherein: main report generation module definition global variable saves Document doc object, reports Writer pairs of inlet flow As the catalogue of output report, the title of output report, the path of resource file defines method load in LoadResources Document.xml template file makes variable save later in each corresponding variable of ConfigConstant class With load template_style.xml style content file is stored in variable, and load template.xml obtains content file simultaneously Creation report;
It is all model corresponding with configuration file in Reporting entities module, the parent of all models is all Report class, Table attached bag is for reading and storing the table content in resource file;Data in CusCell entity are used in In TableModel, used in addition table into report;Data in UtilCell entity, which are used in, to be merged in table;
Headerfooter module is divided into footer, and tri- components of header, pageNum, all headerfooters and the page number will be real Existing corresponding abstract class, the implementation method of implementation method and verso including recto;
Model module is divided into GraphModel for graphing;ParModel adds paragraph for loading, and replaces newline, Parameter setting section front distance is read, the style informations such as first trip retraction simultaneously read specific paragraph content information and are loaded into Report Page On;TabModel obtains corresponding style information and merges processing to table for adding table on the reporting page;
Tool-class is defined in toolkit module, copyEntity tool-class from map by Report class for being converted data to The operation of subclass;SortData tool-class is used in Merge Cells, is operated according to the weight sequencing of cell; DataMapping is used to the value in configuration file being converted to the available value of program;UnitConverter is the work of Conversion of measurement unit Has class;
S4.3, such as selection generate html format report, read template.xml configuration file, and corresponding format is converted into html, Css format, picture turn Base64 coding, generate html editions static reports.
6. a kind of visualization report typesetting and automatic creation system based on XML characterized by comprising
Template style designs module, for designing XML report template style;The XML report template style directly maps report Produce program in batches;
Visual Production module automatically generates XML report template based on visual means;The visual means are by online The mode of page application is realized;
Replacement backfill module, can map report content template file for extracting XML report template automatically;And in replacement content Backfill XML report template automatically afterwards;
Reporting modules are reported based on XML report template generation.
7. system according to claim 6, which is characterized in that the template style designs module and includes:
First configuration unit, for designing document.xml configuration file;The document.xml configuration file defines The overall page of report configures;
Second configuration unit, for designing template.xml configuration file;The template.xml configuration file storage report Accuse element and element structure information;
Third configuration unit, for designing template_style.xml configuration file;The template_style.xml matches Setting file is style information configuration file, is configured to the style information of primary clustering.
8. system according to claim 6, which is characterized in that the Visual Production module includes:
Toolbar design cell is used for design tool column, all components in definition report;The component in toolbar is clicked on boundary A svg figure that can be pulled is generated on face;
Page setup panel design cell, for designing page setup panel, for the size and page up and down of the page to be arranged The size of back gauge;
Properties palette design cell is used for design attributes panel, the specific object value that can be modified for defining various components;
Scale component design cell is depicted for designing scale component in the left side at interface and upside in div layers of form The transforming relationship of the scale line of distance, customized pixel and cm simultaneously mark scale on interface, when user moves mouse on interface Current location can be marked out when mark in the form of vertical line on scale;
Measuring tool panel design cell, for designing measuring tool panel, for showing the specific numerical value in current location;
Interactive display interface unit is mainly used to typesetting and displaying, defining each component needs for designing interactive display interface The rule being placed on blank page, and verified on interface, only meeting the rule just can be carried out drag and drop.In dragging It is configured with edge or central point that alignment guide is used to be aligned various components in the process;
Operation button design cell is used for design operation button, for generating template file and addition template file, generates template File is that the data that will be saved in global variable are reduced into meet specification xml template file and be supplied to user again and are downloaded With subsequent use.Addition template file refers to using on ajax local loading one or more template file to current interface, fastly Speed shows the report interface effect of this template file.
9. system according to claim 6, which is characterized in that the replacement backfills module and includes:
Text unit, for text file to be designed as the tab-delimited text file of biserial;First is classified as content member The identifier of element, second is classified as the report content that corresponding identifier is directed toward;
Replacement unit replaces this article this document corresponding content for extracting content from creation data;
Backfilling unit is used for during report generation, and this article this document is backfilled back automatically in template.xml file, is formed The template data for the report to be generated.
10. system according to claim 6, which is characterized in that the reporting modules include selecting unit, PDF report life At unit, HTML report generation unit, in which:
Selecting unit: PDF format report or html format report are generated for selecting;
PDF report generation unit: for generate PDF format report, generate program be divided into five assembly modules, respectively based on report Generation module, Reporting entities module, headerfooter module, model module and toolkit module;
Wherein: main report generation module definition global variable saves Document doc object, reports Writer pairs of inlet flow As the catalogue of output report, the title of output report, the path of resource file defines method load in LoadResources Document.xml template file makes variable save later in each corresponding variable of ConfigConstant class With load template_style.xml style content file is stored in variable, and load template.xml obtains content file simultaneously Creation report;
It is all model corresponding with configuration file in Reporting entities module, the parent of all models is all Report class, Table attached bag is for reading and storing the table content in resource file;Data in CusCell entity are used in In TableModel, used in addition table into report;Data in UtilCell entity, which are used in, to be merged in table;
Headerfooter module is divided into footer, and tri- components of header, pageNum, all headerfooters and the page number will be real Existing corresponding abstract class, the implementation method of implementation method and verso including recto;
Model module is divided into GraphModel for graphing;ParModel adds paragraph for loading, and replaces newline, Parameter setting section front distance is read, the style informations such as first trip retraction simultaneously read specific paragraph content information and are loaded into Report Page On;TabModel obtains corresponding style information and merges processing to table for adding table on the reporting page;
Tool-class is defined in toolkit module, copyEntity tool-class from map by Report class for being converted data to The operation of subclass;SortData tool-class is used in Merge Cells, is operated according to the weight sequencing of cell; DataMapping is used to the value in configuration file being converted to the available value of program;UnitConverter is the work of Conversion of measurement unit Has class;
HTML report generation unit: for generating html format report, template.xml configuration file is read, corresponding format turns Change html, css format into, picture turns Base64 coding, generates html editions static reports.
CN201811627389.7A 2018-12-28 2018-12-28 A kind of visualization report typesetting and automatic generation method and system based on XML Pending CN110032720A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811627389.7A CN110032720A (en) 2018-12-28 2018-12-28 A kind of visualization report typesetting and automatic generation method and system based on XML

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811627389.7A CN110032720A (en) 2018-12-28 2018-12-28 A kind of visualization report typesetting and automatic generation method and system based on XML

Publications (1)

Publication Number Publication Date
CN110032720A true CN110032720A (en) 2019-07-19

Family

ID=67235450

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811627389.7A Pending CN110032720A (en) 2018-12-28 2018-12-28 A kind of visualization report typesetting and automatic generation method and system based on XML

Country Status (1)

Country Link
CN (1) CN110032720A (en)

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110580330A (en) * 2019-09-03 2019-12-17 中建易通科技股份有限公司 File processing method for filling electronic form
CN111061858A (en) * 2019-11-22 2020-04-24 用友网络科技股份有限公司 Report generation method, report generation device, and computer-readable storage medium
CN111178027A (en) * 2019-12-09 2020-05-19 北京尊冠科技有限公司 Report generation system and method based on online creation template and online specified data
CN111814430A (en) * 2020-08-31 2020-10-23 南昌协达科技发展有限公司 Experimental result document processing method and device, storage medium and computer equipment
CN112035313A (en) * 2020-07-27 2020-12-04 珠海格力电器股份有限公司 Report generation method and device, template customization method and device, and monitoring system
CN112232032A (en) * 2020-09-04 2021-01-15 科航(苏州)信息科技有限公司 Method for automatically converting content style of docx document
CN112329408A (en) * 2020-11-05 2021-02-05 国网山东省电力公司泰安供电公司 Intelligent report reporting system of power grid regulation and control office system
CN112463611A (en) * 2020-12-01 2021-03-09 广州朗国电子科技有限公司 Test report generation method and device based on HTML5 and storage medium
CN112580321A (en) * 2020-12-29 2021-03-30 山东爱新卓尔智慧医疗技术有限公司 Inspection report automatic generation method and system based on dual-model designer
CN113254983A (en) * 2021-07-13 2021-08-13 卓尔智联(武汉)研究院有限公司 Data processing method and device
CN113255314A (en) * 2021-07-08 2021-08-13 广东省特种设备检测研究院中山检测院 Configurable report template system implementation method, electronic equipment and storage medium
CN113408271A (en) * 2021-06-16 2021-09-17 北京来也网络科技有限公司 Information extraction method, device, equipment and medium based on RPA and AI
CN115630625A (en) * 2022-09-22 2023-01-20 中科三清科技有限公司 Method and device for generating air quality report, storage medium and electronic equipment
CN115640095A (en) * 2022-12-12 2023-01-24 北京融和友信科技股份有限公司 Method for generating WEB front-end image by XML and method for generating XML by WEB front-end image
CN116522892A (en) * 2023-07-03 2023-08-01 广东省特种设备检测研究院中山检测院 Automatic generation method and generation system of report template
CN116702702A (en) * 2023-04-14 2023-09-05 北京雅昌艺术印刷有限公司 Automatic typesetting method and system based on XML

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060101046A1 (en) * 2004-11-10 2006-05-11 Microsoft Corporation Using a word processor with accounting data
CN101308490A (en) * 2008-04-28 2008-11-19 北京航空航天大学 Dynamic report generation method and platform
CN103020027A (en) * 2012-11-16 2013-04-03 北京北森测评技术有限公司 Method, device and system for generating dynamic report
CN103778234A (en) * 2014-01-26 2014-05-07 北京恒华伟业科技股份有限公司 Report form generating method and device
US8788931B1 (en) * 2000-11-28 2014-07-22 International Business Machines Corporation Creating mapping rules from meta data for data transformation utilizing visual editing
CN104239284A (en) * 2014-09-15 2014-12-24 广州市西美信息科技有限公司 Method and device for automatic image-text composition
CN106933862A (en) * 2015-12-30 2017-07-07 北京神州泰岳软件股份有限公司 A kind of method and apparatus for generating mail report
CN108132925A (en) * 2017-12-15 2018-06-08 中盈优创资讯科技有限公司 A kind of report file generation method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8788931B1 (en) * 2000-11-28 2014-07-22 International Business Machines Corporation Creating mapping rules from meta data for data transformation utilizing visual editing
US20060101046A1 (en) * 2004-11-10 2006-05-11 Microsoft Corporation Using a word processor with accounting data
CN101308490A (en) * 2008-04-28 2008-11-19 北京航空航天大学 Dynamic report generation method and platform
CN103020027A (en) * 2012-11-16 2013-04-03 北京北森测评技术有限公司 Method, device and system for generating dynamic report
CN103778234A (en) * 2014-01-26 2014-05-07 北京恒华伟业科技股份有限公司 Report form generating method and device
CN104239284A (en) * 2014-09-15 2014-12-24 广州市西美信息科技有限公司 Method and device for automatic image-text composition
CN106933862A (en) * 2015-12-30 2017-07-07 北京神州泰岳软件股份有限公司 A kind of method and apparatus for generating mail report
CN108132925A (en) * 2017-12-15 2018-06-08 中盈优创资讯科技有限公司 A kind of report file generation method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
殷琳: "一种所见即所得的结构化医疗文档系统设计与开发", 《中国优秀硕士学位论文全文数据库医药卫生科技辑》 *

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110580330B (en) * 2019-09-03 2023-04-07 中建易通科技股份有限公司 File processing method for filling electronic form
CN110580330A (en) * 2019-09-03 2019-12-17 中建易通科技股份有限公司 File processing method for filling electronic form
CN111061858A (en) * 2019-11-22 2020-04-24 用友网络科技股份有限公司 Report generation method, report generation device, and computer-readable storage medium
CN111178027A (en) * 2019-12-09 2020-05-19 北京尊冠科技有限公司 Report generation system and method based on online creation template and online specified data
CN112035313A (en) * 2020-07-27 2020-12-04 珠海格力电器股份有限公司 Report generation method and device, template customization method and device, and monitoring system
CN112035313B (en) * 2020-07-27 2022-03-04 珠海格力电器股份有限公司 Report generation method and device, template customization method and device, and monitoring system
CN111814430A (en) * 2020-08-31 2020-10-23 南昌协达科技发展有限公司 Experimental result document processing method and device, storage medium and computer equipment
CN112232032B (en) * 2020-09-04 2023-08-18 科航(苏州)信息科技有限公司 Automatic conversion method for content style of docx document
CN112232032A (en) * 2020-09-04 2021-01-15 科航(苏州)信息科技有限公司 Method for automatically converting content style of docx document
CN112329408A (en) * 2020-11-05 2021-02-05 国网山东省电力公司泰安供电公司 Intelligent report reporting system of power grid regulation and control office system
CN112463611A (en) * 2020-12-01 2021-03-09 广州朗国电子科技有限公司 Test report generation method and device based on HTML5 and storage medium
CN112580321A (en) * 2020-12-29 2021-03-30 山东爱新卓尔智慧医疗技术有限公司 Inspection report automatic generation method and system based on dual-model designer
CN113408271A (en) * 2021-06-16 2021-09-17 北京来也网络科技有限公司 Information extraction method, device, equipment and medium based on RPA and AI
CN113408271B (en) * 2021-06-16 2021-11-30 北京来也网络科技有限公司 Information extraction method, device, equipment and medium based on RPA and AI
CN113255314A (en) * 2021-07-08 2021-08-13 广东省特种设备检测研究院中山检测院 Configurable report template system implementation method, electronic equipment and storage medium
CN113254983A (en) * 2021-07-13 2021-08-13 卓尔智联(武汉)研究院有限公司 Data processing method and device
CN115630625A (en) * 2022-09-22 2023-01-20 中科三清科技有限公司 Method and device for generating air quality report, storage medium and electronic equipment
CN115640095A (en) * 2022-12-12 2023-01-24 北京融和友信科技股份有限公司 Method for generating WEB front-end image by XML and method for generating XML by WEB front-end image
CN116702702A (en) * 2023-04-14 2023-09-05 北京雅昌艺术印刷有限公司 Automatic typesetting method and system based on XML
CN116702702B (en) * 2023-04-14 2024-02-13 北京雅昌艺术印刷有限公司 Automatic typesetting method and system based on XML
CN116522892A (en) * 2023-07-03 2023-08-01 广东省特种设备检测研究院中山检测院 Automatic generation method and generation system of report template
CN116522892B (en) * 2023-07-03 2023-12-19 广东省特种设备检测研究院中山检测院 Automatic generation method and generation system of report template

Similar Documents

Publication Publication Date Title
CN110032720A (en) A kind of visualization report typesetting and automatic generation method and system based on XML
CN104281447B (en) The system and method that a kind of form is quickly generated and issued
KR101433936B1 (en) Method, system, and computer-readable medium for creating and laying out a graphic within an application program
André et al. Structured documents
US6826727B1 (en) Apparatus, methods, programming for automatically laying out documents
KR100725889B1 (en) User interface for creation and editing of variable data documents
US7313754B2 (en) Method and expert system for deducing document structure in document conversion
CN111428457B (en) Automatic formatting of data tables
CN101794280A (en) Form automatic generation method and system based on form template set
CN110543303B (en) Visual service platform
JP2006506713A (en) Iterative method for assigning elements and apparatus for assigning elements
CN102779118A (en) Paper typesetting method and system
CN105279301B (en) A kind of planning and designing method of customizable output
CN101149737A (en) Method for quickly establishing web form and automatically establishing corresponding data table in database through Microsoft Word
CN112214218A (en) High-performance and high-efficiency Sketch component library generation and management scheme and system
CN108986638A (en) A kind of method of sea chart thematic map rapid drafting
CN116468010A (en) Report generation method, device, terminal and storage medium
CN111274626B (en) Engineering investigation data processing system
CN113761859B (en) Electronic report definition method and device and electronic equipment
CN113076103A (en) Custom template generation method and system
JPH06251007A (en) Table data input device
CN104281575A (en) Webpage data obtaining method and template engine
CN104715030A (en) Method for printing bills and reports on preprinted form
CN109446638A (en) A kind of drawing creation system of non-structural components
CN108491173A (en) Across map sheet page-by-page printing method based on geographical PDF maps

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
AD01 Patent right deemed abandoned

Effective date of abandoning: 20240315

AD01 Patent right deemed abandoned