VB6 (SP5) and CR 8.5 Dev Problems... 
Author Message
 VB6 (SP5) and CR 8.5 Dev Problems...

Hi All:

I am having several issues with the above setup.

Here is the skinny on the worst one (IMHO)...

I have the following code set up with the CRViewer:
(WARNING - LONG POST!!!)

Dim crApp As New CRAXDRT.Application
Dim crRpt As CRAXDRT.Report
Dim SQL As String
Dim i As Integer

Private Sub CRView_CloseButtonClicked(UseDefault As Boolean)
     Set crRpt = Nothing
     Set crApp = Nothing
End Sub

Private Sub CRView_ExportButtonClicked(UseDefault As Boolean)
     'Constant Procedure name
     Const PROCEDURE_NAME As String = "CRView_ExportButtonClicked"
     'If an error occurs, go to the Handler
     On Error GoTo ERROR_HANDLER

'    CRView.ReportSource = crRptEx
     With crRpt
         .ExportOptions.DestinationType = crEDTDiskFile
         .ExportOptions.DiskFileName = App.Path & "\Data\" & GetProperName
& " Estiamte.PDF"
         .ExportOptions.formatType = crEFTPortableDocFormat
         .ExportOptions.PDFExportAllPages = True
     End With
     crRpt.Export False

     Exit Sub
'The error handler
ERROR_HANDLER:
     If Err.Number = 3021 Then
         Err.Clear
         'Exit Sub
         Resume Next
     Else
         ErrMsg Err.Number, Me.name, PROCEDURE_NAME, True
         If Err.Number = 3706 Then
             'No provider
             Unload Me
             Exit Sub
         End If
         Err.Clear
     End If
     Resume Next
End Sub

Private Sub CRView_PrintButtonClicked(UseDefault As Boolean)
     'Constant Procedure name
     Const PROCEDURE_NAME As String = "CRView_PrintButtonClicked"
     'If an error occurs, go to the Handler
     On Error GoTo ERROR_HANDLER

     crRpt.PrintOut False

     Exit Sub
'The error handler
ERROR_HANDLER:
     If Err.Number = 3021 Then
         Err.Clear
         'Exit Sub
         Resume Next
     Else
         ErrMsg Err.Number, Me.name, PROCEDURE_NAME, True
         If Err.Number = 3706 Then
             'No provider
             Unload Me
             Exit Sub
         End If
         Err.Clear
     End If
     Resume Next
End Sub

Private Sub Form_Load()
     'Constant Procedure name
     Const PROCEDURE_NAME As String = "Form_Load"
     'If an error occurs, go to the Handler
     On Error GoTo ERROR_HANDLER

     'initialize the global variables
     Me.Caption = Me.Caption & " " & GetCurName
     Set crRpt = crApp.OpenReport(App.Path & "\Data\Estimate.rpt")
     For i = 1 To crRpt.Database.Tables.Count
         crRpt.Database.Tables(i).SetLogOnInfo "", "", "", "mortar"
     Next
     crRpt.RecordSelectionFormula = "{Estimate.CustID_FK}= " & intCustID
     CRView.ReportSource = crRpt

     CRView.ViewReport
     Exit Sub
'The error handler
ERROR_HANDLER:
     If Err.Number = 3021 Then
         Err.Clear
         'Exit Sub
         Resume Next
     Else
         ErrMsg Err.Number, Me.name, PROCEDURE_NAME, True
         If Err.Number = 3706 Then
             'No provider
             Unload Me
             Exit Sub
         End If
         Err.Clear
     End If
     Resume Next
End Sub

I can see the report in the viewer just fine, but when I click on exoprt it:
        1) Exports as I would expect
        2) Asks what type of Export/File Destination, as if I never did anything

How can I kill step #2 from happening?

After either exporting or printing I want to have the viewer close
auto-magically. I am lost as to how to do that.

Next issue:
My main environment is a W2K SP2 machine. Occassionaly I must work from
home. I put the code directory (Everything is under one subdir/folder) onto
my WinME laptop, and everything EXCEPT the CRViewer is working.

It loads and runs, but when I click the ""Print" button (cwhich calles the
above form) I get a :
Error Opening File.

File could not be found: "Estimate". at location: "Estimate"

