Report printing method, device and readable medium
By obtaining and processing the printing report template and identification information, calling the printing platform to obtain parameters, dynamically determining the content of the report, solving the problem of high scalability and maintenance cost of printing components in the ERP system, and realizing flexible printing function settings and system performance promote.
Patent Information
- Application Number
- CN202010993093.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-21
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2040-09-21
AI Technical Summary
The printing components in existing ERP systems are poorly scalable, difficult to deploy independently, and have high coupling with the system and high maintenance costs, which leads to excessive frequency of printing functions that put pressure on the server.
By obtaining the print statement template, determine the to be printed in the printing form with reporting information, and call the corresponding printing platform to obtain the print parameters, dynamically determine the report header, detailed grid, and the end of the report, so as to achieve flexible printing function settings.
The printing function is stripped out of the business, forming an independent deployment function, reducing development difficulty, improving the system's maintenance and ease of use, supporting a variety of printing formats and modeling printers, and improving system performance.
Smart Images

Figure CN112068785B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a report printing method, device and readable medium. Background Art
[0002] Nowadays, the system printing formats are diverse and complex. Implementing them through code not only requires a large amount of code, but also has high difficulty in implementing complex printing formats and poor usability. When the printing function is used too frequently, it will cause great pressure on the server and have an adverse impact on the operation of the system.
[0003] Currently, the printing component in the ERP system mainly assembles data into word or excel, and then prints by generating word, excel, and pdf. It has poor scalability, cannot be deployed independently, is highly coupled with the system, and has high maintenance costs. Summary of the invention
[0004] The embodiments of the present invention provide a report printing method, device and readable medium, which can meet various printing needs and can also be flexibly set according to different printing requirements.
[0005] In a first aspect, an embodiment of the present invention provides a report printing method, comprising:
[0006] Obtain a print report template, wherein the print report template includes a report header, a detail grid, and a report footer;
[0007] According to the printed report template, determining a report to be printed that carries report identification information, wherein the report identification information is used to identify the report to be printed;
[0008] According to the IP address, port number and the report identification information, calling the printing platform corresponding to the report identification information;
[0009] The printing parameters of the report to be printed sent by the printing platform are obtained, and according to the printing parameters, a report header, a detail grid and a report footer of the report to be printed are determined.
[0010] In a possible design, the detail grid includes a title row, a group header, and a group footer, and the printing parameters include a parameter set, and the parameter set includes at least one parameter;
[0011] The step of determining the report header, detail grid, and report footer of the report to be printed according to the printing parameters includes:
[0012] According to the parameter set of the report to be printed, the parameters of the report header, the title row, the group header, the group footer and the report footer of the report to be printed are determined.
[0013] In a possible design, the detail grid further includes a content row, the printing parameter further includes a field set, and the field set includes at least one field belonging to the same parameter;
[0014] The step of determining the report header, detail grid, and report footer of the report to be printed according to the printing parameters includes:
[0015] According to the field set of the report to be printed, the fields of the report header, the content row and the report footer of the report to be printed are determined.
[0016] In a possible design, the field set includes signature information, and the type of the signature information is binary;
[0017] The step of determining the fields of the report header, detail grid and report footer of the report to be printed according to the field set of the report to be printed includes:
[0018] According to the field set of the report to be printed, the signature information in the field set is extracted, and the signature information is hidden in the footer of the report.
[0019] In a possible design, the printing parameters also include report type, report file name, report version, number of copies, printer name, print offset and print task identifier.
[0020] In a second aspect, an embodiment of the present invention provides a report printing device, comprising:
[0021] An acquisition module, used for acquiring a printing report template, wherein the printing report template includes a report header, a detail grid and a report footer;
[0022] A first determining module, configured to determine, according to the printed report template, a report to be printed that carries report identification information, wherein the report identification information is used to identify the report to be printed;
[0023] A calling module, used for calling a printing platform corresponding to the report identification information according to the IP address, port number and the report identification information;
[0024] The second determining module is used to obtain the printing parameters of the report to be printed sent by the printing platform, and determine the report header, detail grid and report footer of the report to be printed according to the printing parameters.
[0025] In a possible design, the detail grid includes a title row, a group header, and a group footer, and the printing parameters include a parameter set, and the parameter set includes at least one parameter;
[0026] When the second determining module determines the report header, detail grid and report footer of the report to be printed according to the printing parameters, it is specifically used to perform the following operations:
[0027] According to the parameter set of the report to be printed, the parameters of the report header, the title row, the group header, the group footer and the report footer of the report to be printed are determined.
[0028] In a possible design, the detail grid further includes a content row, the printing parameter further includes a field set, and the field set includes at least one field belonging to the same parameter;
[0029] When the second determining module determines the report header, detail grid and report footer of the report to be printed according to the printing parameters, it is specifically used to perform the following operations:
[0030] According to the field set of the report to be printed, the fields of the report header, the content row and the report footer of the report to be printed are determined.
[0031] In a possible design, the field set includes signature information, and the type of the signature information is binary;
[0032] When the second determining module determines the fields of the report header, the content line and the report footer of the report to be printed according to the field set of the report to be printed, the second determining module includes:
[0033] According to the field set of the report to be printed, the signature information in the field set is extracted, and the signature information is hidden in the footer of the report.
[0034] In a third aspect, an embodiment of the present invention provides a report printing device, comprising: at least one memory and at least one processor;
[0035] The at least one memory is used to store a machine-readable program;
[0036] The at least one processor is used to call the machine-readable program to execute the method described above.
[0037] In a fourth aspect, an embodiment of the present invention provides a computer-readable medium, on which computer instructions are stored. When the computer instructions are executed by a processor, the processor executes the method described above.
[0038] It can be seen from the above scheme that the report printing method, device and readable medium provided by the present invention obtain a printed report template, wherein the printed report template includes a report header, a detailed grid and a report footer; according to the printed report template, determine the report to be printed that carries report identification information, wherein the report identification information is used to identify the report to be printed; according to the IP address, port number and report identification information, call the printing platform corresponding to the report identification information; obtain the printing parameters of the report to be printed sent by the printing platform, and determine the report header, detailed grid and report footer of the report to be printed according to the printing parameters. In this way, by setting the printed report template, the printing function can be separated from the business to form an independently deployable function, and the part that originally needs to be implemented by code can be set by simply dragging and dropping the printing style, reducing the development difficulty, improving the maintainability and ease of use of the system, so that various printing needs can be met, and it can also be flexibly set according to different printing needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 is a flow chart of a report printing method provided by an embodiment of the present invention;
[0041] Figure 2 is a flow chart of a report printing method provided by another embodiment of the present invention;
[0042] Figure 3 It is a schematic diagram of a device where a report printing device is provided in one embodiment of the present invention;
[0043] Figure 4 is a schematic diagram of a report printing device provided by an embodiment of the present invention;
[0044] Figure 5 It is a schematic diagram of a report provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0046] Figure 1 FIG. 1 is a flow chart of a report printing method provided by an embodiment of the present invention. Figure 1 As shown, the method may include the following steps:
[0047] Step 101: Obtain a print report template, wherein the print report template includes a report header, a detail grid, and a report footer;
[0048] Step 102: Determine, according to the printed report template, a report to be printed that carries report identification information, wherein the report identification information is used to identify the report to be printed;
[0049] Step 103: Calling a printing platform corresponding to the report identification information according to the IP address, port number and the report identification information;
[0050] Step 104: Acquire the printing parameters of the report to be printed sent by the printing platform, and determine the report header, detail grid and report footer of the report to be printed according to the printing parameters.
[0051] In an embodiment of the present invention, the report printing method provided by the present invention obtains a report printing template, wherein the report printing template includes a report header, a detail grid and a report footer; according to the report printing template, determines the report to be printed that carries the report identification information, wherein the report identification information is used to identify the report to be printed; according to the IP address, port number and report identification information, calls the printing platform corresponding to the report identification information; obtains the printing parameters of the report to be printed sent by the printing platform, and according to the printing parameters, determines the report header, detail grid and report footer of the report to be printed. In this way, by setting the report printing template, the printing function can be separated from the business to form an independently deployable function, and the part that originally needs to be implemented by code can be set by simply dragging and dropping the printing style, reducing the development difficulty, improving the maintainability and ease of use of the system, so that various printing needs can be met, and it can also be flexibly set according to different printing needs.
[0052] The report printing method provided by the embodiment of the present invention separates the printing function from the business to form an independently deployable function, so that it can support multiple printing formats (such as checks, bar codes, pictures, etc.), support various types of printers (such as dot matrix printers, laser printers, receipt printers, etc.), support use as a PDF server, have a small amount of code, and can complete the design of the report by simply dragging and dropping report elements on the design interface. The operation method is conventional, and any user with a little computer experience can design the report. The report can be independently deployed on the server to improve system performance.
[0053] based on Figure 1 In the report printing method shown, in one embodiment of the present invention, the detail grid includes a title row, a group header and a group footer, and the printing parameters include a parameter set, and the parameter set includes at least one parameter;
[0054] The step of determining the report header, detail grid, and report footer of the report to be printed according to the printing parameters includes:
[0055] According to the parameter set of the report to be printed, the parameters of the report header, the title row, the group header, the group footer and the report footer of the report to be printed are determined.
[0056] The printing parameters also include report type, report file name, report version, number of copies to be printed, printer name, print offset and print task identifier.
[0057] For example, if "ReportType":report type gridreportfastreport is empty, it will default to gridreport;
[0058] "ReportName": report file name POS receipt;
[0059] "ReportVersion": Optional. Report version. If it is empty, the default value is 1. If the local report version is too low, it will be downloaded and updated from the ReportUrl address.
[0060] "ReportUrl": Optional. If it is empty, the local report will not be updated. If the local report does not exist, it can be automatically downloaded from this URL;
[0061] "ReportUrl": Optional. If it is empty, the local report will not be updated. If the local report does not exist, it can be automatically downloaded from this URL;
[0062] "Copies": Optional. The number of copies to be printed. You can specify the number of copies to be printed. The default is 1. If it is zero, no printing will be done and only the PDF, jpg and other files generated by the report will be returned.
[0063] "PrinterName": Optional. Specify the printer. If it is blank, the default printer will be used. Please check the name of your printer in Control Panel->Devices and Printers.
[0064] "PrintOffsetX": Optional. Print right offset, in centimeters. The horizontal offset of the report, positive to the right and negative to the left;
[0065] "PrintOffsetY": Optional. Print offset in centimeters. The vertical offset of the report, positive when it is downward and negative when it is upward;
[0066] "token": optional. Only the token value in the list can be printed;
[0067] "taskId": Optional. When multiple print tasks are printed at the same time, the id is used to determine which print task is returned.
[0068] based on Figure 1 In the report printing method shown, in one embodiment of the present invention, the detail grid further includes a content row, the printing parameter further includes a field set, and the field set includes at least one field belonging to the same parameter;
[0069] The step of determining the report header, detail grid, and report footer of the report to be printed according to the printing parameters includes:
[0070] According to the field set of the report to be printed, the fields of the report header, the content row and the report footer of the report to be printed are determined.
[0071] In the embodiment of the present invention, a printing platform is written in the background, and the interactive logic with the front end can be realized by introducing the printing platform. According to different business requirements and application scenarios, the corresponding data assembly is completed, and various types of printing styles can be realized in combination with the set printing report format, and the ideal document can be printed out through the printer.
[0072] based on Figure 1 In the report printing method shown, in one embodiment of the present invention, the field set includes signature information, and the type of the signature information is binary;
[0073] The step of determining the fields of the report header, detail grid and report footer of the report to be printed according to the field set of the report to be printed includes:
[0074] According to the field set of the report to be printed, the signature information in the field set is extracted, and the signature information is hidden in the footer of the report.
[0075] In the embodiment of the present invention, the signature image uses an image frame. Although it is placed at the end of the report, it cannot take values from the parameter set. It is necessary to obtain values from the field set of the detail grid, that is, add a new field to the field set, and then select the type as binary, and then select the data field of the image frame as the corresponding data field.
[0076] like Figure 2 As shown, another embodiment of the present invention further provides a report printing method. Figure 5 , the method comprises the following steps:
[0077] Step 201: Obtain a print report template, wherein the print report template includes a report header, a detail grid, and a report footer.
[0078] Step 202: Determine, according to the printed report template, a report to be printed that carries report identification information, wherein the report identification information is used to identify the report to be printed.
[0079] In this step, if Figure 5 As shown, the report headers of the report to be printed are "Incoming Order Detail Report", "Road Line", "Customer", "Unit", "Warehouse Number", etc., and the detail grid is Figure 5 In the grid, the report footer is "Total". Figure 5 In the report, the identification information can be a grain warehouse entry form.
[0080] Step 203: According to the IP address, port number and the report identification information, call the printing platform corresponding to the report identification information.
[0081] In this step, the printing platform corresponding to the report identification information can be called through the IP address, port number and grain storage order. It can be understood that the printing platform pre-stores a parameter set and a field set.
[0082] Step 204: Obtain the printing parameters of the report to be printed sent by the printing platform, and determine the parameters of the report header, the title row, the group header, the group footer and the report footer of the report to be printed according to the parameter set of the report to be printed.
[0083] In this step, the parameter set may include "route", "customer", "vehicle number", "container number", "cargo name", "total", etc.
[0084] Step 205: Determine the fields of the report header, the content row, and the report footer of the report to be printed according to the field set of the report to be printed.
[0085] In this step, the field set may include "Grain 2", "8100537", "Soybean", etc.
[0086] Step 206: Extract signature information from the field set of the report to be printed, and hide the signature information at the end of the report.
[0087] In this step, since the signature information is relatively private, it does not need to be displayed in the printed detailed report, but can be hidden in the electronic data of the report, so that the person responsible for the warehouse entry or vehicle number (i.e., the signature information) can be extracted according to customer needs.
[0088] like Figure 3 and Figure 4 As shown, the embodiment of the present invention provides a device where a report printing device is located and a report printing device. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. From the hardware level, such as Figure 3 As shown in FIG. 1 , a hardware structure diagram of a device where a report printing device provided in an embodiment of the present invention is located is shown in FIG. Figure 3 In addition to the processor, memory, network interface, and non-volatile memory shown in the figure, the device in the embodiment may also include other hardware, such as a forwarding chip responsible for processing messages, etc. Taking software implementation as an example, Figure 4 As shown, as a device in a logical sense, the CPU of the device in which it is located reads the corresponding computer program instructions in the non-volatile memory into the internal memory and runs them.
[0089] like Figure 4 As shown, the report printing device provided in this embodiment includes:
[0090] The acquisition module 401 is used to acquire a print report template, wherein the print report template includes a report header, a detail grid and a report footer;
[0091] A first determining module 402 is used to determine, according to the printed report template, a report to be printed that carries report identification information, wherein the report identification information is used to identify the report to be printed;
[0092] The calling module 403 is used to call the printing platform corresponding to the report identification information according to the IP address, port number and the report identification information;
[0093] The second determining module 404 is used to obtain the printing parameters of the report to be printed sent by the printing platform, and determine the report header, detail grid and report footer of the report to be printed according to the printing parameters.
[0094] In an embodiment of the present invention, the acquisition module 401 can be used to execute step 101 in the above method embodiment, the first determination module 402 can be used to execute step 102 in the above method embodiment, the calling module 403 can be used to execute step 103 in the above method embodiment, and the second determination module 404 can be used to execute step 104 in the above method embodiment.
[0095] In one embodiment of the present invention, the detail grid includes a title row, a group header, and a group footer, and the printing parameters include a parameter set, and the parameter set includes at least one parameter;
[0096] When determining the report header, detail grid and report footer of the report to be printed according to the printing parameters, the second determining module 404 is specifically used to perform the following operations:
[0097] According to the parameter set of the report to be printed, the parameters of the report header, the title row, the group header, the group footer and the report footer of the report to be printed are determined.
[0098] In one embodiment of the present invention, the detail grid further includes a content row, the printing parameter further includes a field set, and the field set includes at least one field belonging to the same parameter;
[0099] When determining the report header, detail grid and report footer of the report to be printed according to the printing parameters, the second determining module 404 is specifically used to perform the following operations:
[0100] According to the field set of the report to be printed, the fields of the report header, the content row and the report footer of the report to be printed are determined.
[0101] In one embodiment of the present invention, the field set includes signature information, and the type of the signature information is binary;
[0102] When the second determining module 404 determines the fields of the report header, the content line, and the report footer of the report to be printed according to the field set of the report to be printed, the second determining module 404 includes:
[0103] According to the field set of the report to be printed, the signature information in the field set is extracted, and the signature information is hidden in the footer of the report.
[0104] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the report printing device. In other embodiments of the present invention, the report printing device may include more or fewer components than those illustrated, or combine some components, or split some components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0105] The information interaction, execution process and other contents between the modules in the above-mentioned device are based on the same concept as the embodiment of the method of the present invention. For the specific contents, please refer to the description in the embodiment of the method of the present invention, and no further description is given here.
[0106] The embodiment of the present invention further provides a report printing device, comprising: at least one memory and at least one processor;
[0107] The at least one memory is used to store a machine-readable program;
[0108] The at least one processor is used to call the machine-readable program to execute the report printing method in any embodiment of the present invention.
[0109] Optionally, the at least one processor is further configured to, when executing the executable instructions: the detail grid includes a title row, a group header and a group footer, the printing parameters include a parameter set, and the parameter set includes at least one parameter;
[0110] The step of determining the report header, detail grid, and report footer of the report to be printed according to the printing parameters includes:
[0111] According to the parameter set of the report to be printed, the parameters of the report header, the title row, the group header, the group footer and the report footer of the report to be printed are determined.
[0112] Optionally, when executing the executable instructions, the at least one processor is further configured to: the detail grid further includes a content row, the print parameter further includes a field set, and the field set includes at least one field belonging to the same parameter;
[0113] The step of determining the report header, detail grid, and report footer of the report to be printed according to the printing parameters includes:
[0114] According to the field set of the report to be printed, the fields of the report header, the content row and the report footer of the report to be printed are determined.
[0115] Optionally, when executing the executable instruction, the at least one processor is further configured to: the field set includes signature information, and the type of the signature information is binary;
[0116] The step of determining the fields of the report header, detail grid and report footer of the report to be printed according to the field set of the report to be printed includes:
[0117] According to the field set of the report to be printed, the signature information in the field set is extracted, and the signature information is hidden in the footer of the report.
[0118] The embodiment of the present invention also provides a computer-readable medium storing instructions for causing a computer to execute the report printing method as described herein. Specifically, a method or device equipped with a storage medium can be provided, on which a software program code for implementing the functions of any of the above embodiments is stored, and a computer (or CPU or MPU) of the method or device reads and executes the program code stored in the storage medium.
[0119] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.
[0120] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer by a communication network.
[0121] In addition, it should be clear that the functions of any of the above embodiments can be realized not only by executing the program code read by the computer, but also by completing part or all of the actual operations by operating methods operated on the computer based on the instructions of the program code.
[0122] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or written to a memory provided in an expansion unit connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or the expansion unit is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.
[0123] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A report printing method, characterized in that: include: Obtain a print report template, wherein the print report template includes a report header, a detail grid, and a report footer; According to the printed report template, determining a report to be printed that carries report identification information, wherein the report identification information is used to identify the report to be printed; According to the IP address, port number and the report identification information, calling the printing platform corresponding to the report identification information; Acquire the printing parameters of the report to be printed sent by the printing platform, and determine the report header, detail grid and report footer of the report to be printed according to the printing parameters; The detail grid includes a title row, a group header and a group footer, and the printing parameters include a parameter set, and the parameter set includes at least one parameter; The step of determining the report header, detail grid, and report footer of the report to be printed according to the printing parameters includes: Determine the parameters of the report header, the title row, the group header, the group footer and the report footer of the report to be printed according to the parameter set of the report to be printed; The detail grid further includes a content row, the printing parameter further includes a field set, and the field set includes at least one field belonging to the same parameter; The step of determining the report header, detail grid, and report footer of the report to be printed according to the printing parameters includes: Determine the report header, the content row and the report footer fields of the report to be printed according to the field set of the report to be printed; The field set includes signature information, and the type of the signature information is binary; The step of determining the fields of the report header, detail grid and report footer of the report to be printed according to the field set of the report to be printed includes: Extracting signature information from the field set of the report to be printed, and hiding the signature information at the end of the report; The printing parameters also include report type, report file name, report version, number of copies to be printed, printer name, print offset and print task identifier.
2. A report printing device, characterized in that: include: An acquisition module, used for acquiring a printing report template, wherein the printing report template includes a report header, a detail grid and a report footer; A first determining module, configured to determine, according to the printed report template, a report to be printed that carries report identification information, wherein the report identification information is used to identify the report to be printed; A calling module, used for calling a printing platform corresponding to the report identification information according to the IP address, port number and the report identification information; A second determination module is used to obtain the printing parameters of the report to be printed sent by the printing platform, and determine the report header, detail grid and report footer of the report to be printed according to the printing parameters; The detail grid includes a title row, a group header and a group footer, and the printing parameters include a parameter set, and the parameter set includes at least one parameter; When the second determining module determines the report header, detail grid and report footer of the report to be printed according to the printing parameters, it is specifically used to perform the following operations: Determine the parameters of the report header, the title row, the group header, the group footer and the report footer of the report to be printed according to the parameter set of the report to be printed; The detail grid further includes a content row, the printing parameter further includes a field set, and the field set includes at least one field belonging to the same parameter; When the second determining module determines the report header, detail grid and report footer of the report to be printed according to the printing parameters, it is specifically used to perform the following operations: Determine the report header, the content row and the report footer fields of the report to be printed according to the field set of the report to be printed; The field set includes signature information, and the type of the signature information is binary; When the second determining module determines the fields of the report header, the content line and the report footer of the report to be printed according to the field set of the report to be printed, the second determining module includes: According to the field set of the report to be printed, the signature information in the field set is extracted, and the signature information is hidden in the footer of the report.
3. A report printing device, characterized in that: include: at least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is configured to call the machine-readable program to execute the method of claim 1.
4. A computer-readable medium, characterized in that The computer readable medium stores computer instructions, which, when executed by a processor, cause the processor to perform the method of claim 1 .
Citation Information
Patent Citations
Method and system for accessing cloud printing platform by local printer
CN106970767A
Method and system for realizing Web end self-defined format printing on basis of B / S framework
CN107463348A