In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
The content of this article mainly focuses on how to print the data to pdf in the application of Qt database. The content of the article is clear and clear. It is very suitable for beginners to learn and is worth reading. Interested friends can follow the editor to read together. I hope you can get something through this article!
I. Preface
Since the data can be exported to xls, customers have put forward different requirements, for example, since the data can be exported to xls, can it be exported to a pdf file? Because users can modify data fraud and other things after xls is opened, and pdf is not editable by default, unless with the help of professional tools, if you want to limit the user's exported data cannot be changed, then exporting pdf is the best choice. Writing programs is often like this, gradually increasing step by step, with the increase of user demand, the number of programs is also increasing, and the wheel components are also increasing. Often customers raise demand, must listen carefully, especially front-line users, the actual use of users, although some unreasonable needs, but as far as possible to meet, after all, the customer is God.
In Qt, the qprinter class must be used to export to pdf, which is equivalent to printing the data to pdf, so the exact point is to print to a pdf file instead of exporting the data to pdf. The format of this piece is printed, so it needs to be printed in the form of html nested table tables. The supported format is limited. Generally, you can set font size, color, border, alignment, etc., even though it is html. But it also supports limited html formats, which should be paid special attention to. The current version of qt seems to extract pdf into a separate module, which is more powerful.
Parameters supported by the structure:
File name
Table name
Main title
Subtitle
Field name collection
Field width set
Content collection
Line content separator
Child content separator
Border width
Check column
Check type
Check value
Check color
Last column stretch fill
Horizontal typesetting
Paper margin
II. Functional features
The component also integrates export data to csv, xls, pdf, and print data.
All operations provide static methods without new, and various parameters such as data and properties are set with structural data, which is very convenient.
It also supports QTableView, QTableWidget, QStandardItemModel, QSqlTableModel and other data sources.
Provide static methods that are directly passed into QTableView and QTableWidget controls to automatically identify column names, column widths, and data contents.
Each set of features provides separate and complete examples, annotated in detail, and is very suitable for all stages of Qter programmers.
Original export data mechanism, does not rely on any office components or operating systems and other third-party libraries, and supports embedded linux.
The speed is so fast that it takes only 2 seconds to complete 100000 rows of data in nine fields.
It only takes four steps to start rapidly exporting large amounts of data, such as 100W records to Excel.
At the same time, it provides direct write data interface and multi-thread write data interface without card main interface.
The title, subtitle and table name can be set.
You can set the field name, column name, and column width of the exported data.
Automatic stretch filling can be set at the end of the column, and the default stretch is more beautiful.
You can set whether to enable check filtering data, and the special color display of the data that conforms to the rules when enabled.
You can specify check columns, check rules, check values, and check value data types.
Verification rules support accurate = =, greater than >, greater than or equal to > =, less than
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.