When exporting a report to to Aspose.Words->HTML format, we receive the above error dialog, and the renderer does not successfully export to HTML.
"An error occurred during local report processing:
Length cannot be zero.
Parameter name: length"
I assume the error is being thrown because of a custom function that I have written called "CleanMsTable". This function takes the value of a field (HTML markup that is stored in our TFS database), and tries to strip out some of the extraneous markup for display in Word or HTML. The error does not seem related to the custom function that I have written which is just a few calls to System.Text.RegularExpressions.Regex.Replace(..)
This is the code for the function:
Public Function CleanMsTable(ByVal s As String) As String
s = System.Text.RegularExpressions.Regex.Replace(s, "class=MsoNormalTable", "")
s = System.Text.RegularExpressions.Regex.Replace(s, "class=MsoNormal", "")
s = System.Text.RegularExpressions.Regex.Replace(s, "]*>", "")
s = System.Text.RegularExpressions.Regex.Replace(s, "", "")
s = System.Text.RegularExpressions.Regex.Replace(s, "]*>", "")
s = System.Text.RegularExpressions.Regex.Replace(s, "style=""([^""]*)""([^>]*)", "")
Return s
End Function
This is just an example of the kinds of stuff we want to strip out. We ultimately would like to strip the markup down to barebones HTML table format, with only enough style to put grid-lines on the table. However, I've presented just limited code above since we're trying to narrow down the problem.
One thing to consider here, is that the backing datatype for the field that we are parsing is of sql type "ntext". Are there limitations when dealing with text that comes out of this type of field? I have read that this type is deprecated in SQL Server, but unfortunately, the type is being used in a TFS database, so we are sort of stuck with it!
Basic system information: Windows XP using MS Visual Studio 2008, connecting to the MS TFS database on a SQL Server 2008 server. Also, I have attached the RDL (and it's corresponding *.rdl.data file) in a zip file attached to this post. Please let me know what further information you might need.