Skip to Content
0
Former Member
Apr 16, 2008 at 03:35 PM

CSS Problem When Exporting Crystal Reports to HTML

79 Views

Post Author: ltarboton

CA Forum: Exporting

I have a number of crystal reports embedded in a vb.net project. I am exporting the reports to HTML from within the code, which it seems to be doing fine, however the exported html files have huge margins to the right and top that I can't seem to get rid of.

If I preview the report in the visual studio project, and export it from the preview, it comes out fine.

When I viewed the source files of the html files, I noticed that they reference a style sheet ("crystalstyle"), which is setting the top and left properties of the body to 31px?? I can't find the css file with these properties to change them, so I assume that it is generated on the fly. Any ideas how to control this setting?

This is the .net code I'm using:

Public Sub GenerateCallProfile(ByVal strSaveLocation As String, ByVal CustomerLevelId As String)

Dim VGE_CallProfile As VGE_CallProfile

Dim FileNamePath As String

FileNamePath = strSaveLocation & "VGE_CallProfile.html"

VGE_CallProfile = New VGE_CallProfile

VGE_CallProfile.SetParameterValue("CustomerLevelId", CustomerLevelId)

VGE_CallProfile.ExportToDisk(CrystalDecisions.[Shared].ExportFormatType.HTML40, FileNamePath)

VGE_CallProfile.Dispose()

End Sub

This is the section of source file code that's causing the problem:

<TITLE>Crystal Report Viewer</TITLE><BODY BGCOLOR="FFFFFF" LEFTMARGIN=31 TOPMARGIN=31><Div class="crystalstyle" style="position:absolute; top:31px; left:31px; "> * this line in particular