Use five different methods to load a crystal report (Windows form)

Source: Internet
Author: User

1, code download: http://support.crystaldecisions.com/communityCS/FilesAndUpdates/vbnet_win_simplepreviewreport.exe.asp? Recdnlreq1_record&dnlpath=vbnet_win_simplepreviewreport.exe

2. Five types of reports used as viewer. reportsource:

-Use report name (via text path)
-Use the report object (via text path)
-Use non-type report components (via text path and reportdocument reportdocument1)
-Use the report object (by using the report file that has been added to the project, for example, World sales report. rpt)
-Use the strongly typed report component () (via reportdocument world_sales_report1)
 
Note: The report component is "toolbox"-> "component"-> "reportdocument"

3. Code introduction:
-Use report name (via text path)
Crystalreportviewer1.reportsource = "C:/crystal/crnet/vbnet_win_simplepreviewreport/World sales report. rpt"
'--------------------------------------------------------------------
-Use the report object (via text path)
Dim crreportdocument as new crystaldecisions. crystalreports. Engine. reportdocument ()
Crreportdocument. Load ("C:/crystal/crnet/vbnet_win_simplepreviewreport/World sales report. rpt ")
Crystalreportviewer1.reportsource = crreportdocument
'--------------------------------------------------------------------
-Use non-type report components (via text path and reportdocument reportdocument1)
Dim reportdocument1 as new crystaldecisions. crystalreports. Engine. reportdocument ()
Reportdocument1.load ("C:/crystal/crnet/vbnet_win_simplepreviewreport/World sales report. rpt ")
Crystalreportviewer1.reportsource = reportdocument1
'--------------------------------------------------------------------
-Use the report object (by using the report file that has been added to the project, for example, World sales report. rpt)
Crystalreportviewer1.reportsource = new world_sales_report ()
'--------------------------------------------------------------------
-Use the strongly typed report component () (via reportdocument world_sales_report1)
Crystalreportviewer1.reportsource = world_sales_report1

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.