?
Solved

Problem when exporting to Excel

Posted on 2004-10-12
6
Medium Priority
?
513 Views
Last Modified: 2008-02-01
I have written a simple .rpt viewer using the Crystal Report Viewer control in VB.net 2003. When reports are exported using the export button on the control, several alignment and spacing errors are present. However, these formatting errors are not present if I view and export a report using the Crystal Reports software that I use to design the reports. I'm pretty sure that the problem lies with my report viewer program not using the proper .dll. How do I tell my program to use a different dll to export files? Thanks.
0
Comment
Question by:smoothrockb
[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
6 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 12288140
The problem is not with the dll.  To get a report to export as you want you need to set it up correctly.  Crystal tries to export the report as it is to Excell but Excel coulmns cause trouble.

Look at

http://support.businessobjects.com/communityCS/TechnicalPapers/scr_exportexcel.pdf.asp

mlmcc
0
 

Author Comment

by:smoothrockb
ID: 12289190
I have seen that article, and I don't think it is any help for me, since my reports export to Excel without problems using Crystal Reports 8.5. When I export a program via the Report Viewer control in my viewer application, there are formatting errors, merged cells, misaligned column headers, etc. Also, the gridlines do not appear in the exported excel file. I would rather not have to redesign a large number of reports if I can avoid it. Is there a way to expand the export options packed in with the CrystalReportViewer control in VB.net to be more consistent with the export options present in Crystal Reports?
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 12290651
I don't think so since CR.Net is a stripped down version of CR9.

Also Crystal deliberately limited the export options on some of the viewers to encourage use of the RDC.

mlmcc
0
 

Author Comment

by:smoothrockb
ID: 12426321
I figured out a way to come pretty close to the "data only" export option a la the full Crystal Reports software, using the "Export()" method and adjusting settings that way. In case anyone is interested, my code looked like:

If SaveFileDialog1.ShowDialog() = DialogResult.OK Then
            Dim OpenFile As String
            OpenFile = SaveFileDialog1.FileName

            Report1.ExportOptions.ExportDestinationType = CrystalDecisions.[Shared].ExportDestinationType.DiskFile
            Dim fileOptions As New CrystalDecisions.Shared.DiskFileDestinationOptions
            fileOptions.DiskFileName = OpenFile
            Report1.ExportOptions.DestinationOptions = fileOptions
            Report1.ExportOptions.ExportFormatType = CrystalDecisions.[Shared].ExportFormatType.Excel
            Dim excelOptions As New CrystalDecisions.Shared.ExcelFormatOptions
            excelOptions.ExcelUseConstantColumnWidth = False
            excelOptions.ExcelTabHasColumnHeadings = False
            Report1.ExportOptions.FormatOptions = excelOptions

            Report1.Export()
        End If



0
 

Accepted Solution

by:
ee_ai_construct earned 0 total points
ID: 12464658
Question answered by asker or dialog valuable.
Closed, 125 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Admin
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

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. …
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 …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
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…

718 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