C # winfrom Fastreport Print

Source: Internet
Author: User

1. References

using Fastreport; using Fastreport.barcode;

2. Code

      Private voidToolstripbuttonprint_click (Objectsender, EventArgs e) {            stringTextnewdate = DateTime.Now.ToString ("YYYY-MM-DD HH:mm:ss"); stringTextbarcode=string.            Empty; Try            {                //Selecord = this.datagridview1.selectedrows[0]. CELLS[1]. Value.tostring ();//Select the value of the first cell of a row               stringstrSQL ="SELECT PID, SN, Workno, Name, Sex_name, Idcard, age, Education_name, CONVERT (varchar (+), EntryDate, Max) as Entryda TE,"+"Usemanfrom_name, Post_name, Jobs_name,typework_name, idcardadress, Mobile,"+"Security_name, Contractterm_name,brithdate, Sex, Education, Usemanfrom, Post, Jobs, Typework, Security,"+"contractterm,workdate,nation,duty,worktelphone,hometelphone,email,workaddress, HomeAddress,"+"Memo, Photo, Idcardimage"+"From tbemployee where pid= '"+ IPid +"'"; Report Fsreport=NewReport ();//instantiating a printed reportSqlHelper Helper=NewSqlHelper (); DS= Sqlhelper.sqlgetdataset (strSQL,"V_tbemployee"); //SDA.                Fill (DT, "Tbdevcard"); //string reportpath = appdomain.currentdomain.basedirectory+ "\otdevpgcard.frx"; //fsreport.load (@ "... \otdevpgcard.frx ");Fsreport.load (@"Fastreport\otempedit.frx");                Fsreport.registerdata (DS); DT= ds. tables[0]; Textobject Ptextprint= Fsreport.findobject ("textprintdate") asTextobject; //Textobject Ptextidcard = Fsreport.findobject ("Textidcard") as Textobject;Textbarcode = dt. rows[0]["Idcard"].                                ToString (); //(Fsreport.findobject ("Barcode2") as Barcodeobject). Text = "21000002009"; //strarray[3];(Fsreport.findobject ("Barcode2") asBarcodeobject). Text =Textbarcode; //ptextidcard.text = Textbarcode;Ptextprint.text =textnewdate;                Fsreport.show ();            Fsreport.dispose (); }            Catch(Exception err) {MessageBox.Show (err.            Message); }        }

C # winfrom Fastreport Print

Related Article

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.