CN111208957B - Payroll printing method - Google Patents

Payroll printing method Download PDF

Info

Publication number
CN111208957B
CN111208957B CN201911372643.8A CN201911372643A CN111208957B CN 111208957 B CN111208957 B CN 111208957B CN 201911372643 A CN201911372643 A CN 201911372643A CN 111208957 B CN111208957 B CN 111208957B
Authority
CN
China
Prior art keywords
payroll
width
column
field
row
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.)
Active
Application number
CN201911372643.8A
Other languages
Chinese (zh)
Other versions
CN111208957A (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

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

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

Description

Payroll printing method
Technical Field
The application relates to the technical field of information, in particular to a payroll printing method.
Background
Typically, a payroll management module is included in the enterprise management type software, which includes payroll printing functions, but payroll printing contents of each enterprise may be different, so it is conventional practice to design a payroll template according to the payroll printing contents each time, and print according to the template. However, the method has the defects of being inconvenient for enterprise users to operate, and simultaneously, 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 problem that the existing payroll printing method in the background technology is inconvenient for enterprise users to operate and needs to be redesigned when each enterprise user uses, the application 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 the table head and the table tail variables of the payroll table to generate column information of the payroll table;
configuring printing basic information;
automatically generating a payroll template according to the column information of the payroll table;
and acquiring payroll table data, assembling the table head and the table tail variables of the payroll table data, filling the table head and the table tail variables into a payroll template, and finishing printing of payroll.
Further, the method for configuring the header and the footer variables of the payroll includes:
the table head variable items and the table tail variable items are configured in a table mode, and the table data are column information of all columns of the payroll table;
the columns of the table comprise a field name column, a display column and a line feed column;
the field name column is used for setting the field name of the column information; the display column is used to determine the displayed field; the wrap column is used to determine whether a field wraps.
Further, the printing basic information includes paper information, a printing direction and a margin;
the paper information comprises A3, A4, B5 and custom printing paper types;
the printing direction includes a lateral 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 printing content width of the payroll according to the header information;
calculating the fields displayed on 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 combination;
setting data source information and block filling number function to generate wage strip template.
Further, the method for calculating the width of the payroll printing content comprises the following steps:
judging whether to configure the printing basic information, if not, 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 a printing direction parameter, wherein if the printing direction parameter is transverse printing, the paper height is used as the width of printing paper, and if the printing direction parameter is 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 on 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 field objects in row units, and the row object array is used for storing all field objects;
all fields of the payroll table are circulated, and whether the current field is put into a row object is judged;
if the current field is put into the row object, judging whether the current field is the last column or not;
if the current field is the last column, setting the width of the current field as the sum of the width of the payroll printing content minus the width of the current line object stored field;
setting the end position of the current field as the width of the payroll printing content, and adding the current field to a row object.
Further, 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 row object plus the width of the current field, and adding the current field to the row object.
Further, if the current field cannot be put into the row object, judging whether the current row object is empty or not;
if the line object is empty, setting the current field width and the current field end position as the payroll printing content width;
adding the current field to a row object;
the row object is added to the row object array to create a new row object.
Further, if the line object is not empty, extracting the last field of the current line object, and setting the current field width as the sum of the payroll printing content width minus the current line object stored field width except the last field;
judging whether the current field width is larger than the payroll printing content width;
if the current field width is larger than the payroll printing content width, setting the current field width and the ending position as the payroll printing content width, 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, directly adding the current field to the row object.
Further, the method for judging whether to put the current field into the row 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 widths of the stored fields of the current line object to the width of the current field to obtain the sum of the widths, if the sum of the widths is larger than the width of the printing content of the payroll, the current field is not put into the line object, otherwise, the current field is put 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 circulation times;
and sequentially cycling the payroll table according to the cycle times to obtain each row width, and adding each row width to a row width array.
Further, traversing the row object array in each cycle, acquiring a first unacknowledged field of each row, and placing the unacknowledged field into a pre-created first array;
after traversing the row object array, judging whether the first array is empty or not, and if the first array is empty, exiting the current circulation;
if the first array is not empty, traversing the first array, extracting a field with the minimum field end 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 end position value to obtain a new column width;
and if the new column width is not equal to 0, placing the new column width into a column width array.
Further, if the current circulation column is the last column, subtracting the sum of all column widths of the rest of the current line objects from the printing content width of the wage strip to be used as the last column width;
and if the last column width is not equal to 0, putting the last column width into a column 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 comprises the following steps:
the preset payroll template is a default payroll template and comprises basic template information;
the preset wage strip 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;
the column width array is circulated, column objects are added in the table node objects, and column widths are set;
generating header and table header information, and acquiring the header and table header line numbers;
cycling the row object array, and generating a title row and a data row according to the title and header information;
generating table tail information;
setting the format of the penultimate row and the format of the last row, processing the separation line display at the tail part, and generating a payroll template.
Further, the method for generating header and header information and obtaining the number of header and header lines includes:
acquiring title information, and if the title information is empty, not adding a title line;
if the header information is non-empty, adding one row for displaying the header row in the table node object;
and acquiring the configured header variable item, judging whether the header variable item has a field to be displayed, if not, not adding header information lines, otherwise, judging the number of lines according to line feed information.
Further, the method for generating the generated title line comprises the following steps:
setting a payroll table from the next line of the title line and the header information line according to the acquired line numbers of the title line and the header information line;
the row object array is circulated, one row object is taken out each time, the field objects in the row object are circulated, the ending position of the previous field of the current field is taken out, the position of the column where the ending position of the previous field is located is calculated according to the column width array, and the position is added with 1 to be used as the sequence number of the starting column of the current field;
setting title characters according to the title of the field to obtain a title line;
setting data characters according to the data of the fields, and setting a fetch formula to obtain data rows.
Further, the method for setting field column merging includes:
setting column combination of a header line and a header information line;
a loop row object array which loops all fields of the current row object for each row object;
calculating the position of the ending column of the current field according to the column width array;
setting a start position and an end position which are parallel;
column merging of the table tail is set.
The beneficial effects of the application are as follows: according to the technical scheme, the payroll printing method is provided, and the payroll template is automatically generated according to all field information of the form obtained from the payroll form, so that the design work of the payroll template is avoided; and the payroll configuration is increased, so that a user can conveniently select a data style according to specific business, and the printed payroll data style is ensured to be consistent with the form style of the work account table in the page.
Drawings
Exemplary embodiments of the present application may be more completely understood in consideration of the following drawings:
FIG. 1 is a flow chart of a payroll printing method according to an embodiment of the present application;
FIG. 2 is a flow chart of a method for automatically generating payroll templates based on column information of payroll tables in accordance with embodiments of the present application.
Detailed Description
The exemplary embodiments of the present application will now be described with reference to the accompanying drawings, however, the present application may be embodied in many different forms and is not limited to the examples described herein, which are provided to fully and completely disclose the present application and fully convey the scope of the application 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 application. In the drawings, like elements/components are referred to by like reference numerals.
Unless otherwise indicated, terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. In addition, it will be understood that terms 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 payroll printing method according to an embodiment of the present application; as shown in fig. 1, the method includes:
step 110, configuring the table head and the table tail variables of the payroll table to generate column information of the payroll table;
the payroll printing configuration page is used for setting the head variable and the tail variable of the payroll, and comprises two tabs respectively used for configuring the head variable and the tail variable of the payroll;
the table head variable items and the table tail variable items are configured in a table display mode, and the table data are column information of all columns of the payroll table;
the columns of the table comprise a field name column, a display column and a line feed column;
the field name column is used for setting the field name of the column information;
the default display column and the line feed column are not checked, the user can determine which fields are displayed by checking the display column, and can determine whether line feed is performed after the fields by checking the line feed column.
Step 120, configuring printing basic information;
a print setting page is set for configuring print basic information;
the printing basic information comprises paper information, a printing direction and a margin;
the paper information comprises types such as A3, A4, B5 and the like which can be selected, the type of the printing paper can be customized, and the width and the height of the paper can be set; the printing direction includes a lateral direction and a longitudinal direction; the margins include upper, lower, left and right margins.
Step 130, automatically generating a payroll template according to the column information of the payroll table;
FIG. 2 is a flow chart of a method for automatically generating payroll templates based on column information of payroll tables in accordance with embodiments of the present application; as shown in fig. 2, the method includes:
step 131, obtaining header information in the table Column information of the payroll table, wherein the type of the header information is an array of List < Map > type, the variable Map stores Column information of the payroll table, the variable Map is firstly converted into an array of List < Column > type, and Column is a Column type;
step 132, calculating the payroll printing content width according to the header information, wherein the method for calculating the payroll printing content width comprises the following steps:
judging whether to configure the printing basic information, if not, setting the printing content width of the payroll as a default preset width;
extracting paper type parameters if the printing basic information is configured, 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 a custom paper type, directly extracting the width and the height of the printing paper from the printing basic information;
extracting a printing direction parameter, wherein if the printing direction parameter is transverse printing, the paper height is used as the width of printing paper, and if the printing direction parameter is 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 in millimeter.
Step 133, calculating the fields displayed on each row of the payroll table, and putting the fields into a row object array; the method for calculating the field to be displayed for each row comprises the following steps:
creating a List type array as a row object, wherein the row object is used for storing field objects in row units, and creating a List < Column > type row object array, and the row object array is used for storing all field objects;
all fields of the payroll table are circulated, and whether the current field is put into a row object is judged;
if the current field is put into the row object, judging whether the current field is the last column or not;
if the current field is the last column, setting the width of the current field as the sum of the width of the payroll printing content minus the width of the current line object stored field; setting the end position of a current field as the width of the printing content of the payroll, and adding the current field to a line object; if the current field is not the last column, setting the ending 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 cannot be placed in the line object, judging whether the current line object is empty or not;
if the line object is empty, setting the current field width and the current field end position as the payroll printing content width; adding the current field to a row object; adding the row object to a row object array to create a new row object;
if the line object is not empty, extracting the last field of the current line object, and setting the current field width as the sum of the payroll printing content width minus the current line object stored field width except the last field;
judging whether the current field width is larger than the payroll printing content width; if the current field width is larger than the payroll printing content width, setting the current field width and the ending position as the payroll printing content width, 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, directly adding the current field to the row object.
The method for judging whether the current field is placed in the row 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 widths of the stored fields of the current line object to the width of the current field to obtain the sum of the widths, if the sum of the widths is larger than the width of the printing content of the payroll, the current field is not put into the line object, otherwise, the current field is put 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 each column width, and the column width is set using the array in generating a payroll printing template. Subtracting the length of the object array of the storage row from the total number of the fields to serve as the circulation times, wherein the maximum number of columns does not exceed the circulation times, and then sequentially circulating the payroll table to obtain the widths of the columns, and adding the widths into the column width array;
in each cycle, a first array of List < Column > type is first created for storing unacknowledged fields; then traversing the row object array to obtain a first unacknowledged field of each row, and putting the unacknowledged field into the first array;
after traversing the row object array, judging whether the first array is empty, if so, indicating that no field to be confirmed exists, and directly exiting the current cycle; if the first array is not empty, traversing the first array, extracting a field with the minimum field end 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 end position value to obtain a new column width; and if the new column width is not equal to 0, placing the new column width into a column width array.
In addition, if the current circulation column is the last column, subtracting the sum of all the column widths of the rest of the current line objects from the printing content width of the wage strip to be used as the last column width; if the last column width is not equal to 0, putting the last column width into a column width array;
thus, the acquisition of the column width data is completed.
Step 135, obtaining a preset payroll template, and generating the table content of the payroll template according to the row object array, the column width array and the preset payroll template;
the preset wage strip template is a default template and only comprises the most basic template information, wherein the content of the template information is in an XML format, and the template information is converted into Document objects;
selecting a table node object from the document objects, cycling the column width array, adding a column object in the table node object, and setting a column width;
acquiring title information, and if the title information is empty, not adding a title line; if the header information is non-empty, adding one row for displaying the header row in the table node object; acquiring a configured header variable item, judging whether the header variable item has a field to be displayed, if not, not adding header information lines, otherwise, judging the number of lines according to line feed information, and acquiring a title and the number of header lines;
setting a payroll table from the next line of the title line and the header information line according to the acquired line numbers of the title line and the header information line; cycling the row object array, taking out one row object at a time, and respectively generating a title row and a data row; generating table tail information; setting the format of the penultimate row and the format of the last row, processing the separation line display at the tail part, and generating a payroll template.
The title line generation method comprises the following steps: the field object in the circulating object is used for taking out the ending position of the previous field of the current field, calculating the position of the column where the ending position of the previous field is located according to the column width array, and adding 1 to be used as the sequence number of the starting column of the current field; setting title characters according to the title of the field to obtain a title line;
the method for generating the data line is consistent with the header line, the data text is set according to the data of the field, and the data line is obtained by setting a fetch formula.
In addition, the method for calculating the sequence number of the column where the field end position is located according to the field end position and the column width array comprises the following steps:
and (3) a cyclic column width array, wherein the column widths are summed, and when the sum result is equal to the field end position, the cyclic is exited, so that the sequence number of the field end column is obtained.
Step 136, setting field column merging;
setting column combination of a header line and a header information line; a loop row object array which loops all fields of the current row object for each row object; calculating the position of the ending column of the current field according to the column width array; setting a start position and an end position which are parallel; column merging of the table tail is set.
Step 137, setting data source information and block filling number function to generate payroll template.
And 140, obtaining payroll table data, assembling the table head and the table tail variables of the payroll table data, filling the table head and the table tail variables into a payroll template, and finishing printing of payroll.
And filling the obtained payroll table data, the table head variable items and the table tail variable items into a payroll template only to finish printing the 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 apparatus of the embodiments may be adaptively changed and disposed in one or more apparatuses different from the embodiments. 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. Any combination of all features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or units of any method or apparatus so disclosed, may be used in combination, except insofar as at least some of such features and/or processes or units 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 used solely to distinguish between steps and is not intended to limit the time or logical relationship between steps, including the various possible conditions unless the context clearly indicates otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features but not others included in other embodiments, 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 may be used in any combination.
Various component embodiments of the present 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 implemented as an apparatus or system program (e.g., a computer program and a computer program product) for performing a portion or all of the methods described herein. Such a program embodying the present disclosure may be stored on a computer readable medium, or may have the form of one or more signals. Such signals may be downloaded from an internet website, provided on a carrier signal, or provided 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 means, several of these means may be embodied by one and the same item of hardware.
The foregoing is merely a specific embodiment of the disclosure, and it should be noted that it will be apparent to those skilled in the art that various improvements, modifications, and variations can be made without departing from the spirit of the disclosure, and such improvements, modifications, and variations are considered to be within the scope of the application.

Claims (16)

1. A payroll printing method, the method comprising:
configuring the table head and the table tail variables of the payroll table to generate column information of the payroll table;
configuring printing basic information;
automatically generating a payroll template according to the column information of the payroll table;
the method comprises the steps of obtaining payroll table data, assembling the table head and the table tail variables of the payroll table data, filling the table head and the table tail variables into a payroll template, and finishing printing of payroll;
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 printing content width of the payroll according to the header information;
calculating the fields displayed on 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 combination;
setting data source information and block filling number function to generate wage strip template.
2. The method of claim 1, wherein the method of configuring the header and footer 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 are column information of all columns of the payroll table;
the columns of the table comprise a field name column, a display column and a line feed column;
the field name column is used for setting the field name of the column information; the display column is used to determine the displayed field; the wrap column is used to determine whether a field wraps.
3. The method according to claim 1, characterized in that:
the printing basic information comprises paper information, a printing direction and a margin;
the paper information comprises A3, A4, B5 and custom printing paper types;
the printing direction includes a lateral direction and a longitudinal direction;
the margins include upper, lower, left and right margins.
4. The method of claim 1, wherein the method of calculating payroll print content width comprises:
judging whether to configure the printing basic information, if not, 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 a printing direction parameter, wherein if the printing direction parameter is transverse printing, the paper height is used as the width of printing paper, and if the printing direction parameter is 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.
5. The method of claim 1, wherein the calculating the field method displayed for each row of the payroll table comprises:
creating a row object and a row object array, wherein the row object is used for storing field objects in row units, and the row object array is used for storing all field objects;
all fields of the payroll table are circulated, and whether the current field is put into a row object is judged;
if the current field is put into the row object, judging whether the current field is the last column or not;
if the current field is the last column, setting the width of the current field as the sum of the width of the payroll printing content minus the width of the current line object stored field;
setting the end position of the current field as the width of the payroll printing content, and adding the current field to a row object.
6. The method according to claim 5, wherein:
if the current field is not the last column, setting the ending 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.
7. The method according to claim 5, wherein:
if the current field cannot be placed in the line object, judging whether the current line object is empty or not;
if the line object is empty, setting the current field width and the current field end position as the payroll printing content width;
adding the current field to a row object;
the row object is added to the row object array to create a new row object.
8. The method according to claim 7, wherein:
if the line object is not empty, extracting the last field of the current line object, and setting the current field width as the sum of the payroll printing content width minus the current line object stored field width except the last field;
judging whether the current field width is larger than the payroll printing content width;
if the current field width is larger than the payroll printing content width, setting the current field width and the ending position as the payroll printing content width, 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, directly adding the current field to the row object.
9. The method of claim 5, wherein the determining whether to place the current field in the row 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 widths of the stored fields of the current line object to the width of the current field to obtain the sum of the widths, if the sum of the widths is larger than the width of the printing content of the payroll, the current field is not put into the line object, otherwise, the current field is put into the line object.
10. The method of claim 1, 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 circulation times;
and sequentially cycling the payroll table according to the cycle times to obtain each row width, and adding each row width to a row width array.
11. The method according to claim 10, wherein:
traversing the row object array in each cycle, acquiring a first unacknowledged field of each row, and placing the unacknowledged field into a pre-created first array;
after traversing the row object array, judging whether the first array is empty or not, and if the first array is empty, exiting the current circulation;
if the first array is not empty, traversing the first array, extracting a field with the minimum field end 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 end position value to obtain a new column width;
and if the new column width is not equal to 0, placing the new column width into a column width array.
12. The method according to claim 11, wherein:
if the current circulation column is the last column, subtracting the sum of all the column widths of the rest of the current line objects from the printing content width of the wage strip to be used as the last column width;
and if the last column width is not equal to 0, putting the last column width into a column width array.
13. The method of claim 1, wherein the method of generating the table content of the payroll template from the array of row objects, the array of column widths, and a preset payroll template comprises:
the preset payroll template is a default payroll template and comprises basic template information;
the preset wage strip 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;
the column width array is circulated, column objects are added in the table node objects, and column widths are set;
generating header and table header information, and acquiring the header and table header line numbers;
cycling the row object array, and generating a title row and a data row according to the title and header information;
generating table tail information;
setting the format of the penultimate row and the format of the last row, processing the separation line display at the tail part, and generating a payroll template.
14. The method of claim 13, wherein the generating header and header information and the obtaining header and header line numbers comprises:
acquiring title information, and if the title information is empty, not adding a title line;
if the header information is non-empty, adding one row for displaying the header row in the table node object;
and acquiring the configured header variable item, judging whether the header variable item has a field to be displayed, if not, not adding header information lines, otherwise, judging the number of lines according to line feed information.
15. The method of claim 14, wherein the method of generating a headline comprises:
setting a payroll table from the next line of the title line and the header information line according to the acquired line numbers of the title line and the header information line;
the row object array is circulated, one row object is taken out each time, the field objects in the row object are circulated, the ending position of the previous field of the current field is taken out, the position of the column where the ending position of the previous field is located is calculated according to the column width array, and the position is added with 1 to be used as the sequence number of the starting column of the current field;
setting title characters according to the title of the field to obtain a title line;
setting data characters according to the data of the fields, and setting a fetch formula to obtain data rows.
16. The method of claim 1, wherein the method of setting field column merging comprises:
setting column combination of a header line and a header information line;
a loop row object array which loops all fields of the current row object for each row object;
calculating the position of the ending column of the current field according to the column width array;
setting a start position and an end position which are parallel;
column merging of the table tail is set.
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 CN111208957A (en) 2020-05-29
CN111208957B true 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)

