Solved

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

Posted on 2001-07-20
1
426 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

920 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

20 Experts available now in Live!

Get 1:1 Help Now