Le code source n?est pas à moi,
Mais j?ai penser à ce qui cherche des exemples de code source avec crystal report.
Tout est dans le zip
Info : les commentaires sont en anglais
Les ActiveX crystal report sont inclus dans le zip
Décompresser le fichier zip « Report Variables.zip » en suite le fichier « ActiveXViewer.cab »
Source / Exemple :
Formulaire N°1 Nom: FrmMain
' *************************************************************
' Purpose: Demonstrate how to use Report Variables (new to Crystal Reports 8.0)
' See the code CRReportVariables for a detailed explanation
' of the sample
Option Explicit
Dim m_Report As New CRReportVariables
Dim m_Connection As ADODB.Connection
Dim adoRS As ADODB.Recordset
' *************************************************************
' Load the Report in the viewer
'
Private Sub Form_Load()
Dim SQL As String
Dim strConnect As String
' Create and bind the ADO Recordset object
Set m_Connection = New ADODB.Connection
Set adoRS = New ADODB.Recordset
' Open the connection
strConnect = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=" & App.Path & "\ReportVariables.mdb;Mode=Read"
m_Connection.Open strConnect
SQL = "Select * from tblSampleData"
adoRS.Open SQL, m_Connection, adOpenDynamic, adLockBatchOptimistic
m_Report.Database.SetDataSource adoRS
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = m_Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
End Sub
Private Sub Form_Resize()
Dim iTop As Integer
Dim iAdjustment As Integer
'If Toolbar.Visible Then
' iTop = Toolbar.Height
' iAdjustment = Toolbar.Height + StatusBar.Height
'Else
' iTop = 0
' iAdjustment = StatusBar.Height
'End If
Debug.Assert Me.Height > iAdjustment
CRViewer1.Top = iTop
CRViewer1.Left = 0
CRViewer1.Height = Me.Height - iAdjustment
CRViewer1.Width = Me.Width
End Sub
' *************************************************************
Private Sub cmdAbout_Click()
frmAbout.Show vbModal
End Sub
' *************************************************************
Private Sub cmdExit_Click()
Unload Me
End Sub
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.