cs_adilos77
Messages postés10Date d'inscriptionsamedi 28 octobre 2006StatutMembreDernière intervention13 juin 2007
-
8 févr. 2007 à 13:15
gaa179
Messages postés361Date d'inscriptionmercredi 21 mai 2003StatutMembreDernière intervention12 novembre 2009
-
9 févr. 2007 à 09:53
pour qu'un fichier crystal report soit sychronise avec les données d'une table je suis chq fois obligé d'ouvrir le fichier crystal et rafraichir on cliquant sur une icone d'eclat, alors si vous avez un programme en vb6 qui facilite la tache je serai tres reconnaissant et merci
gaa179
Messages postés361Date d'inscriptionmercredi 21 mai 2003StatutMembreDernière intervention12 novembre 20092 9 févr. 2007 à 09:53
J'utilise CR 8.5
Dans un form j'ai l'activeX CRViewer.
J'utilise la fonction suivante pour afficher différents états dans le formulaire:
Public Sub PrintFrm(ByVal ReportFile As String, WindowTitle As String, Optional RecordSelector As String, Optional PrintReport As Boolean False, Optional ReportHeader As Boolean False, Optional ExportEnable As Boolean = False, Optional ReportLandscape As Boolean = False)
On Error GoTo Err_Print
Dim crystal As New CRAXDDRT.Application
Dim Report As New CRAXDDRT.Report
Dim MyRsSubRep As New ADODB.Recordset
Dim StrSql As String
Set Report = crystal.OpenReport(App.Path & "\Report" & ReportFile & ".rpt")
If ReportHeader Then Report.ReportTitle = WindowTitle
'Sélection de l'imprimante
If ReportFile = "Ticket" Then
Report.SelectPrinter Printers(PrinterTicket).DriverName, Printers(PrinterTicket).DeviceName, Printers(PrinterTicket).Port
Else
Report.SelectPrinter Printers(PrinterA4).DriverName, Printers(PrinterA4).DeviceName, Printers(PrinterA4).Port
End If
If ReportLandscape Then Report.PaperOrientation = crLandscape
If RecordSelector <> "" Then Report.RecordSelectionFormula = RecordSelector
If PrintReport Then
Report.ReadRecords 'Refresh
Report.PrintOut False
Else
'FrmPrint.Show vbModal
With FrmPrint.CRViewer1
.ReportSource = Report
.ViewReport 'SHOW REPORT
Do While .IsBusy 'ZOOM METHOD DOES NOT WORK WHILE
DoEvents 'REPORT IS LOADING, SO WE MUST PAUSE
Loop 'WHILE REPORT LOADS.