Solved

Problem with exprtorting a crystal report through VB

Posted on 2004-03-22
5
862 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

803 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