Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB6
Running the vb application crviewer comes blank.Msg-server not yet opened
Whereas in crystal report application i can view the new added data.
 
sqlserver2000
vb-6
crystal report 8
Operating system -x.p
 
crviewer Err- server not yet opened
 

Private Sub CmdPrint_Click()
Dim crystal As CRAXDRT.Application 'LOADS REPORT FROM FILE
Dim report As CRAXDRT.report       'HOLDS REPORT
Set crystal = New CRAXDRT.Application           'MANAGES REPORTS
Set report = crystal.OpenReport(VarRptPath)
report.DiscardSavedData
 
'report.Database.SetDataSource rs
report.Database.Tables(1).SetLogOnInfo SrvIp, SrvDb, VarRptuser, VarRptPass
report.SQLQueryString = VarstrString
report.PrintOut False
Set report = crystal.OpenReport(VarRptPath)
 
Set crystal = Nothing
Set report = Nothing
End Sub
Private Sub Form_Activate()
Dim crystal As CRAXDRT.Application 'LOADS REPORT FROM FILE
Dim report As CRAXDRT.report       'HOLDS REPORT

On Error GoTo Rpterr
 
CRViewer.DisplayBorder = False          'MAKES REPORT FILL ENTIRE FORM
CRViewer.DisplayTabs = False            'THIS REPORT DOES NOT DRILL DOWN, NOT NEEDED
CRViewer.EnableDrillDown = False        'REPORT DOES NOT SUPPORT DRILL-DOWN
CRViewer.EnableRefreshButton = False    'ADO RECORDSET WILL NOT CHANGE, NOT NEEDED

 
Set crystal = New CRAXDRT.Application           'MANAGES REPORTS
Set report = crystal.OpenReport(VarRptPath)
 
'CLEARS REPORT SO WE WORK FROM RECORDSET
report.DiscardSavedData
 
'report.Database.SetDataSource rs
report.Database.Tables(1).SetLogOnInfo SrvIp, SrvDb, VarRptuser, VarRptPass
report.SQLQueryString = VarstrString
 
CRViewer.ReportSource = report  'LINK VIEWER TO REPORT
CRViewer.ViewReport             'SHOW REPORT

Do While CRViewer.IsBusy         'ZOOM METHOD DOES NOT WORK WHILE
   DoEvents                      'REPORT IS LOADING, SO WE MUST PAUSE
Loop                             'WHILE REPORT LOADS.

CRViewer.Zoom 94
 
' Clean up all rsources

RptCon.Close
Set crystal = Nothing
Set report = Nothing
 
CmdPrint.SetFocus
 
Rpterr:
 
If Err.Number <> 0 Then
    'MsgBox Err.Description
End If
 
End Sub
Posted 30-Jan-13 19:03pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 490
1 Maciej Los 299
2 BillWoodruff 174
3 /\jmot 170
4 Suraj Sahoo | Coding Passion 150
0 OriginalGriff 8,484
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,159
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 31 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100