CN105760172A - Statement generation method based on itext - Google Patents

Statement generation method based on itext Download PDF

Info

Publication number
CN105760172A
CN105760172A CN201610118053.2A CN201610118053A CN105760172A CN 105760172 A CN105760172 A CN 105760172A CN 201610118053 A CN201610118053 A CN 201610118053A CN 105760172 A CN105760172 A CN 105760172A
Authority
CN
China
Prior art keywords
pdf
template
data
itext
method based
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
CN201610118053.2A
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.)
Inspur Software Group Co Ltd
Original Assignee
Inspur Software Group 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 Inspur Software Group Co Ltd filed Critical Inspur Software Group Co Ltd
Priority to CN201610118053.2A priority Critical patent/CN105760172A/en
Publication of CN105760172A publication Critical patent/CN105760172A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • G06F8/22Procedural

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a report generation method based on itext, and belongs to the field of computer application. The method comprises the following steps: A. generating a PDF template by using office software, and adding a PDF form to the template; B. the XML file is taken as a data definition file and comprises three basic elements: PDF template name, SQL statement and mapping relation; C. and interpreting the data definition file, filling data into a PDF template by using itext according to the data corresponding relation, and generating a final PDF report. Compared with the prior art, the method has lower cost, can provide a flexible report generation mode, and has good popularization and application values.

Description

A kind of report form generation method based on itext
Technical field
The present invention relates to computer application field, specifically a kind of report form generation method based on itext.
Background technology
Form is the function that various office system, business management system all can use.For the system that some are bigger, the business demand of form is more, and function is loaded down with trivial details, it is desirable to select software more ripe on market.These software functions are powerful, but expense is also significantly high accordingly, and restriction is a lot.Report capability is required to be not as system how by some, adopts these softwares virtually to add the development cost of system.
IText is mono-project of website sourceforge of famous open source code, is for generating PDF document java class libraries.It is possible not only to generate the document of PDF or rtf by iText, and can be pdf document by XML, Html file translations.Support text, form, the operation of figure, in that context it may be convenient to combine with Servlet.
PDF supports interactive form, supports the interactive elements such as input frame, multiselect frame, radio box, button, hyperlink, and supports javascript language, list content is carried out dynamic operation in list.The list of PDF has similar function with the list of HTML.
Summary of the invention
The technical assignment of the present invention is for above-mentioned the deficiencies in the prior art, it is provided that a kind of less costly, is provided that again the report form generation method based on itext of report generation mode flexibly.
The report-building tool designed in the process of the present invention, its output is the form of a complete PDF, and input is a PDF template designed and a Data Definitions File.
The technical assignment of the present invention realizes in the following manner: a kind of report form generation method based on itext, comprises the following steps:
The design of A, PDF template
Utilize office software to generate a PDF template, and increase PDF list to template, i.e. the exhibition method of data with PDF template definition;
B, the writing of Data Definitions File
Using XML file as Data Definitions File, including three kinds of basic elements: PDF template name, SQL statement and mapping relations, namely really define form with XML file;
C, generation form
Explain Data Definitions File, perform SQL statement, according to data corresponding relation itext, data are filled in PDF template, generate final PDF form.
As preferably, the authority of the report data that the mode of certificate signature ensures to ultimately generate can be adopted.
As preferably, step A is:
Utilize word office software to generate a PDF template, then revise PDF template with adobeacrobat or FoxitPhantom instrument, increase PDF list to template;
Or:
The PDF template with list is directly generated with Openoffice.
In step B, described mapping relations refer to the corresponding relation data mapping relations of data base querying data and PDF template input frame, including single-value mapping and list mapping.
Every mapping relations can connect with equal sign, and the equal sign left side is input frame title, is data another names on the right of equal sign.Call and be made up of the row name of SQL statement another name and SQL, connect with period (.).The available comma segmentation of multiple relations.
Compared with prior art, the report form generation method based on itext of the present invention has the advantages that
(1) pdf document is digitally signed by available digital certificate, it is ensured that the reliability of data and non repudiation;
(2) having only to when designing new form redesign PDF template and Data Definitions File, report program is constant;
(3) less costly, flexible and convenient to use.
Accompanying drawing explanation
Accompanying drawing 1 is the flow chart that report-building tool of the present invention generates PDF form.
Detailed description of the invention
The report form generation method based on itext of the present invention is described in detail below with specific embodiment with reference to Figure of description.
Embodiment:
As shown in Figure 1, the report form generation method based on itext of the present invention comprises the following steps:
The design of A, PDF template
Utilize the office softwares such as word or openoffice to generate a PDF template, then by instrument amendment PDF templates such as adobeacrobat or FoxitPhantom, increase PDF list to template.Openoffice can directly generate the PDF template with list.Add input frame in the relevant position of template and name, finally in input frame, filling corresponding contents according to name.
B, the writing of Data Definitions File
Described Data Definitions File is an XML file, completely defines a form, and it includes three kinds of basic elements: PDF template name, SQL statement and mapping relations.One typical Data Definitions File is as follows:
The src attribute of Pdfmodel element specifies the PDF template name that this form uses.The multiple SQL statement of Sqls element definition, each SQL statement sql tag representation, the another name of data that this SQL query goes out is specified with name attribute, this another name uses in the map.Mappings element definition data mapping relations, including two class mapping relations, single-value mapping and list mapping.Mapping relations refer to the corresponding relation of data base querying data and PDF template input frame.Every relation equal sign connects, and the equal sign left side is input frame title, is data another names on the right of equal sign.Call and be made up of the row name of SQL statement another name and SQL, connect with period (.).Multiple relation commas are split.
C, generation PDF form
Explain Data Definitions File, perform SQL statement, according to data corresponding relation itext, data are filled in PDF template, generate final PDF form, and adopt the mode of certificate signature to ensure the authority of data.

