Any ideas why an export of a crystal document to html would stop working after updating the crystal enging to crystal 2010.
I am getting an error message that says Invalid Export Options. below is the code that has worked fine for years but doesn't now. I also included hte set html method that is being used to set teh document up as html. This is a vb.net solution.
PublicFunction
PrintReportToHTML(ByVal strCrystalPath AsString, ByVal ds As DataSet) As XmlStruct.HtmlReport
Dim crReportDocument As
ReportDocument
Dim strMessage AsString
Dim hshParams AsNew Hashtable
Dim table As
DataTable
Dim row As DataRow
Dim keycolumn As
DataColumn
Dim valuecolumn As
DataColumn
Dim counter AsInteger
Dim strkey AsString
Dim strvalue AsString
Dim MyByte() AsByte
Try
'Pull hash table
values out of dataset
table = ds.Tables(0)
counter = 0
ForEach row In table.Rows
strkey = table.Rows(counter).Item(0).ToString()
strvalue = table.Rows(counter).Item(1).ToString()
hshParams.Add(strkey, strvalue)
counter = counter + 1
Next
'reset counter to 0
counter = 0
'Parse crystal report name
strCrystalPath = strCrystalPath.Replace("/",
"")
crReportDocument = New ReportDocument
crReportDocument = CreateReport(strCrystalPath, hshParams)
Dim strGuid AsString = Guid.NewGuid.ToString
Dim HTMLBaseFolderName As
String = RuntimeViewerDirectory & strGuid
& "\"
Dim HTMLFileName AsString = "Report"
SetFormatHtml(crReportDocument, False, False, HTMLBaseFolderName, HTMLFileName, False, 0, 0)
crReportDocument.Export()
crReportDocument.Close()
crReportDocument.Dispose()
crReportDocument = Nothing
Dim ImageData AsNew XmlStruct.HtmlImageData
ImageData = Me.HTMLImagesPrep(HTMLBaseFolderName
& strCrystalPath.Replace(".rpt",
String.Empty) & "\images")
Dim MyString AsString
MyString = OpenHTMLandRead(HTMLBaseFolderName &
strCrystalPath.Replace(".rpt", String.Empty) & "\",
HTMLFileName & ".html",
ImageData)
Dim HtmlReport AsNew XmlStruct.HtmlReport
HtmlReport.HtmlText = MyString
HtmlReport.HtmlImages = ImageData.HtmlImages
Return HtmlReport
Catch engEx As
LogOnException
strMessage = "RPT:"&
strCrystalPath & " - Incorrect Logon
Parameters. Check your user name and password."
ThrowNew
Exception(strMessage)
Catch engEx As
DataSourceException
strMessage = "RPT:"&
strCrystalPath & " - An error has occurred
while connecting to the database."
ThrowNew
Exception(strMessage)
Catch engEx As
EngineException
strMessage = "RPT:"&
strCrystalPath & " - "&
engEx.Message
ThrowNew
Exception(strMessage)
EndTry
EndFunction
PrivateSub SetFormatHtml(ByRef MyReport As CrystalDecisions.CrystalReports.Engine.ReportDocument, _
ByVal EnableSeperatedPages AsBoolean, _
ByVal HasPageNavigator AsBoolean, _
ByVal HTMLBaseFolderName AsString, _
ByVal HTMLFileName AsString, _
ByVal UsePageRange AsBoolean, _
ByVal FirstPageNumber AsInteger, _
ByVal LastPageNumber AsInteger)
'Set the destination type to HTML
Dim Options AsNew CrystalDecisions.Shared.HTMLFormatOptions
If UsePageRange Then
EndIf
EndSub