About Crystal Report 10 Word report data fill and display

Source: Internet
Author: User
Tags copy
Data | Crystal Report | show | Crystal Report

Crystal Report 10 version, no longer on the Crystal Report 9 as automatically help you to the subreport set Recordset, you need to add yourself in the program

protected CrystalDecisions.Web.CrystalReportViewer CrystalReportViewer1;

DataSet Newds = new DataSet ();

。 Get the data set of the report set to Newsds

DataSet dstmain=biz. Getdatasetlist (Pstart, Pend, pstorename);
NEWSDS.TABLES.ADD (Dstmain.tables[0]. Copy ());//Add the main report dataset

DataSet dstPOS1 = new DataSet ();
DataSet dstPOS2 = new DataSet ();
DstPOS1 = biz. Getdatasetlist (Pstart, Pend, pStoreName1);
DstPOS2 = biz. Getdatasetlist (Pstart, Pend, pStoreName2);
NEWSDS.TABLES.ADD (Dstpos1.tables[0]. Copy ());//Add Child report DataSet
NEWSDS.TABLES.ADD (Dstpos2.tables[0]. Copy ());//Add Child report DataSet

Type M_report_type = M_assembly.gettype (reportclassname);//reportclassname is the report name
Object AA = M_assembly.createinstance (m_report_type. FullName);
ReportClass reportengine = (reportclass) m_assembly.createinstance (M_report_type. FullName);

for (int i=1;i<newds.tables.count;i++)//To assign a value to a subreport
{
Reportdocument Osubreport=reportengine.subreports[i-1];
Osubreport.setdatasource (Newds);
}

Reportengine.setdatasource (Newds);
Crystalreportviewer1.reportsource = Reportengine;
Return




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.