Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 970
  • Last Modified:

Run-time error '-2147417848 (80010108)': error seen on export of Crystal report from VB6

I have  strange problem, I am using Crystal 8.5 developer to export some reports using a vb6 project. I have one chunk of code that used to work, but now it wont.

When I attempt to run the code I get this error:
Run-time error '-2147417848 (80010108)':
Method 'Export' of object 'crptBB24Brief' failed

If I immediately run it again it runs fine. when I go the third it fails, 4th it works etc....

here is the code, the strange thing is that the one above it works fine each time.

                'Creates the Blackberry CAD Status Web Page
'                        crptBBCadStatus.ExportOptions.HTMLFileName = ("\\Nt500901\pdf\BBPages\BBCadStatus.html")
'                        crptBBCadStatus.ExportOptions.FormatType = crEFTHTML32Standard
'                        crptBBCadStatus.ExportOptions.DiskFileName = ("\\Nt500901\pdf\BBPages\BBCadStatus.html")
'                        crptBBCadStatus.ExportOptions.DestinationType = crEDTDiskFile
'                        crptBBCadStatus.Export (False)

                'Creates the Blackberry 24 hour briefing page
                        crptBB24Brief.ExportOptions.HTMLFileName = ("\\Nt500901\pdf\BBPages\BB24Brief.html")
                        crptBB24Brief.ExportOptions.FormatType = crEFTHTML32Standard
                        crptBB24Brief.ExportOptions.DiskFileName = ("\\Nt500901\pdf\BBPages\BB24Brief.html")
                        crptBB24Brief.ExportOptions.DestinationType = crEDTDiskFile
                        crptBB24Brief.Export (False)

My typing is all correct, I just can't seem to see why this works once and then fails and so on... When I debug it goes right to the line crptBB24Brief.Export (False)

0
DavidNPD
Asked:
DavidNPD
  • 5
  • 4
1 Solution
 
mlmccCommented:
It goes to that line because the error occurs when you export.

How did you declare the report objects?
http://support.businessobjects.com/library/kbase/articles/c2002243.asp

If you are using the OCX this may be the problem
http://support.businessobjects.com/library/kbase/articles/c2010578.asp

mlmcc

0
 
DavidNPDAuthor Commented:
but would this explain why one works absolutley fine and the other only works every other time?
0
 
mlmccCommented:
Don't know.  It might.

What is the rest of the code?

What OS and database?

mlmcc
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
DavidNPDAuthor Commented:
I took a look at those two papers, I am not using the OCX, so it is not the first, and I am on Crystal 8.5 Developer, that paper states it only effects Crystal 6.0 Pro. The first one dealt with MAPI also, I mail the report out later in the app, right now I am just trying to create a Web page on a network location.

Security and names all seem fine, as the working report is going to the same location.

I am running this on Winxp, against a SQl database. The code has worked in the past, I am not really sure what I did to change it. I make modifications to the actual reports outside vb in Crystal and then I re-import them in again. During one of those updates is when it went wrong. I have tried changing that report having the problem. Stripiing it down and re-running it. No help.
I actually had this problem when I first started using this app and put a message up here asking for help, I then went back into the app to try to figure it out and it started working, no idea why, since that time I have had no problems until just recently. Here is the code I am using, I ma not real versed in VB, it was taken from a Crystal help book CD and modified to meet my needs, so I am not really very knowledgable on it.



Option Explicit
    Public crptCallTypes As CRAXDRT.Report


  Private Sub Form_Load()
   
' On Error GoTo ErrHandler
    Screen.MousePointer = vbHourglass
    Screen.MousePointer = vbDefault

'' This gets the Department Name from the Control Table
    'GetDepartment
        'frmScheduler.Caption = m_strDepartment


 
  'This runs the Cad Status Report for the BlackBerries and exports it to "BBCadStatus.html"
  'This should be reenabled to Make a BBCadStatus.exe for the 5 Minute refresh of the Cad status page.

                'Creates the Blackberry CAD Status Web Page
'                        crptBBCadStatus.ExportOptions.HTMLFileName = ("\\Nt500901\pdf\BBPages\BBCadStatus.html")
'                        crptBBCadStatus.ExportOptions.FormatType = crEFTHTML32Standard
'                        crptBBCadStatus.ExportOptions.DiskFileName = ("\\Nt500901\pdf\BBPages\BBCadStatus.html")
'                        crptBBCadStatus.ExportOptions.DestinationType = crEDTDiskFile
'                        crptBBCadStatus.Export (False)

                'Creates the Blackberry 24 hour briefing page
                        crptBB24Brief.ExportOptions.HTMLFileName = ("\\Nt500901\pdf\BBPages\BB24Brief.html")
                        crptBB24Brief.ExportOptions.FormatType = crEFTHTML32Standard
                        crptBB24Brief.ExportOptions.DiskFileName = ("\\Nt500901\pdf\BBPages\BB24Brief.html")
                        crptBB24Brief.ExportOptions.DestinationType = crEDTDiskFile
                        crptBB24Brief.Export (False)



        'Exit the App
            End

End Sub

0
 
DavidNPDAuthor Commented:
'The basic form I used to start this app, brought up the following report crptcallTypes" when you click a button. It 'is not really used in this aspect of it, but that was the original app. It always worked so I didnt change anything 'here.

Option Explicit
    Public crptCallTypes As CRAXDRT.Report
0
 
DavidNPDAuthor Commented:
I dont know if this would help, but I just went into the app, and made several attempts to run it, this is what happened:

Clicked on run: Error came up, then clicked end.
Clicked on run: Error came up, then clicked end.
        Clicked on run: App ran fine and report went out.
Clicked on run: Error came up, then clicked end.
         Clicked on run: App ran fine and report went out.
Clicked on run: Error came up, then clicked end.
          Clicked on run: App ran fine and report went out.
Clicked on run: Error came up, then clicked end.
Clicked on run: Error came up, then clicked end.
Clicked on run: Error came up, then clicked end.
Clicked on run: Error came up, then clicked end.
Clicked on run: Error came up, then clicked end.
etc.. etc...

If this runs sometimes, I assume that my report itself is OK, my typing is OK, permissions are OK, and the actual code is OK.......
0
 
mlmccCommented:
Here is the code I use.  I use private variables, not sure if that makes a difference or not but I doubt it.

Option Explicit
    Private crApp As CRAXDRT.Application
    Private crRpt As CRAXDRT.Report
'
'   Open report
'
    Set crApp = New CRAXDRT.Application

    Set crRpt = crApp.OpenReport(txtReportName, 1)
'
' Set the viewer's report source to the Report object
'  YOUR EXPORT CODE GOES HERE and these lines are gone
'
    Me.rptCRViewer.ReportSource = crRpt
    Me.rptCRViewer.ViewReport
    Me.Show

    Exit Sub

The only thing I see really different is my use of the Crystal application.  You mught add it.

mlmcc
0
 
DavidNPDAuthor Commented:
mlmcc, thank for all the help, but in the end i couldnt get this working. I ended up taking the report that was working copying it and modifying entrirely inside the VB app to be the same as the one that was not working. It is working fine now, i just have no idea why. I made no code changes at all I just changed the report.
0
 
mlmccCommented:
Sometimes that is the solution.  

Glad I could help

mlmcc
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now