Easy implementation of the report set of VBC #

zhaozj2021-02-16  113

Keywords: VB C # Report? Set of playing

Microsoft's Crystal Report is a very good report tool. Today I want to talk to you if you use the Crystal Report provided in VB 60 In VB, please make the setup function of the report. Crystal report 9 as an example

Craxddd9.dll

CRAXDDRT9_RES_CHS.DLL

CRDESIGNERCTRL.DLL

CRDESIGNERCTRL_RES_CHS.DLL

The above four DLLs will exist in your system environment after you install crystal 9. You can directly reference these DLLs directly in the VB project.

, Or select "Reystal Reports 9 ActiveX? Designer Run Time? Library", "" "in the reference checkbox list." "

"Reystal Reports 9 ActiveX? Designer Design and? Runtime? library

Then add a combiner to add a ComperNent selected "Embeddedle Crystal Report 9 Designer Control"

After adding the toolbox, there is a CRDesignerCtrl

The OK environment has, then we can embed the design interface of the Crystal Report to our VB program.

The program results are as follows:

DESIGN

Brief introduction how to open a RPT file into the design interface

code show as below

[VB 6]

PRIVATE SUB Command1_Click () DIM F_NAME AS STRINGDIM M_APPLICATION AS New Craxdddrt.ApplicationDim M_Report As New Craxddrt.Report

reportPath = ""? Me.CommonDialog1.ShowOpen? reportPath = Me.CommonDialog1.FileNameIf reportPath <> "" Then ?? Set m_Report = m_Application.OpenReport (reportPath, 0) ??? Me.CRDesignerCtrl1.ReportObject = m_ReportEnd IfEnd Sub

CRDESignerCtrl1 is the report design control we have added earlier.

[c #]

??????????? craxddrt.application m_application = new craxddrt.Applicationclass (); ??????????? Craxddrt.report m_report; ??????????? This.openfileDialog1.showdialog (); ???????????? f_name = this.openfiledialog1.filename.toString (); ???????????????? m_report = m_application .OpenReport (f_name, 0); ??????????? this.axcrdesignerCtrl1.reportObject = m_report; ??????????? this.axcrdesignerCtrl1.displayfieldView = false;

#end

I hope you will support it!

The above code is just a rough demo.

I hope to discuss the DOTNET technology with you. QQ: 14754875 Forum: http://www.shixm.com/bbs

转载请注明原文地址:https://www.9cbs.com/read-10402.html

New Post(0)