CN111208957A - Payroll printing method - Google Patents

Payroll printing method Download PDF

Info

Publication number
CN111208957A
CN111208957A CN201911372643.8A CN201911372643A CN111208957A CN 111208957 A CN111208957 A CN 111208957A CN 201911372643 A CN201911372643 A CN 201911372643A CN 111208957 A CN111208957 A CN 111208957A
Authority
CN
China
Prior art keywords
payroll
width
column
field
line
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
CN201911372643.8A
Other languages
Chinese (zh)
Other versions
CN111208957B (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 CN201911372643.8A priority Critical patent/CN111208957B/en
Publication of CN111208957A publication Critical patent/CN111208957A/en
Application granted granted Critical
Publication of CN111208957B publication Critical patent/CN111208957B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/1253Configuration of print job parameters, e.g. using UI at the client
    • G06F3/1257Configuration of print job parameters, e.g. using UI at the client by using pre-stored settings, e.g. job templates, presets, print styles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1202Dedicated interfaces to print systems specifically adapted to achieve a particular effect
    • G06F3/1203Improving or facilitating administration, e.g. print management
    • G06F3/1205Improving or facilitating administration, e.g. print management resulting in increased flexibility in print job configuration, e.g. job settings, print requirements, job tickets
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/1242Image or content composition onto a page
    • G06F3/1243Variable data printing, e.g. document forms, templates, labels, coupons, advertisements, logos, watermarks, transactional printing, fixed content versioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/12Accounting
    • G06Q40/125Finance or payroll
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Abstract

The invention discloses a payroll printing method, which comprises the following steps: configuring a head table variable and a tail table variable of the payroll bar to generate column information of a payroll table; configuring printing basic information; automatically generating a payroll template according to column information of a payroll table; acquiring payroll table data, assembling table head and table tail variables of the payroll table data, filling the table head and table tail variables into a payroll bar template, and finishing printing of payroll bars; the method solves the problem that payroll in enterprise informatization needs to be repeatedly designed, automatically generates a payroll template according to all field information of a form obtained from a payroll form, and avoids the design work of the payroll template; and the payroll configuration is added, so that a user can conveniently select a data style according to a specific service, and the consistency of the printed payroll data style and the form style of the work account table in the page is ensured.

Description

Payroll printing method
Technical Field
The invention relates to the technical field of information, in particular to a payroll printing method.
Background
In enterprise management type software, there is generally a payroll management module, which includes a payroll printing function, but payroll printing contents of each enterprise may be different, so that, conventionally, a payroll template is designed each time according to the payroll printing contents, and printing is performed according to the template. However, the method has the disadvantages that the operation of enterprise users is inconvenient, and the users need to redesign each enterprise, so that the labor cost of the enterprise is increased, and the working efficiency is reduced.
Disclosure of Invention
In order to solve the problems that the existing payroll printing method in the background technology is inconvenient for enterprise users to operate and each enterprise user needs to redesign when in use, the invention provides a payroll printing method, which acquires all field information of a form from a payroll form, automatically generates a payroll template and avoids the design work of the payroll template, and the payroll printing method comprises the following steps:
configuring a head table variable and a tail table variable of the payroll bar to generate column information of a payroll table;
configuring printing basic information;
automatically generating a payroll template according to column information of a payroll table;
and acquiring payroll table data, assembling a table head variable and a table tail variable of the payroll table data, filling the table head variable and the table tail variable into a payroll template, and finishing the printing of payroll.
Further, the method for configuring the head and tail variables of the payroll comprises the following steps:
the table head variable items and the table tail variable items are configured in a table mode, and the table data is column information of all columns of a payroll table;
the columns of the table comprise a field name column, a display column and a conversion column;
the field name column is used for setting field names of column information; the display column is used for determining the displayed field; the line feed column is used to determine whether a field is line fed.
Further, the printing basic information includes paper information, printing direction and margin;
the paper information includes A3, a4, B5, and a custom printing paper type;
the printing direction comprises a transverse direction and a longitudinal direction;
the margins include upper, lower, left, and right margins.
Further, the method for automatically generating the payroll template according to the column information of the payroll table comprises the following steps:
acquiring header information in the column information;
calculating the width of the printing content of the payroll according to the header information;
calculating fields displayed in each row of the payroll table, and putting the fields into a row object array;
calculating the width of each column of the payroll table, and putting the width of each column into a column width array;
acquiring a preset payroll template, and generating table contents of the payroll template according to the row object array, the column width array and the preset payroll template;
setting field column merging;
and setting data source information and a block filling function to generate a payroll template.
Further, the method for calculating the width of the print content of the payroll comprises the following steps:
judging whether printing basic information is configured or not, and if the printing basic information is not configured, setting the width of the printing content of the payroll to be a preset width;
if the printing basic information is configured, extracting a paper type parameter, and setting the width and the height of the paper according to the paper type parameter;
extracting printing direction parameters, wherein if the printing direction parameters are transverse printing, the paper height is used as the width of printing paper, and if the printing direction parameters are longitudinal printing, the paper width is the width of the printing paper;
and extracting a left margin parameter and a right margin parameter, and subtracting the left margin parameter and the right margin parameter from the width of the printing paper to obtain the width of the printing content of the payroll.
Further, the method for calculating the field displayed in each row of the payroll table comprises the following steps:
creating a row object and a row object array, wherein the row object is used for storing the field objects in row units, and the row object array is used for storing all the field objects;
circulating all fields of the payroll table and judging whether to place the current field into a row object;
if the current field is placed in the row object, judging whether the current field is the last column;
if the current field is the last column, setting the width of the current field as the sum of the width of the printing content of the payroll and the width of the field stored in the current line object;
and setting the end position of the current field as the width of the printing content of the payroll, and adding the current field to a line object.
Further, if the current field is not the last column, setting the ending position of the current field to be the sum of the widths of the stored fields of the current line object plus the width of the current field, and adding the current field to the line object.
Further, if the current field cannot be placed in the line object, judging whether the current line object is empty;
if the line object is empty, setting the width of the current field and the end position of the current field as the width of the printing content of the payroll;
adding the current field to a line object;
and adding the line object to the line object array, and creating a new line object.
Further, if the line object is not empty, extracting the last field of the current line object, and setting the width of the current field as the sum of the width of the printing content of the payroll minus the width of the stored field of the current line object except the last field;
judging whether the width of the current field is larger than the width of the printing content of the payroll;
if the width of the current field is larger than the width of the printing content of the payroll, setting the width of the current field and the end position as the width of the printing content of the payroll, adding the current field to a row object, adding the row object to a row object array, and creating a new row object array;
otherwise, the current field is added directly to the line object.
Further, the method for determining whether to place the current field in the line object includes:
if the current line object is empty, putting the current field into the line object;
if the current line object is not empty, adding the sum of the field widths stored in the current line object to the current field width to obtain a width sum, if the width sum is larger than the width of the printing content of the payroll, not putting the current field into the line object, and if not, putting the current field into the line object.
Further, the method for calculating the width of each column of the payroll table comprises the following steps:
subtracting the length of the row object array from the total number of all fields of the payroll table to obtain the cycle number;
and sequentially circulating the payroll table according to the circulation times to obtain the width of each column, and adding the width of each column to the column width array.
Furthermore, in each cycle, traversing the row object array, acquiring a first unconfirmed field of each row, and placing the unconfirmed field into a pre-created first array;
after traversing the row object array, judging whether the first array is empty, and if the first array is empty, exiting the current cycle;
if the first array is not empty, traversing the first array, extracting a field with the minimum field ending position value in the first array, setting the field as a confirmed field, and subtracting the sum of all column widths of the current row object from the minimum field ending position value to obtain a new column width;
and if the new column width is not equal to 0, putting the new column width into a column width array.
Further, if the current circulating column is the last column, the sum of the width of the printing content of the payroll and the widths of all the other columns of the current line object is used as the width of the last column;
and if the width of the last row is not equal to 0, putting the width of the last row into a row width array.
Further, the method for generating the table content of the payroll template according to the row object array, the column width array and the preset payroll template includes:
the preset payroll template is a default payroll template and contains basic template information;
the preset payroll template is in an XML format, and the XML format is converted into a document object;
selecting a table node object of the document object;
circulating the column width array, adding a column object in the table node object, and setting the column width;
generating title and header information, and acquiring the number of the title and the header lines;
circulating the line object array, and generating a header line and a data line according to the header and the header information;
generating table tail information;
and setting a format of a penultimate line and a format of a last line, processing the separation line display at the tail part, and generating a payroll template.
Further, the method for generating the header and the header information and acquiring the number of the header and the header lines includes:
acquiring title information, and if the title information is empty, not adding a title line;
if the title information is not null, adding a line in the table node object for displaying the title line;
and acquiring a configured header variable item, judging whether the header variable item has a field to be displayed, if not, not adding a header information line, otherwise, judging the line number according to the line feed information.
Further, the method for generating the header line includes:
setting a payroll table to start from the next line of the title line and the header information line according to the obtained line number of the title line and the header information line;
circulating the line object array, taking out a line object each time, circulating the field object in the line object, taking out the end position of the previous field of the current field, calculating the position of the column of the end position of the previous field according to the column width array, and adding 1 to the position to be used as the serial number of the start column of the current field;
setting title characters according to the title of the field to obtain a title line;
and setting data characters according to the data of the fields, and setting an access formula to obtain data lines.
Further, the method for merging the set field columns includes:
column merging of header rows and header information rows is set;
a circular line object array, which is used for circulating all fields of the current line object for each line object;
calculating the position of the current field ending column according to the column width array;
setting the starting position and the ending position of the combination and the parallel;
and setting column combination of the table tail.
The invention has the beneficial effects that: the technical scheme of the invention provides a payroll printing method, which automatically generates a payroll template according to all field information of a form obtained from a payroll form, thereby avoiding the design work of the payroll template; and the payroll configuration is added, so that a user can conveniently select a data style according to a specific service, and the consistency of the printed payroll data style and the form style of the work account table in the page is ensured.
Drawings
A more complete understanding of exemplary embodiments of the present invention may be had by reference to the following drawings in which:
FIG. 1 is a flow chart of a method of payroll printing according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for automatically generating payroll templates based on column information of a payroll table, in accordance with an embodiment of the present invention.
Detailed Description
The exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, however, the present invention may be embodied in many different forms and is not limited to the embodiments described herein, which are provided for complete and complete disclosure of the present invention and to fully convey the scope of the present invention to those skilled in the art. The terminology used in the exemplary embodiments illustrated in the accompanying drawings is not intended to be limiting of the invention. In the drawings, the same units/elements are denoted by the same reference numerals.
Unless otherwise defined, terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. Further, it will be understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and will not be interpreted in an idealized or overly formal sense.
FIG. 1 is a flow chart of a method of payroll printing according to an embodiment of the present invention; as shown in fig. 1, the method includes:
step 110, configuring a head table variable and a tail table variable of a payroll table, and generating column information of the payroll table;
setting a payroll printing configuration page for setting a head variable item and a tail variable item of the payroll, wherein the head variable item and the tail variable item are respectively used for configuring the head variable item and the tail variable item of the payroll by two tabs;
the table head variable items and the table tail variable items are configured in a table display mode, and the table data is column information of all columns of a payroll table;
the columns of the table comprise a field name column, a display column and a conversion column;
the field name column is used for setting field names of column information;
the default display column and the line feed column are not checked, a user can determine which fields are displayed by checking the display column, and whether line feed is performed after the fields are determined by checking the line feed column.
Step 120, configuring printing basic information;
a printing setting page is set for configuring printing basic information;
the printing basic information comprises paper information, a printing direction and a margin;
the paper information comprises A3, A4, B5 and other types which can be selected, and the type of the printing paper can be customized, and the width and the height of the paper are set; the printing direction comprises a transverse direction and a longitudinal direction; the margins include upper, lower, left, and right margins.
Step 130, automatically generating a payroll template according to column information of a payroll table;
FIG. 2 is a flow diagram of a method for automatically generating payroll templates based on column information of a payroll table, in accordance with an embodiment of the present invention; as shown in fig. 2, the method includes:
step 131, acquiring header information in the List information of the payroll table, wherein the type of the header information is an array of List < Map >, the variable Map stores the List information of the payroll table, and the variable Map is firstly converted into an array of List < Column >, and Column is a Column type;
step 132, calculating the width of the print content of the payroll according to the header information, wherein the method for calculating the width of the print content of the payroll comprises:
judging whether printing basic information is configured or not, and if the printing basic information is not configured, setting the width of the printing content of the payroll to be a default preset width;
if the printing basic information is configured, extracting paper type parameters, and setting the width and the height of the paper according to the paper type parameters, wherein the unit is millimeter; if the paper type is the self-defined paper type, directly extracting the width and the height of the printing paper from the printing basic information;
extracting printing direction parameters, wherein if the printing direction parameters are transverse printing, the paper height is used as the width of printing paper, and if the printing direction parameters are longitudinal printing, the paper width is the width of the printing paper;
and extracting a left margin parameter and a right margin parameter, and subtracting the left margin parameter and the right margin parameter from the width of the printing paper to obtain the width of the printing content of the payroll, wherein the unit is millimeter.
Step 133, calculating the field displayed in each row of the payroll table, and putting the field into a row object array; the method for calculating the field to be displayed in each line comprises the following steps:
creating a List type array as a row object, wherein the row object is used for storing the field objects in row units, and creating a List < Column > type row object array which is used for storing all the field objects;
circulating all fields of the payroll table and judging whether to place the current field into a row object;
if the current field is placed in the row object, judging whether the current field is the last column;
if the current field is the last column, setting the width of the current field as the sum of the width of the printing content of the payroll and the width of the field stored in the current line object; setting the end position of the current field as the width of the printing content of the payroll, and adding the current field to a line object; and if the current field is not the last column, setting the end position of the current field as the sum of the widths of the stored fields of the current line object plus the width of the current field, and adding the current field to the line object.
If the current field can not be put into the line object, judging whether the current line object is empty or not;
if the line object is empty, setting the width of the current field and the end position of the current field as the width of the printing content of the payroll; adding the current field to a line object; adding the line object to a line object array, and creating a new line object;
if the line object is not empty, extracting the last field of the current line object, and setting the width of the current field as the sum of the width of the printing content of the payroll minus the width of the stored field of the current line object except the last field;
judging whether the width of the current field is larger than the width of the printing content of the payroll; if the width of the current field is larger than the width of the printing content of the payroll, setting the width of the current field and the end position as the width of the printing content of the payroll, adding the current field to a row object, adding the row object to a row object array, and creating a new row object array; otherwise, the current field is added directly to the line object.
The method for judging whether to place the current field into the line object comprises the following steps:
if the current line object is empty, putting the current field into the line object; if the current line object is not empty, adding the sum of the field widths stored in the current line object to the current field width to obtain a width sum, if the width sum is larger than the width of the printing content of the payroll, not putting the current field into the line object, and if not, putting the current field into the line object.
Step 134, calculating the width of each column of the payroll table, and putting the width of each column into a column width array;
the method for calculating the width of each column of the payroll table comprises the following steps:
a column width array is created for storing the width of each column, which is used to set the width of the column when generating the payroll printing template. Subtracting the length of the storage row object array from the total number of the fields to serve as cycle times, wherein the number of the columns does not exceed the cycle times at most, and then sequentially cycling the payroll table to obtain the width of the columns and adding the width of the columns into the column width array;
in each loop, first creating a first array of List < Column > type for holding unconfirmed fields; then traversing the row object array, acquiring a first unconfirmed field of each row, and placing the unconfirmed field into the first array;
after traversing the row object array, judging whether the first array is empty, if so, indicating that no field needs to be confirmed, and directly exiting the current cycle; if the first array is not empty, traversing the first array, extracting a field with the minimum field ending position value in the first array, setting the field as a confirmed field, and subtracting the sum of all column widths of the current row object from the minimum field ending position value to obtain a new column width; and if the new column width is not equal to 0, putting the new column width into a column width array.
In addition, if the current circulating column is the last column, the sum of the width of the printing content of the payroll and the width of all the other columns of the current line object is used as the width of the last column; if the width of the last row is not equal to 0, putting the width of the last row into a row width array;
at this point, the acquisition of column width data is completed.
Step 135, acquiring a preset payroll template, and generating table contents of the payroll template according to the row object array, the column width array and the preset payroll template;
the preset payroll template is a default template, only comprises the most basic template information, has the content in an XML format, and is converted into a Document object;
selecting a table node object from the document object, circulating the column width array, adding a column object in the table node object, and setting the column width;
acquiring title information, and if the title information is empty, not adding a title line; if the title information is not null, adding a line in the table node object for displaying the title line; acquiring a configured header variable item, judging whether the header variable item has a field to be displayed or not, if not, not adding a header information line, otherwise, judging the line number according to the line feed information, and acquiring a title and the header line number;
setting a payroll table to start from the next line of the title line and the header information line according to the obtained line number of the title line and the header information line; circulating the line object array, taking out one line object each time, and respectively generating a title line and a data line; generating table tail information; and setting a format of a penultimate line and a format of a last line, processing the separation line display at the tail part, and generating a payroll template.
The method for generating the title line comprises the following steps: circulating the field objects in the row objects, taking out the end position of the previous field of the current field, calculating the position of the column of the end position of the previous field according to the column width array, and adding 1 to the position to be used as the sequence number of the start column of the current field; setting title characters according to the title of the field to obtain a title line;
and the method for generating the data lines is consistent with the header lines, the data characters are set according to the data of the fields, and meanwhile, an access formula is set to obtain the data lines.
In addition, the method for calculating the sequence number of the column where the field ending position is located according to the field ending position and the column width array comprises the following steps:
and a loop column width array for summing the column widths, and when the summed result is equal to the field end position, exiting the loop to obtain the sequence number of the field end column.
Step 136, setting field column combination;
column merging of header rows and header information rows is set; a circular line object array, which is used for circulating all fields of the current line object for each line object; calculating the position of the current field ending column according to the column width array; setting the starting position and the ending position of the combination and the parallel; and setting column combination of the table tail.
And 137, setting data source information and a block filling function to generate a payroll template.
And 140, acquiring payroll table data, assembling table head and table tail variables of the payroll table data, filling the table head and table tail variables into a payroll template, and finishing printing of payroll.
And filling the acquired form data of the payroll table, the table head variable items and the table tail variable items into a payroll template to finish the printing of payroll.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the disclosure may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise. Reference to step numbers in this specification is only for distinguishing between steps and is not intended to limit the temporal or logical relationship between steps, which includes all possible scenarios unless the context clearly dictates otherwise.
Moreover, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the disclosure and form different embodiments. For example, any of the embodiments claimed in the claims can be used in any combination.
Various component embodiments of the disclosure may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. The present disclosure may also be embodied as device or system programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present disclosure may be stored on a computer-readable medium or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the disclosure, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The disclosure may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several systems, several of these systems may be embodied by one and the same item of hardware.
The foregoing is directed to embodiments of the present disclosure, and it is noted that numerous improvements, modifications, and variations may be made by those skilled in the art without departing from the spirit of the disclosure, and that such improvements, modifications, and variations are considered to be within the scope of the present disclosure.

Claims (17)

1. A method of payroll printing, the method comprising:
configuring a head table variable and a tail table variable of the payroll bar to generate column information of a payroll table;
configuring printing basic information;
automatically generating a payroll template according to column information of a payroll table;
and acquiring payroll table data, assembling a table head variable and a table tail variable of the payroll table data, filling the table head variable and the table tail variable into a payroll template, and finishing the printing of payroll.
2. The method of claim 1, wherein the method of configuring head and tail variables of the payroll comprises:
the table head variable items and the table tail variable items are configured in a table mode, and the table data is column information of all columns of a payroll table;
the columns of the table comprise a field name column, a display column and a conversion column;
the field name column is used for setting field names of column information; the display column is used for determining the displayed field; the line feed column is used to determine whether a field is line fed.
3. The method of claim 1, wherein:
the printing basic information comprises paper information, a printing direction and a margin;
the paper information includes A3, a4, B5, and a custom printing paper type;
the printing direction comprises a transverse direction and a longitudinal direction;
the margins include upper, lower, left, and right margins.
4. The method of claim 1, wherein the method of automatically generating a payroll template from column information of a payroll table comprises:
acquiring header information in the column information;
calculating the width of the printing content of the payroll according to the header information;
calculating fields displayed in each row of the payroll table, and putting the fields into a row object array;
calculating the width of each column of the payroll table, and putting the width of each column into a column width array;
acquiring a preset payroll template, and generating table contents of the payroll template according to the row object array, the column width array and the preset payroll template;
setting field column merging;
and setting data source information and a block filling function to generate a payroll template.
5. The method of claim 4, wherein the method of calculating payroll print width comprises:
judging whether printing basic information is configured or not, and if the printing basic information is not configured, setting the width of the printing content of the payroll to be a preset width;
if the printing basic information is configured, extracting a paper type parameter, and setting the width and the height of the paper according to the paper type parameter;
extracting printing direction parameters, wherein if the printing direction parameters are transverse printing, the paper height is used as the width of printing paper, and if the printing direction parameters are longitudinal printing, the paper width is the width of the printing paper;
and extracting a left margin parameter and a right margin parameter, and subtracting the left margin parameter and the right margin parameter from the width of the printing paper to obtain the width of the printing content of the payroll.
6. The method of claim 4, wherein calculating the fields displayed in each row of the payroll table comprises:
creating a row object and a row object array, wherein the row object is used for storing the field objects in row units, and the row object array is used for storing all the field objects;
circulating all fields of the payroll table and judging whether to place the current field into a row object;
if the current field is placed in the row object, judging whether the current field is the last column;
if the current field is the last column, setting the width of the current field as the sum of the width of the printing content of the payroll and the width of the field stored in the current line object;
and setting the end position of the current field as the width of the printing content of the payroll, and adding the current field to a line object.
7. The method of claim 6, wherein:
and if the current field is not the last column, setting the end position of the current field as the sum of the widths of the stored fields of the current line object plus the width of the current field, and adding the current field to the line object.
8. The method of claim 6, wherein:
if the current field can not be put into the line object, judging whether the current line object is empty or not;
if the line object is empty, setting the width of the current field and the end position of the current field as the width of the printing content of the payroll;
adding the current field to a line object;
and adding the line object to the line object array, and creating a new line object.
9. The method of claim 8, wherein:
if the line object is not empty, extracting the last field of the current line object, and setting the width of the current field as the sum of the width of the printing content of the payroll minus the width of the stored field of the current line object except the last field;
judging whether the width of the current field is larger than the width of the printing content of the payroll;
if the width of the current field is larger than the width of the printing content of the payroll, setting the width of the current field and the end position as the width of the printing content of the payroll, adding the current field to a row object, adding the row object to a row object array, and creating a new row object array;
otherwise, the current field is added directly to the line object.
10. The method of claim 6, wherein the determining whether to place the current field in the line object comprises:
if the current line object is empty, putting the current field into the line object;
if the current line object is not empty, adding the sum of the field widths stored in the current line object to the current field width to obtain a width sum, if the width sum is larger than the width of the printing content of the payroll, not putting the current field into the line object, and if not, putting the current field into the line object.
11. The method of claim 4, wherein the method of calculating the width of each column of the payroll table comprises:
subtracting the length of the row object array from the total number of all fields of the payroll table to obtain the cycle number;
and sequentially circulating the payroll table according to the circulation times to obtain the width of each column, and adding the width of each column to the column width array.
12. The method of claim 11, wherein:
in each cycle, traversing the row object array, acquiring a first unconfirmed field of each row, and placing the unconfirmed field into a pre-created first array;
after traversing the row object array, judging whether the first array is empty, and if the first array is empty, exiting the current cycle;
if the first array is not empty, traversing the first array, extracting a field with the minimum field ending position value in the first array, setting the field as a confirmed field, and subtracting the sum of all column widths of the current row object from the minimum field ending position value to obtain a new column width;
and if the new column width is not equal to 0, putting the new column width into a column width array.
13. The method of claim 12, wherein:
if the current circulating column is the last column, the sum of the width of the printing content of the payroll and the width of all the other columns of the current line object is used as the width of the last column;
and if the width of the last row is not equal to 0, putting the width of the last row into a row width array.
14. The method of claim 4, wherein the method for generating the table contents of the payroll template according to the row object array, the column width array and a preset payroll template comprises:
the preset payroll template is a default payroll template and contains basic template information;
the preset payroll template is in an XML format, and the XML format is converted into a document object;
selecting a table node object of the document object;
circulating the column width array, adding a column object in the table node object, and setting the column width;
generating title and header information, and acquiring the number of the title and the header lines;
circulating the line object array, and generating a header line and a data line according to the header and the header information;
generating table tail information;
and setting a format of a penultimate line and a format of a last line, processing the separation line display at the tail part, and generating a payroll template.
15. The method of claim 14, wherein the method of generating header and header information and obtaining the number of header and header lines comprises:
acquiring title information, and if the title information is empty, not adding a title line;
if the title information is not null, adding a line in the table node object for displaying the title line;
and acquiring a configured header variable item, judging whether the header variable item has a field to be displayed, if not, not adding a header information line, otherwise, judging the line number according to the line feed information.
16. The method of claim 15, wherein the generating the headline comprises:
setting a payroll table to start from the next line of the title line and the header information line according to the obtained line number of the title line and the header information line;
circulating the line object array, taking out a line object each time, circulating the field object in the line object, taking out the end position of the previous field of the current field, calculating the position of the column of the end position of the previous field according to the column width array, and adding 1 to the position to be used as the serial number of the start column of the current field;
setting title characters according to the title of the field to obtain a title line;
and setting data characters according to the data of the fields, and setting an access formula to obtain data lines.
17. The method of claim 4, wherein the method for setting the field column merge comprises:
column merging of header rows and header information rows is set;
a circular line object array, which is used for circulating all fields of the current line object for each line object;
calculating the position of the current field ending column according to the column width array;
setting the starting position and the ending position of the combination and the parallel;
and setting column combination of the table tail.
CN201911372643.8A 2019-12-27 2019-12-27 Payroll printing method Active CN111208957B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911372643.8A CN111208957B (en) 2019-12-27 2019-12-27 Payroll printing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911372643.8A CN111208957B (en) 2019-12-27 2019-12-27 Payroll printing method

Publications (2)

Publication Number Publication Date
CN111208957A true CN111208957A (en) 2020-05-29
CN111208957B CN111208957B (en) 2023-08-25

Family

ID=70789409

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911372643.8A Active CN111208957B (en) 2019-12-27 2019-12-27 Payroll printing method

Country Status (1)

Country Link
CN (1) CN111208957B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112508663A (en) * 2020-11-05 2021-03-16 社宝信息科技(上海)有限公司 Safe and convenient electronic payroll management method and system
CN112895748A (en) * 2021-01-22 2021-06-04 山西青峰软件股份有限公司 Method and system for realizing notice printing

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040093355A1 (en) * 2000-03-22 2004-05-13 Stinger James R. Automatic table detection method and system
JP2005004236A (en) * 2003-06-09 2005-01-06 Canon Inc Print control unit
US20100153834A1 (en) * 2006-11-29 2010-06-17 Wingark Technologies, Inc. Business form creating system, network system using the same, and business form creating method
CN101894099A (en) * 2010-06-29 2010-11-24 北京科技大学 Report template customization method
CN101908039A (en) * 2010-06-29 2010-12-08 北京科技大学 Report template customizing system
CN102467353A (en) * 2010-11-19 2012-05-23 金蝶软件(中国)有限公司 Document printing method and computer
CN103646065A (en) * 2013-12-05 2014-03-19 国家电网公司 Object-oriented business report form module establishing method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040093355A1 (en) * 2000-03-22 2004-05-13 Stinger James R. Automatic table detection method and system
JP2005004236A (en) * 2003-06-09 2005-01-06 Canon Inc Print control unit
US20100153834A1 (en) * 2006-11-29 2010-06-17 Wingark Technologies, Inc. Business form creating system, network system using the same, and business form creating method
CN101894099A (en) * 2010-06-29 2010-11-24 北京科技大学 Report template customization method
CN101908039A (en) * 2010-06-29 2010-12-08 北京科技大学 Report template customizing system
CN102467353A (en) * 2010-11-19 2012-05-23 金蝶软件(中国)有限公司 Document printing method and computer
CN103646065A (en) * 2013-12-05 2014-03-19 国家电网公司 Object-oriented business report form module establishing method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112508663A (en) * 2020-11-05 2021-03-16 社宝信息科技(上海)有限公司 Safe and convenient electronic payroll management method and system
CN112895748A (en) * 2021-01-22 2021-06-04 山西青峰软件股份有限公司 Method and system for realizing notice printing

Also Published As

Publication number Publication date
CN111208957B (en) 2023-08-25

Similar Documents

Publication Publication Date Title
CN111208957B (en) Payroll printing method
CN101840316B (en) Print management apparatus, and printer system
CN109657220A (en) The online editing method, apparatus and electronic equipment of PDF document
CN117420974B (en) Thermal printer page mode control method and related device
CN108875853A (en) The processing method and processing device of data label printing
CN108319578B (en) Method for generating medium for data recording
CN111159982A (en) Document editing method and device, electronic equipment and computer readable storage medium
CN104999813A (en) Printing equipment, and control method and device for same
CN102375716A (en) Variable data printing method and system
CN111240609A (en) Data printing method and device, electronic equipment and storage medium
CN110221790B (en) Universal printing method and apparatus, analyzer, and storage medium
CN110232164B (en) Internationalized processing method and device and computer storage medium
CN114872449B (en) Label printing method and device and electronic equipment
CN116384356A (en) Method, device, equipment and medium for creating form row of OFD file
CN107977459B (en) Report generation method and device
US10740539B2 (en) Page structure adjustments
CN114115864A (en) Interface generation method and device and electronic equipment
US9146905B2 (en) Generating page-oriented data for printing dynamic documents
CN115146602A (en) Method and device for batch generation of infrared thermal image analysis reports based on template
CN112882665A (en) Method and device for generating printing template, electronic equipment and storage medium
CN114037493A (en) Method and system for generating bidding document
CN109949865B (en) Sequence interception method and device and electronic equipment
JPH10198741A (en) Table data processor and its program recording medium
US9075776B2 (en) Document processing apparatus, document processing method, and program
US9201857B2 (en) Finding multiple field groupings in semi-structured documents

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
GR01 Patent grant
GR01 Patent grant