Solved

VB code for Exprorting a Crystal report to Lotus Notes Data Base

Posted on 2001-07-20
1
424 Views
Last Modified: 2007-11-27
I am trying to export a crystal report to Lotus Notes data
base using API calls. And I am getting a 541 error.
I am Using this code.
I added crwrap32.dll,global32.dll to my project.
rc = PEOpenEngine()
If rc <> 1 Then
     rc = PEGetErrorCode(0)
     MsgBox rc
    End If
    ReportPath = "reportpath"
    pj = PEOpenPrintJob(ReportPath & "ReportName.rpt")
    If pj <> 1 Then
         pj = PEGetErrorCode(pj)
         MsgBox pj
    End If
    '********Export to notes data base
    myDatabse = "\\Server\database.nsf"
    myForm = "Report Form"
    myComments = "test"
    myDLL = "U2FRTF.DLL"
    myformatType = crUXFRichTextFormatType
    UseSameNumberFormat = 0
    UseSameDateFormat = 0
    StringDelimiter = ""
    FieldDelimiter = ""
rc = PELogOnServer("P2sodbc.dll", LogOnInfo)
    rc = PEGetErrorCode(rc)
    rc = crPEExportToNotes(pj, myDatabse, myForm, myComments, myDLL, myformatType, _
            UseSameNumberFormat, UseSameDateFormat, StringDelimiter, FieldDelimiter)
    If rc <> 1 Then
         rc = PEGetErrorCode(pj)
         MsgBox rc
    Else
         rc = PEStartPrintJob(pj, True)
         If rc <> 1 Then
             rc = PEGetErrorCode(pj)
             MsgBox rc
        Else
             MsgBox " Exporting is done "
         End If
    End If
    PEClosePrintJob (pj)
    PECloseEngine
Can any body tell me where I am Going wrong.
Thanks
0
Comment
Question by:Regulapati
1 Comment
 
LVL 12

Accepted Solution

by:
DRRYAN3 earned 200 total points
ID: 6304047
What version of CRW are you using, 8.5?  At what point in your code are you getting the 541 error (Error In Export DLL)?  

Try using the crPEExportOptions and crPEExportTo instead of the crPEExportToNotes call.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now