Exporting Crystal Report to HTML is not working in Windows 7

EncompixDeivaa

New member
Joined
Apr 7, 2011
Messages
2
Programming Experience
1-3
Hi Sir,

I am trying to export Crystal Report to HTML format using VB.NET code. Functionality is working fine at Windows XP Environment (Save to Disk, Open an Application and Email Attachment). But the same functionality is not working at Windows 7 Environment (both 32-Bit as well as 64-Bit).

Below is the code to Exporting Crystal Report to HTML in VB.NET.

Dim CrDiskFileDestinationOptions As New DiskFileDestinationOptions
Dim CrFormatTypeOptions As New HTMLFormatOptions
Dim vFormat As Integer
Dim CrExportOptions As New ExportOptions
Dim vRdReport As New ReportDocument
Dim sfd As SaveFileDialog
Dim vFileName As String = Nothing


vRdReport = vRptSource

sfd = New SaveFileDialog

If Not (vRptPath = "") Then
sfd.InitialDirectory = vRptPath
End If

sfd.Filter = "Webpage, Complete(*.htm;*.htm)|*.htm|Web Archive, Single file(*.mht)|*.mht|Webpage, HTML only(*.htm;*.html)|*.html"

If sfd.ShowDialog = DialogResult.OK Then
' Set the disk file options.
CrDiskFileDestinationOptions.DiskFileName = sfd.FileName.ToString()
Else
Return
End If

CrExportOptions = vRdReport.ExportOptions
CrFormatTypeOptions.HTMLFileName = vFileName
CrFormatTypeOptions.HTMLEnableSeparatedPages = True
CrFormatTypeOptions.HTMLEnableSeparatedPages = True
CrFormatTypeOptions.HTMLHasPageNavigator = True
CrFormatTypeOptions.UsePageRange = True

With CrExportOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.HTML32
.DestinationOptions = CrDiskFileDestinationOptions.DiskFileName
.FormatOptions = CrFormatTypeOptions
End With
vRdReport.Export()
Catch ex As Exception
MsgBox(ex.ToString)
End Try

Code working fine at Windows XP, But it is not woking in Windows 7 environment.
Please can anyone share your valuable thoughts or ideas reg. this.

Thanks in Advance
Deivanayaga Perumal D.
 

Latest posts

Back
Top