Solved

Problem with exprtorting a crystal report through VB

Posted on 2004-03-22
5
859 Views
Last Modified: 2011-09-20
Hello,

This is what I'm trying to do and what I have accomplished so far. I've created a crystal report v8.5 that uses tables from SQL. I then have VB6 code that exports the report out to PDF format. This works without a hitch. I now need to also have the report pull information from a MSAccess 2000 database. I was able to add all the needed linking and the report comes up perfectly when I preview it.

The problem is this - when I use my VB code that was previously working to try and export the report nothing gets exported. The exporting records dialogs pops up like normal but the record count doesn't move and it disapears quickly. Below I have listed the VB code. I wasn't sure if this should be posted in this section or in a VB section.

CrystalReportPath = "c:\"


ReportToWebPath = "\\saveatree\routerwatch\"
ReportToWebReport = ReportToWebPath + "Electronic Log.pdf"

Report1 = CrystalReportPath + "ELog.rpt"


Rem **** Export to Disk ****
Result = PEOpenEngine()
ReportJob = PEOpenPrintJob(Report1 & vbNullChar)
Result = PEDiscardSavedData(ReportJob)
Result = crPEExportToDisk(ReportJob, ReportToWebReport & vbNullChar, "crxf_pdf.dll" & vbNullChar, 0, 0, 0, "", "")
Result = PEStartPrintJob(ReportJob, 1)
PEClosePrintJob (ReportJob)
PECloseEngine

Your help is appreciated
0
Comment
Question by:LangstonT
  • 2
  • 2
5 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 250 total points
ID: 10653079
This generally is an indication of a missing dll.

Can you view the report from the VB application?  
Can you export it from the viewer?
Is this the same code you were using to export the report before adding Access?
Is the Access database secure (need a password)?
Are all permissions correct?  Destination folder? Database?

mlmcc
0
 

Author Comment

by:LangstonT
ID: 10653574
Tomorrow first thing when I'm back at the shop I will try to view the report in the VB application. I should have mentioned in my first post that in another part of my application I open the database then delete an existing table and later add a new table. So my application does have access to the database. Perhaps I need to put a delay in after I close the database so as it can be open later through crystal.

I haven't tried opening the report in the stand alone viewer but using crystal itself the report opens and dispays as expected with data from both sources. From here I can export the report without a problem.

This is the same code I was using before adding Access.  In fact I have two copies of the report. One pointing only to the SQL based report and the other pointing to both. When I change the VB code to point to the first repot(SQL) it works. Then I change the code to point to the second report(SQL & Access) - it doesn't work.

There is no password on the database. I can open the database up and view/modify all of it contents through the access application. Then using my same system login I run my code and I get nothing.
0
 

Author Comment

by:LangstonT
ID: 10658085
I was thinking about your comment regarding permissions. I moved the access DB from the network to my local PC  and changed my code to point to the local drive. The program now works like a charm. On the network location I chose I don't have high enough permissions to perform what I'm trying to do. I can modify the contents of the database but It seems I need to be the owner of the DB.

Thanks for pointing me in the right direction.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 10664079
Glad I could help

mlmcc
0
 

Expert Comment

by:ubbott
ID: 10764890
I think problem is with the Access. Access is not a true database and due to this the records that are added in it takes some time which is greater than the time the crystal report takes to execute the report as a result nothing is displayed in the report. Try to debug and then it will show the records as while debugging the time consumption is more.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

747 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

12 Experts available now in Live!

Get 1:1 Help Now