I am confused. NOTHING is different outside of the OS/ I am using the same
instalkl of CR and VB6 SP5! :-(

Help?!?!?!

Thank you,
Chris Anderson



Sat, 30 Jul 2005 08:35:41 GMT  
 VB6 (SP5) and CR 8.5 Dev Problems...
Hiy

Hi Chris.

First issue:
Not sure if its possible to catch and then cancel the export event
once crystal has fired it.  Sub classing the viewer might work but
thats all a bit beyond me.  To get round this problem i have a form
with a menu on it and crystal viewer. On the menu i have an export
option so i can control exactly what happens with they want to export.
I then disable the export button of the toolbar of the viewer.
This manu also provides the user the ability to navigate the viewer
options using the keyboard. handy.

hope this helps

Duncan

Oh yer seound issue err, duh, havent got a clue.

On Mon, 10 Feb 2003 18:35:41 -0600, cdanders

Quote:

>Hi All:

>I am having several issues with the above setup.

>Here is the skinny on the worst one (IMHO)...

>I have the following code set up with the CRViewer:
>(WARNING - LONG POST!!!)

>Dim crApp As New CRAXDRT.Application
>Dim crRpt As CRAXDRT.Report
>Dim SQL As String
>Dim i As Integer

>Private Sub CRView_CloseButtonClicked(UseDefault As Boolean)
>     Set crRpt = Nothing
>     Set crApp = Nothing
>End Sub

>Private Sub CRView_ExportButtonClicked(UseDefault As Boolean)
>     'Constant Procedure name
>     Const PROCEDURE_NAME As String = "CRView_ExportButtonClicked"
>     'If an error occurs, go to the Handler
>     On Error GoTo ERROR_HANDLER

>'    CRView.ReportSource = crRptEx
>     With crRpt
>         .ExportOptions.DestinationType = crEDTDiskFile
>         .ExportOptions.DiskFileName = App.Path & "\Data\" & GetProperName
>& " Estiamte.PDF"
>         .ExportOptions.formatType = crEFTPortableDocFormat
>         .ExportOptions.PDFExportAllPages = True
>     End With
>     crRpt.Export False

>     Exit Sub
>'The error handler
>ERROR_HANDLER:
>     If Err.Number = 3021 Then
>         Err.Clear
>         'Exit Sub
>         Resume Next
>     Else
>         ErrMsg Err.Number, Me.name, PROCEDURE_NAME, True
>         If Err.Number = 3706 Then
>             'No provider
>             Unload Me
>             Exit Sub
>         End If
>         Err.Clear
>     End If
>     Resume Next
>End Sub

>Private Sub CRView_PrintButtonClicked(UseDefault As Boolean)
>     'Constant Procedure name
>     Const PROCEDURE_NAME As String = "CRView_PrintButtonClicked"
>     'If an error occurs, go to the Handler
>     On Error GoTo ERROR_HANDLER

>     crRpt.PrintOut False

>     Exit Sub
>'The error handler
>ERROR_HANDLER:
>     If Err.Number = 3021 Then
>         Err.Clear
>         'Exit Sub
>         Resume Next
>     Else
>         ErrMsg Err.Number, Me.name, PROCEDURE_NAME, True
>         If Err.Number = 3706 Then
>             'No provider
>             Unload Me
>             Exit Sub
>         End If
>         Err.Clear
>     End If
>     Resume Next
>End Sub

>Private Sub Form_Load()
>     'Constant Procedure name
>     Const PROCEDURE_NAME As String = "Form_Load"
>     'If an error occurs, go to the Handler
>     On Error GoTo ERROR_HANDLER

>     'initialize the global variables
>     Me.Caption = Me.Caption & " " & GetCurName
>     Set crRpt = crApp.OpenReport(App.Path & "\Data\Estimate.rpt")
>     For i = 1 To crRpt.Database.Tables.Count
>         crRpt.Database.Tables(i).SetLogOnInfo "", "", "", "mortar"
>     Next
>     crRpt.RecordSelectionFormula = "{Estimate.CustID_FK}= " & intCustID
>     CRView.ReportSource = crRpt

>     CRView.ViewReport
>     Exit Sub
>'The error handler
>ERROR_HANDLER:
>     If Err.Number = 3021 Then
>         Err.Clear
>         'Exit Sub
>         Resume Next
>     Else
>         ErrMsg Err.Number, Me.name, PROCEDURE_NAME, True
>         If Err.Number = 3706 Then
>             'No provider
>             Unload Me
>             Exit Sub
>         End If
>         Err.Clear
>     End If
>     Resume Next
>End Sub

>I can see the report in the viewer just fine, but when I click on exoprt it:
>    1) Exports as I would expect
>    2) Asks what type of Export/File Destination, as if I never did anything

>How can I kill step #2 from happening?

>After either exporting or printing I want to have the viewer close
>auto-magically. I am lost as to how to do that.

>Next issue:
>My main environment is a W2K SP2 machine. Occassionaly I must work from
>home. I put the code directory (Everything is under one subdir/folder) onto
>my WinME laptop, and everything EXCEPT the CRViewer is working.

>It loads and runs, but when I click the ""Print" button (cwhich calles the
>above form) I get a :
>Error Opening File.

>File could not be found: "Estimate". at location: "Estimate"

>I am confused. NOTHING is different outside of the OS/ I am using the same
>instalkl of CR and VB6 SP5! :-(

>Help?!?!?!

>Thank you,
>Chris Anderson



Sat, 30 Jul 2005 19:43:53 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Is anyone in here skilled with CR 8.5 DEV, VB 6 and Windows NT enviro

2. Hlp on CR 8.5 and VB 6.0 sp5

3. Decimal Place problem after Upgrading from CR 6 to CR 8.5

4. Crystal reports 8.5 and VB6 SP5

5. Is anyone in here skilled with CR 8.5 DEV, VB 6 sp5 and Windows XP pro ?

6. Need Help CR 8.5 + VB6

7. VB6 and CR 8.5 Server has not yet been opened

8. CR 8.5 Crashes in VB6 (ole32.dll)

9. CR 8.5 developer crashes machine in VB6

10. VB6 and CR 8.5 integration

11. CR 8.5 and CR from VS.Net package

12. CR 8 and CR 8.5

 

 
Powered by phpBB® Forum Software