开发者

Persisting a report snapshot in database automatically

I was wondering is there a way for me to generate an excel or PDF version of a report in code and persist that report in another SQL database?

开发者_如何学Go

Best regards


Maybe I'm oversimplifying, but you could store your file as a BLOB or as a link to a physical file in a filesystem. So basically:

1) fetch the data you want 2) process it 3) save in another DB as blob/link.

If you give more details (which DBMS? Any framework? What language?) I think people here would provide more relevant answers.


I have found the answer to this. It was pretty basic.

The thing I am using is the report viewer component and I generate a binary stream of data that I will save in a field in the SQL database either as BLOB or varbinary (still need to verify this a little) Here is an example of the source:

        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()

        'This reads the report as a binary stream of data, could be Excel, PDF, etc
        bytes = ExportReportViewer.ServerReport.Render("Excel", _
          Nothing, mimeType, _
            encoding, extension, streamids, warnings)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