CN104657091A - Method for formatted printing of template data in tax control system - Google Patents

Method for formatted printing of template data in tax control system Download PDF

Info

Publication number
CN104657091A
CN104657091A CN201310589729.2A CN201310589729A CN104657091A CN 104657091 A CN104657091 A CN 104657091A CN 201310589729 A CN201310589729 A CN 201310589729A CN 104657091 A CN104657091 A CN 104657091A
Authority
CN
China
Prior art keywords
data
nominal value
value element
template
printing
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.)
Granted
Application number
CN201310589729.2A
Other languages
Chinese (zh)
Other versions
CN104657091B (en
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.)
Aisino Corp
Original Assignee
Aisino Corp
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 Aisino Corp filed Critical Aisino Corp
Priority to CN201310589729.2A priority Critical patent/CN104657091B/en
Publication of CN104657091A publication Critical patent/CN104657091A/en
Application granted granted Critical
Publication of CN104657091B publication Critical patent/CN104657091B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a method for formatted printing of template data in a tax control system. The method is used for achieving formatted printing of invoice face elements, especially invoice face elements displayed in a data mode. According to the method, a data type and a formatted printing mask are bound for each invoice face element displayed in the data mode, and the displaying states of the invoice face elements on the invoice faces are determined according to the data types and formatted masks which are bound. By means of the method for formatted printing of the template data, printing data and invoice printing templates are separated, invoice printing templates designing and modifying complexity is reduced, a developer does not need know a specific achievement mode of data display, can conveniently conduct formatted printing on the invoice face elements displayed in the data mode only by transferring data according to specified data types, and the data error rate in the printing process is reduced.

Description