Claims (4)

1. the report form generation method based on itext, it is characterised in that comprise the following steps:
The design of A, PDF template
Utilize office software to generate a PDF template, and increase PDF list to template;
B, the writing of Data Definitions File
Using XML file as Data Definitions File, including three kinds of basic elements: PDF template name, SQL statement and mapping relations;
C, generation form
Explain Data Definitions File, according to data corresponding relation itext, data are filled in PDF template, generate final PDF form.
2. the report form generation method based on itext according to claim 1, it is characterised in that adopt the mode of certificate signature to ensure the authority of the report data ultimately generated.
3. the report form generation method based on itext according to claim 1 and 2, it is characterised in that step A is:
Utilize word office software to generate a PDF template, then revise PDF template with adobeacrobat or FoxitPhantom instrument, increase PDF list to template;
Or:
The PDF template with list is directly generated with Openoffice.
4. the report form generation method based on itext according to claim 3, it is characterised in that in step B:
Described mapping relations refer to the corresponding relation data mapping relations of data base querying data and PDF template input frame, including single-value mapping and list mapping.
CN201610118053.2A 2016-03-02 2016-03-02 Statement generation method based on itext Pending CN105760172A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610118053.2A CN105760172A (en) 2016-03-02 2016-03-02 Statement generation method based on itext

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610118053.2A CN105760172A (en) 2016-03-02 2016-03-02 Statement generation method based on itext

Publications (1)

Publication Number Publication Date
CN105760172A true CN105760172A (en) 2016-07-13

Family

ID=56332373

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610118053.2A Pending CN105760172A (en) 2016-03-02 2016-03-02 Statement generation method based on itext

Country Status (1)