Families Citing this family (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 (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005004236A (en) * 2003-06-09 2005-01-06 Canon Inc Print control unit
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

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6757870B1 (en) * 2000-03-22 2004-06-29 Hewlett-Packard Development Company, L.P. Automatic table detection method and system
TW200830207A (en) * 2006-11-29 2008-07-16 Wingarc Technologies Inc Business form creating system, network system using the same, and business form creating method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005004236A (en) * 2003-06-09 2005-01-06 Canon Inc Print control unit
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

Also Published As

Publication number Publication date
CN111208957A (en) 2020-05-29

Similar Documents

Publication Publication Date Title
US7853869B2 (en) Creation of semantic objects for providing logical structure to markup language representations of documents
CN111208957B (en) Payroll printing method
CN110069767A (en) Composition method, electronic equipment and computer storage medium based on e-book
US10713430B2 (en) Systems and methods for applying layout to documents
US20080100623A1 (en) Determination of Unicode Points from Glyph Elements
CN110674619A (en) Online document editing method, device, equipment and computer storage medium
CN104834645A (en) Method and device for presenting layout document
CN111240609A (en) Data printing method and device, electronic equipment and storage medium
CN108319578B (en) Method for generating medium for data recording
CN104572744B (en) structured document generation method and device
US20120133657A1 (en) Requirement structure display apparatus and computer readable medium
CN110705234B (en) Method and device for adaptive typesetting and paging of standard form
US20130007599A1 (en) Optimizing the layout of electronic documents
CN106980607B (en) Paragraph recognition methods, device and terminal device
CN110221790B (en) Universal printing method and apparatus, analyzer, and storage medium
US20180129642A1 (en) Systems and methods for automatic application of formulas to tabular data cells
CN109542299B (en) Gold sentence display method for electronic book, electronic equipment and computer storage medium
CN107977459B (en) Report generation method and device
CN112270159B (en) Information insertion method, electronic device, and storage medium
US9146905B2 (en) Generating page-oriented data for printing dynamic documents
CN106598934B (en) Display methods, device and the terminal device of electronic book data
CN112699634B (en) Typesetting processing method of electronic book, electronic equipment and storage medium
CN112882665A (en) Method and device for generating printing template, electronic equipment and storage medium
US9075776B2 (en) Document processing apparatus, document processing method, and program
JPH10171619A (en) Index printing device and medium for recording program for printing index

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