A kind of template data formatted print method in taxation control system
Technical field
The present invention relates to a kind of providing data formatting Method of printing, a kind of template data formatted print method in taxation control system.
Background technology
At present, in taxation control system, need first format to be carried out to data when data print display on invoice and become character string, and then print in invoice nominal value.In traditional data-printing solution, all providing data formattings show after processing data by developer again, because developer understands not enough to invoice exemplary format, thus cause data hard coded in a program, error rate is increased, and amendment complexity is large.Therefore, mask data formatting component, realizes by the display format of the element determination data in invoice masterplate, reduces the degree of coupling of data and print file, and the complexity of reduction providing data formatting process and error rate are the developing direction of data-printing.
Summary of the invention
The invention provides a kind of template data formatted print method in taxation control system, in order to realize invoice nominal value element especially with Data Styles display nominal value element in invoice formatted print at par.
For achieving the above object, the invention provides a kind of template data formatted print method in taxation control system, comprising the following steps:
For all nominal value elements in printing invoice template bind a unique coding and a kind of Show Styles respectively, and by node text corresponding respectively with each nominal value element in the coding of binding and display style information write printing template file;
Extract in printing invoice template all with the nominal value element of Data Styles display, for each nominal value element with Data Styles display binds a kind of data type and a format mask respectively, and by node text corresponding respectively with each nominal value element in the data type of binding and format mask information write printing template file, according to each with the coding organizing data files of the nominal value element binding of Data Styles display, wherein, data file comprises each with the value of nominal value element self of Data Styles display and the coding of binding thereof;
Printing template file is sent to print module, first template analytical function in print module reads comprise in printing template file all not with the coding corresponding to nominal value element of Data Styles display and Show Styles, by the printf in print module, all nominal value elements do not shown with Data Styles is plotted in the correspondence position of invoice nominal value;
Template analytical function in print module reads and eachly in printing template file extracts coding of its binding, data type and format mask with the node text of the nominal value element of Data Styles display;
According to each with the coding ergodic data file of the nominal value element binding of Data Styles display, obtain each with the value of the nominal value element self of Data Styles display;
According to each with the data type of the nominal value element binding of Data Styles display, each value with the nominal value element self of Data Styles display is forced the data type being converted into binding;
According to each with the format mask of the nominal value element binding of Data Styles display, the value corresponding with the nominal value element of Data Styles display after transforming is forced to be converted into the string format of specifying by each;
Format output function in print module resolves each string format corresponding with the nominal value element of Data Styles display, and resolving information is passed to the printf in print module;
Printf draws this nominal value element according to each resolving information corresponding with the nominal value element of Data Styles display at the correspondence position of invoice nominal value, has drawn all with the printing namely completing invoice after the nominal value element of Data Styles display.
Optionally, in default situations, each is character string type with the data type of the nominal value element of Data Styles display.
Optionally, the data type of nominal value element at least comprises: integer, single-precision floating point type, double-precision floating point type, date-time type, character string type.
Optionally, when the data type of pawn ticket surface element is not any one in integer, single-precision floating point type, double-precision floating point type, date-time type, character string type, by nominal value element by text process.
Optionally, format mask is string format and comprises a pair { }, wherein, for needing the content of format in { }.
Optionally, in format mask, C represents currency style, and D represents 10 systems, and thousand points of positions split in N expression comma, # representative digit placeholder, and 0 represents 0 placeholder, and Y represents a year placeholder, and M represents a moon placeholder, and D represents a day placeholder.
Optionally, format mask uses identifier and bit wide to represent non-character symbol, and wherein, identifier is so that ' [' starts, and be two upper case characters, bit wide is two digits.
Optionally, when formaing mask and not comprising non-character symbol, resolving information comprises the drafting position of nominal value element and draws form; When format mask comprise non-character symbol time, resolving information comprise nominal value element drafting position, draw form, non-character symbol occupy-place information and draw function.
Optionally, draw form to comprise the length of drawing area, width, drafting coordinate, draw the alignment thereof of line style and font, level and the vertical direction adopted, the initial drafting position that the occupy-place information of non-character symbol comprises non-character symbol and the bit wide occupied.
Optionally, when read certain with the format mask corresponding to nominal value element of Data Styles display for sky time, this nominal value element is not for further processing.
In taxation control system provided by the invention, print data is separated with printing invoice template by template data formatted print method, reduce the complexity of printing invoice stencil design and amendment, make developer without the need to understanding the specific implementation of data display, only need can carry out formatted print to the nominal value element shown with Data Styles easily according to the data type delivery data of specifying, reduce the error rate of data in print procedure.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the process flow diagram of template data formatted print method in the taxation control system of one embodiment of the invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not paying the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Fig. 1 is the process flow diagram of template data formatted print method in the taxation control system of one embodiment of the invention, and as shown in the figure, this Method of printing comprises the following steps:
S110: for all nominal value elements in printing invoice template bind a unique coding and a kind of Show Styles respectively, and by node text corresponding respectively with each nominal value element in the coding of binding and display style information write printing template file;
Wherein, nominal value element can be divided into the nominal value element of Data Styles display with not with the large class of the nominal value element two of Data Styles display according to its Show Styles.Because the nominal value element shown with Data Styles is associated with concrete data, therefore all need to import concrete numerical value into when each printing; Then do not show with patterns such as picture, straight line, word and check boxes with the nominal value element of Data Styles display, be not associated with concrete data in print procedure, therefore directly can print according to the Show Styles of its setting when printing.In addition, in printing template file, there is a node text for each nominal value Elemental partition, in order to the record information relevant with this node, the node text entry all properties of node.
S120: extract in printing invoice template all with the nominal value element of Data Styles display, for each nominal value element with Data Styles display binds a kind of data type and a format mask respectively, and by node text corresponding respectively with each nominal value element in the data type of binding and format mask information write printing template file, according to each with the coding organizing data files of the nominal value element binding of Data Styles display, wherein, data file comprises each with the value of nominal value element self of Data Styles display and the coding of binding thereof;
Wherein, in default situations, each data type with the nominal value element of Data Styles display is character string type (string type), also the data type of the nominal value element shown with Data Styles can be bound integer (int type), single-precision floating point type (float type), double-precision floating point type (double type), date-time type (datetime type) or character string type (string type), when the data type of the nominal value element shown with Data Styles be not above any one time, then pressed text process.
In addition, with the format mask of the nominal value element binding of Data Styles display for string format, format mask starts with any character, any character ends up, and comprise a pair { }, for needing the content of format in { }, character, special character and non-character symbol (in computer character code database non-existent symbol) that other are fixing outside { }, can also be comprised.Wherein, in format mask, use C to represent currency style, D represents 10 systems, and thousand points of positions split in N expression comma, # representative digit placeholder, and 0 represents 0 placeholder, and Y represents a year placeholder, and M represents a moon placeholder, and D represents a day placeholder.Non-character symbol in format mask uses identifier and bit wide to represent, wherein, identifier is so that ' [' starts, and be two upper case characters, bit wide is two digits.
Such as: " ########0.00} ", " ########0.00} dollar ", " ########0.00} $ " and all can be used as format mask, wherein, " # " represents placeholder, and " 0 " represents necessary placeholder, and ". " represents radix point.When comprising non-character symbol as hexagonal snowflake symbol in format mask, can use as " [AA02] " represents, now formaing mask and can be: " ########0.00} [AA02] ".Wherein " AA " represents hexagonal snowflake symbol, and " 02 " represents that the bit wide of hexagonal snowflake symbol is two bytes, is also that the space that hexagonal snowflake symbol occupies is identical with the space that a Chinese character occupies.
S130: printing template file is sent to print module, first template analytical function in print module reads comprise in printing template file all not with the coding corresponding to nominal value element of Data Styles display and Show Styles, by the printf in print module, all nominal value elements do not shown with Data Styles is plotted in the correspondence position of invoice nominal value;
Wherein, print not with Data Styles display nominal value element time without the need to read data files, the printing of corresponding element can be completed in the relevant position of invoice nominal value according to this nominal value attribute of an element of the node text entry of its correspondence.
S140: template analytical function in print module reads and eachly in printing template file extracts coding of its binding, data type and format mask with the node text of the nominal value element of Data Styles display;
Wherein, by each value that can obtain corresponding nominal value element with the coding bound in the node text of the nominal value element of Data Styles display from data file; Value corresponding for each nominal value element can be forced to be converted into the data type of specifying with the data type of binding in the node text of the nominal value element of Data Styles display by each; Further value corresponding for each nominal value element after pressure conversion can be converted into the data required for formatted print by each with the format mask bound in the node text of the nominal value element of Data Styles display.
S150: according to each with the coding ergodic data file of the nominal value element binding of Data Styles display, obtains each with the value of the nominal value element self of Data Styles display;
S160: according to each with the data type of the nominal value element binding of Data Styles display, each value with the nominal value element self of Data Styles display is forced the data type being converted into binding;
S170: according to each with the format mask of the nominal value element binding of Data Styles display, forces the value corresponding with the nominal value element of Data Styles display after transforming to be converted into the string format of specifying by each;
Wherein, when read certain with the format mask corresponding to nominal value element of Data Styles display for sky time, this nominal value element is not for further processing.
Illustrate, as data a1=123 in data file, the data type of binding is double type, when formaing mask and being respectively " { ########0.00} ", " { ########0.00} dollar ", " { ########0.00} $ ", " { ########0.00} [AA02] ", the string format after conversion is respectively " 123.00 ", " 123.00 dollars ", " 123.00 $ ", " 123.00 [AA02] ".
S180: the format output function in print module resolves each string format corresponding with the nominal value element of Data Styles display, and resolving information is passed to the printf in print module;
Wherein, when formaing mask and not comprising non-character symbol, resolving information comprises the drafting position of nominal value element and draws form; When format mask comprise non-character symbol time, resolving information comprise nominal value element drafting position, draw form, non-character symbol occupy-place information and draw function.Wherein, draw form to comprise the length of drawing area, width, drafting coordinate, draw the information such as alignment thereof of line style and font, level and the vertical direction adopted, the initial drafting position that the occupy-place information of non-character symbol comprises non-character symbol and the bit wide occupied.
Such as, when formaing mask and being " { ########0.00} [AA02] ", format output function is split into " AA " and " 02 " two parts, by searching drafting function draw () drawing the hexagonal snowflake symbol corresponding with " AA " in print module when resolving " [AA02] "; Then " 02 " is converted into numerical value 2, the implication of this numerical value 2 is the hexagonal snowflake symbol that will draw and occupies two bytes, the namely size of a Chinese character;
S190: printf draws this nominal value element according to each resolving information corresponding with the nominal value element of Data Styles display at the correspondence position of invoice nominal value, has drawn all with the printing namely completing invoice after the nominal value element of Data Styles display.
Wherein, when formaing mask and comprising non-character symbol, printf first draws the part not comprising non-character symbol be transformed by format mask, and reserve certain white space in order to printing non-character symbol according to the non-character symbol occupy-place information in resolving information in the relevant position of print area, after the part not comprising non-character symbol is completed, drafting function draw () that namely printf calls in resolving information draws non-character symbol at above-mentioned reserved white space, when formaing mask and comprising several different non-character symbol, due to the drafting function difference that often kind of non-character symbol is corresponding, now need repeatedly to call the drafting that different drafting functions just can complete nominal value element.
In taxation control system provided by the invention, print data is separated with printing invoice template by template data formatted print method, reduce the complexity of printing invoice stencil design and amendment, make developer without the need to understanding the specific implementation of data display, only need can carry out formatted print to the nominal value element shown with Data Styles easily according to the data type delivery data of specifying, reduce the error rate of data in print procedure.
One of ordinary skill in the art will appreciate that: accompanying drawing is the schematic diagram of an embodiment, the module in accompanying drawing or flow process might not be that enforcement the present invention is necessary.
One of ordinary skill in the art will appreciate that: the module in the device in embodiment can describe according to embodiment and be distributed in the device of embodiment, also can carry out respective change and be arranged in the one or more devices being different from the present embodiment.The module of above-described embodiment can merge into a module, also can split into multiple submodule further.
Last it is noted that above embodiment is only in order to illustrate technical scheme of the present invention, be not intended to limit; Although with reference to previous embodiment to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in previous embodiment, or carries out equivalent replacement to wherein portion of techniques feature; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the spirit and scope of embodiment of the present invention technical scheme.

