Solved

Problem with exprtorting a crystal report through VB

Posted on 2004-03-22
5
865 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

734 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