C # nesting

Source: Internet
Author: User

In the computerized accounting work, almost all accounting files generated by computers should be output in the format specified by the accounting system. For example, various types of books and accounting creden. Generally, there are two ways to print and output these files:

First: Non-packaging method ------ the files generated according to the accounting software should be output. When printing, both the data that should be output and the grid lines printed on the book will be printed out. This method is suitable for printing the output of accounting files on the blank paper without any trace. The second method is the modeling method ------ In this way, the manufacturer of the accounting software must produce the accounting software at the same time, supporting production of blank accounts and reports that meet the requirements of the accounting system and the output requirements of the accounting software. When printing and outputting an accounting file, the electrocomputation accountant only prints the data to be output in the existing format and does not print the grid lines printed on the book. This improves the printing output efficiency, reduces printer losses, and saves printing costs. At present, some mature accounting software also provides two types of accounting file printing and output methods, such as Kingdee, yonyou and other financial software. Of course, this group of concepts can also be used in other software designs for non-accounting software.

 

This means that we have used tickets, bar codes, and so on in our daily lives...

 

 

I checked the implementation process on the Internet and created a printing operation class. The specific implementation method is as follows:

 

Publicprint. CS printing operation class

Using system; using system. Collections. Generic; using system. text;
Using system. Data; using system. drawing;
Namespace windowsformsping {class publicprint {public publicprint (){}
Public void postion (Graphics E, datatable DT) {int x = 60; // X coordinate
Int y = 50; // y coordinate
Font fontnormalcontent = new system. drawing. font (" 文 ", 12f, system. drawing. fontstyle. regular, system. drawing. graphicsunit. point, (bytes) (134 )));
Pen = new pen (color. Black, 1 );
For (INT I = 0; I <DT. Rows. Count; I ++ ){
String wpmc = DT. Rows [I] ["MC"]. tostring (); // name
String wpgg = DT. Rows [I] ["GG"]. tostring (); // Specification
String wpdw = DT. Rows [I] ["DW"]. tostring (); // Unit
String wpsl = DT. Rows [I] ["SL"]. tostring (); // quantity
String wpdj = DT. Rows [I] ["DJ"]. tostring (); // unit price
String wpje = DT. Rows [I] ["Je"]. tostring (); // amount
String sjxx = datetime. parse (Dt. Rows [I] ["djsj"]. tostring (). to1_datestring (); // time

E. drawstring (wpmc + "" + wpgg, fontnormalcontent, brushes. Black, x, y );
E. drawstring (wpdw, fontnormalcontent, brushes. Black, x + 80, y );
E. drawstring (wpsl, fontnormalcontent, brushes. Black, x + 115, y );
E. drawstring (wpdj, fontnormalcontent, brushes. Black, x + 160, y );

// Write time
If (I = 0 ){
String year = sjxx. substring (2, 2 );
String month = sjxx. substring (5, 2 );
String day = sjxx. substring (8, 2 );
E. drawstring (year, fontnormalcontent, brushes. Blue, 150, 25 );
E. drawstring (month, fontnormalcontent, brushes. Blue, 170, 25 );
E. drawstring (day, fontnormalcontent, brushes. Blue, 190, 25 );
}
Y + = 30;
}}}}

 

 

 

Page call. CS class:

 