Claims (10)

1. a template data formatted print method in taxation control system, is characterized in that, comprise the following steps:
For all nominal value elements in printing invoice template bind a unique coding and a kind of Show Styles respectively, and by node text corresponding respectively with each nominal value element in the coding of binding and display style information write printing template file;
Extract in described printing invoice template all with the nominal value element of Data Styles display, for each described nominal value element with Data Styles display binds a kind of data type and a format mask respectively, and the data type of binding and format mask information are write node text corresponding respectively with each nominal value element in described printing template file, according to each with the coding organizing data files of the nominal value element binding of Data Styles display, wherein, described data file comprises each with the value of nominal value element self of Data Styles display and the coding of binding thereof;
Described printing template file is sent to print module, first template analytical function in described print module reads comprise in described printing template file all not with the coding corresponding to nominal value element of Data Styles display and Show Styles, by the printf in described print module, all nominal value elements do not shown with Data Styles is plotted in the correspondence position of invoice nominal value;
Template analytical function in described print module read in described printing template file each with Data Styles display nominal value element node text and extract its binding coding, data type and format mask;
According to each with the coding ergodic data file of the nominal value element binding of Data Styles display, obtain each with the value of the nominal value element self of Data Styles display;
According to each with the data type of the nominal value element binding of Data Styles display, each value with the nominal value element self of Data Styles display is forced the data type being converted into binding;
According to each with the format mask of the nominal value element binding of Data Styles display, the value corresponding with the nominal value element of Data Styles display after transforming is forced to be converted into the string format of specifying by each;
Format output function in described print module resolves each string format corresponding with the nominal value element of Data Styles display, and resolving information is passed to the printf in print module;
Printf draws this nominal value element according to each resolving information corresponding with the nominal value element of Data Styles display at the correspondence position of invoice nominal value, has drawn all with the printing namely completing invoice after the nominal value element of Data Styles display.
2. template data formatting scheme in taxation control system according to claim 1, is characterized in that, in default situations, each is character string type with the data type of the nominal value element of Data Styles display.
3. template data formatting scheme in taxation control system according to claim 1, is characterized in that, described data type at least comprises: integer, single-precision floating point type, double-precision floating point type, date-time type, character string type.
4. template data formatting scheme in taxation control system according to claim 3, it is characterized in that, when the data type of pawn ticket surface element is not any one in integer, single-precision floating point type, double-precision floating point type, date-time type, character string type, by nominal value element by text process.
5. template data formatting scheme in taxation control system according to claim 1, is characterized in that, described format mask is string format and comprises a pair { }, wherein, for needing the content of format in { }.
6. template data formatting scheme in taxation control system according to claim 5, it is characterized in that, in described format mask, C represents currency style, and D represents 10 systems, thousand points of positions split in N expression comma, # representative digit placeholder, 0 represents 0 placeholder, and Y represents a year placeholder, M represents a moon placeholder, and D represents a day placeholder.
7. template data formatting scheme in taxation control system according to claim 5, is characterized in that, described format mask uses identifier and bit wide to represent non-character symbol, wherein, identifier is so that ' [' starts, and be two upper case characters, bit wide is two digits.
8. template data formatting scheme in taxation control system according to claim 7, is characterized in that, when formaing mask and not comprising non-character symbol, described resolving information comprises the drafting position of nominal value element and draws form; When format mask comprise non-character symbol time, described resolving information comprise nominal value element drafting position, draw form, non-character symbol occupy-place information and draw function.
9. template data formatting scheme in taxation control system according to claim 8, it is characterized in that, described drafting form comprises the length of drawing area, width, drafting coordinate, draws the alignment thereof of line style and font, level and the vertical direction adopted, the initial drafting position that the occupy-place information of described non-character symbol comprises non-character symbol and the bit wide occupied.
10. template data formatting scheme in taxation control system according to claim 1, is characterized in that, when read certain with the format mask corresponding to nominal value element of Data Styles display for sky time, this nominal value element is not for further processing.
CN201310589729.2A 2013-11-20 2013-11-20 Template data formats Method of printing in a kind of taxation control system Active CN104657091B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310589729.2A CN104657091B (en) 2013-11-20 2013-11-20 Template data formats Method of printing in a kind of taxation control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310589729.2A CN104657091B (en) 2013-11-20 2013-11-20 Template data formats Method of printing in a kind of taxation control system

