-- Set the print FUNCTION OF THE CRYSTAL REPORT
Crystalreportviewer1.printmode = crystaldecisions. Web. printmode. ActiveX
-- Set the relative path of the crystal report file
Crystalreportsource1.reportdocument. Load (server. mappath ("XXX. rpt "))
-- Set the data source of the Crystal Report
Crystalreportsource1.reportdocument. setdatasource (Ds. Tables ("XXX "))
-- Set the input parameters of the Crystal Report
Crystalreportsource1.reportdocument. parameterfields ("parameter name in the Crystal Report"). currentvalues. addvalue (input parameter value)
-- Bind data to a crystal report
Crystalreportsource1.databind ()
Crystalreportviewer1.databind ()
-- Whether the crystal report is visible
Crystalreportviewer1.visible = true
-- Scroll bar OF THE CRYSTAL REPORT
Crystalreportviewer1.bestfitpage = true
-- Crystal report company logo visible
Crystalreportviewer1.hascrystallogo = true
-Searching for Crystal Reports
Crystalreportviewer1.hassearchbutton = true
-- Crystal report printing function
Crystalreportviewer1.hasprintbutton = true
-- Export Crystal Reports
Crystalreportviewer1.hasexportbutton = true
-- Tree function of the crystal report Toolbar
Crystalreportviewer1.hastogglegrouptreebutton = true
-- Display or hide the View list (main report) on the toolbar)
Crystalreportviewer1.hasviewlist = true
-- Get or set the visibility of the light button (up)
Crystalreportviewer1.hasdrillupbutton = true
-- Display or hide the navigation button on the toolbar
Crystalreportviewer1.haspagenavigationbuttons = true
-- Display or hide the jump button on the toolbar
Crystalreportviewer1.hasgotopagebutton = true
-- Display or hide the zoom button on the toolbar
Crystalreportviewer1.haszoomfactorlist = true
-- Filter Formula
Crystalreportviewer1.selectionformula = "{customer. Last year's sales}> 11000.00" + "and mid ({customer. Customer name}, 1, 1) = \" \""
-- Display or hide the toolbar
Crystalreportviewer1.displaytoolbar = true
-- Display or hide a group tree
Crystalreportviewer1.displaygrouptree = true
-- Display or hide the page view
Crystalreportviewer1.displaypage = true
-- Obtain or set whether the report page is separated or connected?
Crystalreportviewer1.separatepages = true
-- Set the Border Width
Crystalreportviewer1.borderwidth = convert. toint32 ("borderwidth ")
-- Jump page
Crystalreportviewer1.shownthpage (convert. toint32 ("pagenumber "))
-- Zoom
Crystalreportviewer1.zoom (convert. toint32 ("zoomfactor "))
-- The length of the Crystal Report Toolbar
Crystalreportviewer1.toolbarstyle. width = new unit ("1000px ")
-- The first page of the Crystal Report
Crystalreportviewer1.showfirstpage ()
-- The last page of the Crystal Report (first take the first page, then the last page, and then take the first page to ensure that the crystal report can continuously jump to the next page, and the total number of pages is completely displayed)
Crystalreportviewer1.showlastpage ()
Crystalreportviewer1.showfirstpage ()
-- The Crystal Report contains multiple pages of data. When you click the next page, the page continues to jump to the second page.
Solution: bind the data of the crystal report to the init event of the page.