Delphi Two-dimensional code group batch printing Delphi Two-dimensional code group batch printing Delphi QR Code Chinese support, group, batch printing experience summary
Fastreport Designing an inbound single report instance
Delphi Two-dimensional code group batch printing Fastreport control
Background:
has not been exposed to any complex reports, are some simple reports, in the use of Delphi under the Quickreport generally can meet the need, due to the change in the company's current needs, the bar code scanning put forward a new requirement, mainly to contain more content to sweep code, the previous one-dimensional code obviously can not fully meet , and two-dimensional code is also a trend, it is necessary to solve the problem of two-dimensional code, online search, the way there are various, I spent 3 days to find a lot, also tried a lot. Also experienced a lot of failure! Summary of the implementation of the two-dimensional code in Delphi there are three main methods:
1. Using PtImageRW.dll and PtQREncode.dll Dynamic Connection library, using Uqrcode to generate two-dimensional code image, so you can print in the report, how to use the Uqrcode implementation of the two-dimensional code, I level too low, unable to fathom; combine quikreport to achieve two-dimensional printing Code, but there is a problem with this is not support Chinese, such as source1 (integration into the fastreport can not achieve the support of Chinese);
2, there is also a control, the use of zint production of controls, such as SOURCE2, this problem is not used in the report (perhaps I do not use), can only be displayed on the form, of course, in theory can be used on the form can be used to print the report, but the problem I will not, hey, Or the technical level is too low. There is also a kind of control called Han-sof 2D barcodes, I can install, but cannot use, cannot generate QR code to picture. Can search the Internet to download this control to install a bit, have done to share with me.
3, with Zint integration into the Fastreport, is also the following I want to narrate the form: Source3. Can meet my needs completely.
Example to achieve the purchase of data in the bulk of the batch printing, add the use of two-dimensional code, of course, the actual work in the production of warehousing orders are basically not used in batch printing, is generally a single dozen, but I have no way here, must design such functions, history left the problem, here also complain about it!
If you do some extension, a lot of printing and this has a lot of similarities, I said is not too complex application, as to what is more complex I think the FS can also make a definite, here to do a summary is hope for and I like the level of people to provide some help it, perhaps now many people do not have Delphi at all, Right vote as one of his notes!
The inbound order style is as follows:
I. Environment and the component program used
1, Delphi2010
2, FastReport4.9 for 2010
3, Zint.dll
4, Frx2dbarcode.pas
5, Frx2dbarcodertti.pas
6, Ubitmapoverriden.pas
7, Ufrxzintbarcode.pas
8, Uregzintbarcode.pas
9, Uzintinterface.pas
Second, install FastReport4.9 for 2010
Note: Installation has to create a new project, and put a frxReport1 control to see if it can run properly, if not, then to the installation directory to check the permissions, add everyone to the folder permissions, should be OK, that's it. Make sure that the frxreport is working properly, otherwise everything will be in vain.
Installed in 2010, the next step in the end can be, do not need to recompile;
Fastreport5 can not generate the corresponding version of the file to compile when installing, do not know why.
Iii. Zint.dll and related documents
1. Copy the Zint.dll to the current directory of the project file and the system32 directory of Windows; But it doesn't matter if you don't copy it in the current directory page. Be cautious or put one!
2, in the Unit file reference Frx2dbarcode, you can call two-dimensional code; I refer to the online example, a lot of references, specific as follows, specifically what the meaning, nor carefully studied. Anyway, a few more are no harm frxdesgn, Frxclass, Frxdctrl, Frxchart,frxdbset, Frxrich, Frxbarcode,frxole, Frxcross, Frxdmpexport, Frxexportimage, Frxexportrtf, Frxexportxml, Frxexportxls, frxexporthtml, Frxgzip, Frxexportpdf, FrxChBox, Frxexporttext, Frxexportcsv, Frxexportmail, Frxadocomponents, Frxcrypt, FRXEXPORTODF, Frxgradient,frx2dbarcode;
3. Add the following controls to the form.
Property Settings Reference Routines
4. Open the design
Procedure Tmain_form.rzbitbtn1click (Sender:tobject);
Begin
Frxreport1.designreport;
End
5. Open Preview
Frxreport1.clear;
Frxreport1.loadfromfile (' GROUP.FR3 ');
FrxReport1.DataSets.Clear;
FRXREPORT1.DATASETS.ADD (Frxdbdata);
Frxreport1.showreport;
Frxreport1.modified:=false;
6. Set ADOquery1 SQL to "SELECT * from data_in ORDER by bill_code_in DESC"; Set active to true;
7. Set Frxdbdata dataset to ADOQuery1; Right-click the control to open the Edit Aliases dialog box so that you can use the data source in the design. Of course, in the design can also set their own.
Username is the name of the data connection at the Fastreport class.
Iv. Design of the report
Note: This usage can only be used to design the report when running program files, otherwise the direct Delphi Environment control is unable to display the design page containing the QR code.
Run the program, click the design to open the "design" interface;
1, double-click the page to open this dialog box, select Large height in design mode to maximize the layout of the format, do not select this item, add a few band after you will find some band can not find!
2, the control and layout area used under the FASTREPORTX;
3, page design mode, mainly used to header, GroupHeader, Masterdata, GroupFooter, PageFooter
4, after adding Masterdata, double-click the band, such as Select, and then masterdata the upper right corner of the frxdb, indicating that the data selection is successful
5, double-click GroupHeader, select Bill_code_in as the filter condition, the options are as follows, then the upper right corner shows frxdb. " Bill_code_in ":
6, in each band add data, directly to the right of the field to drag into the appropriate area, from this point of view, there are advantages.
Five, matters needing attention
(1) The footer in the form of display, you must select the report's Doublepass property is true, otherwise display the total page number 0, remember to insert that does not have a # good page and Totalpage, with # Good things mean all, try to know what meaning.
(2) If you need to display the header on each page, select Reprintonnewpage to True at design time
(3) When using the Frx2dbarcode.pas file may not load, even if the use of the reference, so the best way is to join directly into the project. ADD to Project
(4) How to change the control properties of Fastreport under Delphi.
Tfrxmemoview (Frxreport1.findobject (' memo16 ')). Text:= ' Set of content '
(5) Two-dimensional code size adjustment
Two-dimensional code size adjustment can be set in the design mode parameter autosizezoom change, that is, the proportion of magnification; but it's easy to appear in your batch printing when you scroll the mouse you will find that the bottom of the two-dimensional code is a small part, you can not scan, do not know whether the printing has an impact.
I did it by setting the code, and I thought it would be more convenient and would not have happened.
Note:
1, Fastreport for 2010 is my use, can be used normally is also used in the example 4.9 version
2, Fastreport5 for Delphi7, has been a long time without 7, so there is no test, this is downloaded to! Tell me about the success of the test!
3, Fastreport5 for Xe8, my friend passed the test, but also he sent me, but in my xe8 is not, you can see the control, but a run, on the error, there is no time to study, I remember in the time of loading XE8 is brought Fastreport5, But there is no two-dimensional code options, I was uninstalled, and then installed, and then appeared a series of problems, really no time, because most of the program is in 2010, there is no time to switch to XE8, do not know is not installed at the time can not install the FS5, My friend in the first installation when there is no choice, and then manually installed, the effect is very good!
Have to know how Fastreport5 in 2010 under the use of, trouble advice!
4, Source1-3, the front has said, is mainly some examples, I summed up three ways, do not know right!
5, Zinbarcode file is also an example, is also used fastreport, can be more perfect display of Chinese fastreport, but the QR code can not display Chinese, set into Chinese that error.
Feel Fastreport's function is too powerful, but a lot of features are not very likely to use, later willing to communicate with you more information about this!
Contact information: [Email protected];qq:505689211
http://download.csdn.net/detail/daifubing/8957447
Wrote a "Delphi QR Code, Group, batch," the Post