Publications (2)

Publication Number Publication Date
CN104657091A true CN104657091A (en) 2015-05-27
CN104657091B CN104657091B (en) 2018-11-13

Family

ID=53248288

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310589729.2A Active CN104657091B (en) 2013-11-20 2013-11-20 Template data formats Method of printing in a kind of taxation control system

Country Status (1)

Country Link
CN (1) CN104657091B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105843575A (en) * 2016-03-23 2016-08-10 百度在线网络技术(北京)有限公司 Information display method, device and system
CN110210455A (en) * 2019-06-18 2019-09-06 石家庄捷弘科技有限公司 A kind of printing content format extracting method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030058469A1 (en) * 2001-09-26 2003-03-27 International Business Machines Corporation Method and apparatus for printing XML directly using a formatting template
CN101174350A (en) * 2007-11-15 2008-05-07 北大方正集团有限公司 Bill processing equipment and method
CN102156741A (en) * 2011-04-16 2011-08-17 武钢集团昆明钢铁股份有限公司 Custom dynamic report system and implementation method thereof
CN102830947A (en) * 2012-08-13 2012-12-19 南京莱斯信息技术股份有限公司 Report printing control implemented based on report printing template format
CN102866985A (en) * 2012-09-28 2013-01-09 用友软件股份有限公司 Data formatting device and method for on-line analytical processing system
CN103116500A (en) * 2013-03-11 2013-05-22 北京首钢自动化信息技术有限公司 Method and device for structural body definition and structure output

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030058469A1 (en) * 2001-09-26 2003-03-27 International Business Machines Corporation Method and apparatus for printing XML directly using a formatting template
CN101174350A (en) * 2007-11-15 2008-05-07 北大方正集团有限公司 Bill processing equipment and method
CN102156741A (en) * 2011-04-16 2011-08-17 武钢集团昆明钢铁股份有限公司 Custom dynamic report system and implementation method thereof
CN102830947A (en) * 2012-08-13 2012-12-19 南京莱斯信息技术股份有限公司 Report printing control implemented based on report printing template format
CN102866985A (en) * 2012-09-28 2013-01-09 用友软件股份有限公司 Data formatting device and method for on-line analytical processing system
CN103116500A (en) * 2013-03-11 2013-05-22 北京首钢自动化信息技术有限公司 Method and device for structural body definition and structure output

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105843575A (en) * 2016-03-23 2016-08-10 百度在线网络技术(北京)有限公司 Information display method, device and system
CN110210455A (en) * 2019-06-18 2019-09-06 石家庄捷弘科技有限公司 A kind of printing content format extracting method
CN110210455B (en) * 2019-06-18 2022-03-01 石家庄捷弘科技有限公司 Printing content formatting extraction method

