Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problem with exprtorting a crystal report through VB

Posted on 2004-03-22
5
Medium Priority
?
869 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 101

Accepted Solution

by:
mlmcc earned 1000 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 101

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Loops Section Overview
Suggested Courses

916 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