Private void btnprint_click (Object sender, eventargs e) {If (printdialog1.showdialog () = dialogresult. OK) {printdocument1.printersettings = printdialog1.printersettings;
Printdocument1.printpage + = new system. Drawing. Printing. printpageeventhandler (printdocument?printpage); printdocument1.print ();
}}
Private void printdocumentemediprintpage (Object sender, system. Drawing. Printing. printpageeventargs e) {graphics G = E. graphics;
Dataset DS = new dataset (); // bind a data source Publicprint P = new publicprint (); p. postion (G, DS. Tables [0]); }

 

 

AboveCodeYes.OthersThat's it.

In the computerized accounting work, almost all accounting files generated by computers should be output in the format specified by the accounting system. For example, various types of books and accounting creden. Generally, there are two ways to print and output these files:

First: Non-packaging method ------ the files generated according to the accounting software should be output. When printing, both the data that should be output and the grid lines printed on the book will be printed out. This method is suitable for printing the output of accounting files on the blank paper without any trace. The second method is the modeling method ------ In this way, the manufacturer of the accounting software must produce the accounting software at the same time, supporting production of blank accounts and reports that meet the requirements of the accounting system and the output requirements of the accounting software. When printing and outputting an accounting file, the electrocomputation accountant only prints the data to be output in the existing format and does not print the grid lines printed on the book. This improves the printing output efficiency, reduces printer losses, and saves printing costs. At present, some mature accounting software also provides two types of accounting file printing and output methods, such as Kingdee, yonyou and other financial software. Of course, this group of concepts can also be used in other software designs for non-accounting software.

 

This means that we have used tickets, bar codes, and so on in our daily lives...

 

 

I checked the implementation process on the Internet and created a printing operation class. The specific implementation method is as follows:

 

Publicprint. CS printing operation class

Using system; using system. Collections. Generic; using system. text;
Using system. Data; using system. drawing;
Namespace windowsformsping {class publicprint {public publicprint (){}
Public void postion (Graphics E, datatable DT) {int x = 60; // X coordinate
Int y = 50; // y coordinate
Font fontnormalcontent = new system. drawing. font (" 文 ", 12f, system. drawing. fontstyle. regular, system. drawing. graphicsunit. point, (bytes) (134 )));
Pen = new pen (color. Black, 1 );
For (INT I = 0; I <DT. Rows. Count; I ++ ){
String wpmc = DT. Rows [I] ["MC"]. tostring (); // name
String wpgg = DT. Rows [I] ["GG"]. tostring (); // Specification
String wpdw = DT. Rows [I] ["DW"]. tostring (); // Unit
String wpsl = DT. Rows [I] ["SL"]. tostring (); // quantity
String wpdj = DT. Rows [I] ["DJ"]. tostring (); // unit price
String wpje = DT. Rows [I] ["Je"]. tostring (); // amount
String sjxx = datetime. parse (Dt. Rows [I] ["djsj"]. tostring (). to1_datestring (); // time

E. drawstring (wpmc + "" + wpgg, fontnormalcontent, brushes. Black, x, y );
E. drawstring (wpdw, fontnormalcontent, brushes. Black, x + 80, y );
E. drawstring (wpsl, fontnormalcontent, brushes. Black, x + 115, y );
E. drawstring (wpdj, fontnormalcontent, brushes. Black, x + 160, y );

// Write time
If (I = 0 ){
String year = sjxx. substring (2, 2 );
String month = sjxx. substring (5, 2 );
String day = sjxx. substring (8, 2 );
E. drawstring (year, fontnormalcontent, brushes. Blue, 150, 25 );
E. drawstring (month, fontnormalcontent, brushes. Blue, 170, 25 );
E. drawstring (day, fontnormalcontent, brushes. Blue, 190, 25 );
}
Y + = 30;
}}}}

 

 

 

Page call. CS class:

 

Private void btnprint_click (Object sender, eventargs e) {If (printdialog1.showdialog () = dialogresult. OK) {printdocument1.printersettings = printdialog1.printersettings;
Printdocument1.printpage + = new system. Drawing. Printing. printpageeventhandler (printdocument?printpage); printdocument1.print ();
}}
Private void printdocumentemediprintpage (Object sender, system. Drawing. Printing. printpageeventargs e) {graphics G = E. graphics;
Dataset DS = new dataset (); // bind a data source Publicprint P = new publicprint (); p. postion (G, DS. Tables [0]); }

 

 

The above code is.OthersThat's it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.