?
Solved

Crystal viewer control, EnableExport function ??

Posted on 2001-08-10
8
Medium Priority
?
323 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
[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
  • 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

 

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
 
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 148 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

Introducing Priority Question

Increase expert visibility of your issues by participating in Priority Question, our latest feature for Premium and Team Account holders. Adjust the priority of your question to get emergent issues in front of subject-matter experts for help when you need it most.

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. …
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…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

770 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