2012-03-14 56 views

回答

1

據我所知LocalReport不能導出到HTML(只有Excel,Word和PDF可用)。但是,如果你仍然有興趣的出口可以使用以下

Dim Report = New LocalReport 

準備報告相同的方式進行查看(Datasource for RDL reports with ReportViewer

Dim warnings As Warning() = Nothing 
Dim streamids As String() = Nothing 
Dim mimeType As String = Nothing 
Dim encoding As String = Nothing 
Dim extension As String = Nothing 
Dim bytes As Byte() = Nothing 
bytes = Report.Render(RenderFormat, Nothing, mimeType, encoding, extension, streamids, warnings) 
Using fs As New IO.FileStream(RepPath, IO.FileMode.Create) 
    fs.Write(bytes, 0, bytes.Length) 
    fs.Close() 
    ReDim bytes(0) 
end Using 

你可以得到可用的擴展名列表與Report.ListRenderingExtensions

ServerReport解決方案是類似的,但有更多可能的導出格式可用。

+0

LocalReport ListRenderingExtensions中沒有「HTML」格式。 – Teddy 2014-05-11 06:21:58

+1

@Teddy:我的答案開始「LocalReport無法導出爲HTML」。 – IvanH 2014-05-11 17:51:14