Solved

Crystal viewer control, EnableExport function ??

Posted on 2001-08-10
8
313 Views
Last Modified: 2008-02-01
Hi
I am using crystal 8 and the viewer control to view the reports (VB program).
The problem that I am having is that when I enable the EnableExportButton, the program lets the user go through the various export options, but the output file it creates is empty.
This is really critical to us and I will be very grateful for all possible answers.

Thank You
0
Comment
Question by:mer1mer1
  • 4
  • 4
8 Comments
 
LVL 12

Expert Comment

by:DRRYAN3
ID: 6373418
mer1mer1

Welcome to EE.

Generally, the type of problem you are experiencing is caused by missing DLLs on the user's workstation.  When you package and distribute your VB application, certain DLLs should be added to your package for installation in the c:\windows\crystal subdirectory.

For full details on what to include, see the help file "C:\Program Files\Seagate Software\Crystal Reports\Developer Files\Help\runtime.hlp" under the Exporting topic.

If this is not the solution to your problem, let me know.

DRRYAN3
0
 

Author Comment

by:mer1mer1
ID: 6374063
Hi DRRYAN3

Thank you for your quick response.
I have looked at the help files and the information you provided is very useful, but not at the moment.

I am having this problem running the reports in developement environment.

When I am using Crystal Reports, the export function works from within crystal. With CRViewer in development it will not work.

I am still clueless.

mer1mer1
0
 
LVL 12

Expert Comment

by:DRRYAN3
ID: 6374102
mer1mer1

A simple example might help isolate the trouble.  Create a new project in VB.  Add the following to the project references:

  Crystal Report Viewer Control
  Crystal Report 8 ActiveX Designer Run Time Library

Put a "Crystal Report Viewer Control" on your form and size it to fill most of the form.  Make sure its name is CRViewer1 (the default).  Add a button to the form and put this code in the click event of the button:

  Dim crApp As New CRAXDRT.Application
  Dim crRep As CRAXDRT.Report
  ' load a standalone report created in the designer
  ' Replace my name with your report name
  Set crRep = crApp.OpenReport("c:\crw_samples\standalone.rpt")
  CRViewer1.EnableExportButton = True
  CRViewer1.ReportSource = crRep
  ' print preview
  CRViewer1.ViewReport

Your report should be a standalone, simple report that works correctly in the designer.

Run this and see if you have the same problem.  Try to export to a Disk File (any format).  Let me know where it fails or is successful on the export.

DRRYAN3
0
 

Author Comment

by:mer1mer1
ID: 6374201
DRRYAN3

Unfortunately I do not have good news.
I tried a simple report that has text messages in the detail line and no connection to any database, and I can view it in the VB program, but the export functionality does not work.

When I use the export functionality within Crystal, I get past the screen asking me for the export file name, and then another screen shows me a progressbar and then the file is created.
When I try to use this functionality through VB, the last screen is the one asking for an output file name, and then nothing happens.

Thanks

0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 12

Expert Comment

by:DRRYAN3
ID: 6374244
Verify that the file U2DDISK.DLL is present in the c:\windows\crystal directory.

Also, can you tell me if you have multiple versions of Crystal Reports installed?
0
 

Author Comment

by:mer1mer1
ID: 6374270
Hi
Thanks for all your help
I have the Windows 2000 and the u2ddisk.dll is in C:\WINNT\CRYSTAL\ directory.
I only have crystal 8 installed. This is a new pc (dell)
0
 
LVL 12

Accepted Solution

by:
DRRYAN3 earned 37 total points
ID: 6374319
Are you running through the IDE or are you running a compiled EXE?

Also, see if this code works (put on a new button)

  Dim crApp As New CRAXDRT.Application
  Dim crRep As CRAXDRT.Report
  ' load a standalone report created in the designer
  Set crRep = crApp.OpenReport("c:\crw_samples\standalone.rpt")
  CRViewer1.EnableExportButton = True
  CRViewer1.ReportSource = crRep
 
  crRep.ExportOptions.DestinationType = crEDTDiskFile
  crRep.ExportOptions.DiskFileName = "c:\mytest.txt"
  crRep.ExportOptions.FormatType = crEFTPaginatedText
  crRep.ExportOptions.NumberOfLinesPerPage = 60
  crRep.Export False
 
This should export your report to a text file name c:\mytest.txt.  If that fails, I would have to recommend that you reinstall Crystal Reports.

DRRYAN3
0
 

Author Comment

by:mer1mer1
ID: 6380150
Thank you for all your trouble. This works well for us as a solution.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 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

21 Experts available now in Live!

Get 1:1 Help Now