Goldprinter Gold Print

Source: Internet
Author: User

Goldprinter (Gold printing), this printing of the third-party plug-in is very convenient, you can directly use the Excel template set dozen, I contact is not deep, only for the novice reference, I am also in the Goldprinter provide source code reference after the development.

The exact order is as follows:

1. Draw Excel form template first

2, write code to the template cell assignment value

3. Program Printing

Well, the order is basically like this, do is a very simple printing example, the business situation is like this, one-time printing multiple orders, an order for multiple goods, and finally print out fanfold, print as

Well, the print results come out, directly on the code.

Private voidButton1_Click (Objectsender, EventArgs e) {           //Get Data collectionlt =Getdelivery.getdeliveryinfos (DELIVERY_SN, ORDER_SN, status); if(Lt.) Count <1) {MessageBox.Show ("The current condition has no data","System Tips", MessageBoxButtons.OK, Messageboxicon.asterisk); }            Else            {                 for(inti =0; I < Lt. Count; i++) {Delivery DV=Lt[i]; goldprinter.excelaccess Excel=Newgoldprinter.excelaccess (); stringstrFileName ="delivery slip. XLT";//Template file name                    stringStrexceltemplatefile = System.AppDomain.CurrentDomain.BaseDirectory +"template//"+strFileName; Excel.                                Open (Strexceltemplatefile); //using template filesExcel. Isvisibledexcel =true; Excel. Setcelltext (3,"D", Dv.customer_name); Excel. Setcelltext (3,"H", Dv.mobile); Excel. Setcelltext (3,"K", DV.DELIVERY_SN); Excel. Setcelltext (4,"D", dv.address); Excel. Setcelltext (4,"H", DV.ORDER_SN); Excel. Setcelltext (4,"K", dv.delivery_date); List<good> Lt_good =dv.goodlist;  for(intj =0; J < (Lt_good. Count >Ten?Ten: Lt_good. Count); J + +) {Excel. Setcelltext (6M"B", (1+j).                        ToString ()); Excel. Setcelltext (6M"C", Lt_good[j].name); Excel. Setcelltext (6+ J,"F","");//SpecificationsExcel. Setcelltext (6+ J,"G","");//UnitExcel. Setcelltext (6M"H", Lt_good[j].number.                        ToString ()); Excel. Setcelltext (6M"I", Lt_good[j].price. ToString ("0.00")); Excel. Setcelltext (6M"J", Lt_good[j].totalmoney. ToString ("0.00")); Excel. Setcelltext (6M"K","");//Notes                    }                    stringUppermoney = GoldPrinter.ChineseNum.GetUpperMoney (Double.Parse (Excel. Getcelltext ( -,"J"))); Excel. Setcelltext ( -,"E", Uppermoney); Excel.                    PrintPreview (); Excel.                    Close (); //Close and releaseThread.Sleep ( -); }            }        }    
View Code

Above is preview print, if need direct printing just put Excel. PrintPreview () changes directly to Excel. Print (). There are two DLLs involved, depending on the attachment

DLL Package

Goldprinter Source Code

Goldprinter Gold Print

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.