Country Link
CN (1) CN105760172A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106681978A (en) * 2017-03-09 2017-05-17 山东浪潮商用系统有限公司 User-defined tax analysis monitoring report generation method
CN106776498A (en) * 2016-12-09 2017-05-31 山东浪潮商用系统有限公司 A kind of method that data export as PDF
CN107491430A (en) * 2017-08-28 2017-12-19 南京农纷期电子商务有限公司 Utilize the method for pdf kits and SPEL expression formulas filling pdf
CN107818501A (en) * 2017-03-03 2018-03-20 平安医疗健康管理股份有限公司 Calculating method and device
CN113723063A (en) * 2021-09-02 2021-11-30 四川启睿克科技有限公司 Method for converting RTF (real time function) into HTML (hypertext markup language) and realizing effect on PDF (Portable document Format) file

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103577729A (en) * 2013-10-31 2014-02-12 北京锐安科技有限公司 Method for stamping electronic seal on PDF (portable document format) file
CN105138504A (en) * 2015-09-07 2015-12-09 北京恒华伟业科技股份有限公司 Report generation method and report engine

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103577729A (en) * 2013-10-31 2014-02-12 北京锐安科技有限公司 Method for stamping electronic seal on PDF (portable document format) file
CN105138504A (en) * 2015-09-07 2015-12-09 北京恒华伟业科技股份有限公司 Report generation method and report engine

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
丁振凡 等: "利用iText包实现Java报表打印", 《微型机与应用》 *
王丽萍 等: "基于iText的PDF报表设计", 《电脑知识与技术》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106776498A (en) * 2016-12-09 2017-05-31 山东浪潮商用系统有限公司 A kind of method that data export as PDF
CN107818501A (en) * 2017-03-03 2018-03-20 平安医疗健康管理股份有限公司 Calculating method and device
CN106681978A (en) * 2017-03-09 2017-05-17 山东浪潮商用系统有限公司 User-defined tax analysis monitoring report generation method
CN107491430A (en) * 2017-08-28 2017-12-19 南京农纷期电子商务有限公司 Utilize the method for pdf kits and SPEL expression formulas filling pdf
CN107491430B (en) * 2017-08-28 2021-01-08 南京农纷期电子商务有限公司 Method for filling pdf by pdf toolkit and SPEL expression
CN113723063A (en) * 2021-09-02 2021-11-30 四川启睿克科技有限公司 Method for converting RTF (real time function) into HTML (hypertext markup language) and realizing effect on PDF (Portable document Format) file
CN113723063B (en) * 2021-09-02 2023-06-13 四川启睿克科技有限公司 Method for converting RTF (real time transport format) into HTML (hypertext markup language) and realizing effect in PDF (portable document format) file

Similar Documents

Publication Publication Date Title
CN105760172A (en) Statement generation method based on itext
CN102982010B (en) The method and apparatus extracting file structure
US7610548B1 (en) Method and apparatus for applying locale behaviors to regions of a form
US8930824B2 (en) Facilitating propagation of user interface patterns or themes
EP3423957A1 (en) Improved construction of database schema models for database systems and rest api's
CN107145480B (en) Method for compiling XBRL report based on Word
US20010014900A1 (en) Method and system for separating content and layout of formatted objects
US20180095604A1 (en) Rendering components based on screen size
CN103744891A (en) Method and system for data query
US20150066977A1 (en) Method and system for managing digital resources
CN102722372A (en) Method and system for automatically generating codes through classification and configuration
US10437926B2 (en) System and method to generate a data-rich template
CN110874367A (en) Visualization method and device for structured query language statement
CN110347984B (en) Policy page changing method and device, computer equipment and storage medium
US20130132927A1 (en) Business content authoring and distribution
US11349902B2 (en) System and method to standardize and improve implementation efficiency of user interface content
CN101430684A (en) Method and apparatus for mutual conversion between Chinese work office software document and documents with other format
US20090327323A1 (en) Integrating Data Resources by Generic Feed Augmentation
CN106407172A (en) XML (Extensible Markup Language)-based report generating method
CN100433023C (en) Method and system for drawing schematic diagram design document
CN104375814A (en) Generation method and device of an interface document
US20100122188A1 (en) Method and device for editing an object represented in a web page
CN102637290B (en) Operating system based on browser and compiling method
CN104598636A (en) Complex document separating and organizing method and complex document automatic generating method
CN111177234A (en) Device and method for rapidly processing document type data file

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20160713