Also Published As

Publication number Publication date
CN104657091B (en) 2018-11-13

Similar Documents

Publication Publication Date Title
Reid Scribe: A document specification language and its compiler
US6721451B1 (en) Apparatus and method for reading a document image
CN101308488B (en) Document stream type information processing method based on format document and device therefor
CN104239284A (en) Method and device for automatic image-text composition
CN103336690A (en) HTML (Hypertext Markup Language) 5-based text-element drawing method and device
CN101430714B (en) Content structuring process method and system based on model
CN102043762A (en) Method and device for comparing layouts
CN104461519A (en) Method for dynamically producing flow chart and controlling authority
CN100585561C (en) Method for clipping relocatable ELF files in embedded system
CN104516862A (en) Method and system for selecting and reading coded format of target document
CN103885999A (en) Indexing template for defining XBRL (extensible business reporting language) and business correspondence
CN104598560A (en) Display method and display system for multifont characters of embedded system
CN109375962A (en) The implementation method of chinese character mixing output display based on embedded OS
CN104657091A (en) Method for formatted printing of template data in tax control system
CN101017479A (en) Method for automatically identifying digital document type page
CN103246753A (en) Method for generating entity metadata model according to database structure
CN105488471A (en) Character pattern recognition method and device
CN102880690A (en) Method for simplifying character library of electronic book, and processing device for electronic book
US20200026749A1 (en) Pdf extraction with text-based key
CN104536947A (en) Layout document processing method and device
US20050200913A1 (en) Systems and methods for identifying complex text in a presentation data stream
CN102110108A (en) Method and device for processing galley proof file
CN106406560A (en) Method and system for outputting vector fonts of mechanical engineering characters in desktop operation system
CN104021134A (en) Method for modifying and converting font file, and system thereof
CN105373519B (en) A kind of editing device and method of Technical symbol

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant