Fastreport.net C # program State report template

Source: Internet
Author: User
Keywords Nbsp; export exe first through
Tags .net code cox data display export net print

1 referencing DLLs first in a program

Display Code Printing
Using Fastreport;
Using FASTREPORT.EXPORT.PDF;
Using Fastreport.data;
Using Fastreport.format;

2 dynamic data through the SQL State DataSet, such as:


Display Code Printing
DataSet idataset = db. Executesqlgetdataset (SQL, "Frform");
DataSet fdataset = db. Executesqlgetdataset (SQL, "Fritem");

3 Loading template Bonding data


Display Code Printing
The new ();
Cox.      Load ("Report\test.frx"); Here is the registration data for the report the second parameter represents the alias of this data in the report, which is the [frform] in the template. CName] Frform corresponding name

Cox. Registerdata (Idataset.tables[0], "frform");
Cox.          Registerdata (Fdataset.tables[0], "Fritem"); Find DataBind data must register data before it can be set

Databand data = the. Findobject ("Data1") as Databand;
Data. DataSource = the.           Getdatasource ("Frform"); If you have a subreport, you should also state the stator report

Databand Datasubreport = the. Findobject ("Data2") as Databand;
Datasubreport. DataSource = the. Getdatasource ("Fritem");
Cox. Prepare ();

Export PDF

Pdfexport export = new Pdfexport ();
Cox. Export (export, "pdf\" +datetime.now.tostring ("YYYYMMDDHHMMSS") + ". PDF");

Display

Cox. Show ();

Releasing resources

Cox. Dispose ();

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.