Render manually for Web Archive

4 posts, 0 answers
  1. James Shelton-Agar
    James Shelton-Agar avatar
    108 posts
    Member since:
    May 2008

    Posted 28 May 2008 Link to this post

    For redering manually to PDF it is relatve stright forward, as the code below

    ReportProcessor.Render("HTML", aContactRPT, Nothing, mime, extension, encode)

    however, what rendering Format for Web Archive (mhtml)?
    and how about others?

  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 29 May 2008 Link to this post

    Hello James,

    You can use the MHTML rendering extension if you want to render a report in MHTML. You can find more info on the MHTML rendering extension in this help article that elaborates on its usage. You can specify rendering extension parameters in your application’s configuration file to override the default report rendering behavior.
    Note that currently HTML preview would not work under Windows Vista as we are using MHTML for it. We would address this problem by switching to real HTML for the preview, as MHTML is not supported on Vista.

    Best wishes,
    Steve
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. DevCraft banner
  4. James Shelton-Agar
    James Shelton-Agar avatar
    108 posts
    Member since:
    May 2008

    Posted 29 May 2008 Link to this post

    Sorry when i have called

    Dim buffer() As Byte = ReportProcessor.Render("HTML", aContactRPT, Nothing, mime, extension, encode)

    or

    Dim buffer() As Byte = ReportProcessor.Render("MHTML", aContactRPT, Nothing, mime, extension, encode)

    it doesn't seems to output any data, however, when i render using PDF, it's fine, any idea?

  5. Chavdar
    Admin
    Chavdar avatar
    898 posts

    Posted 30 May 2008 Link to this post

    Hi James Shelton Agar,

    Here is a sample code snippet which exports a report in MHTML format:

            Dim report As New Report1() 
     
            Dim mimeType As String = String.Empty 
            Dim ext As String = String.Empty 
            Dim encoding As Encoding = encoding.[Default
     
            Dim reportBytes As Byte() = Telerik.Reporting.Processing.ReportProcessor.Render("MHTML", report, Nothing, mimeType, ext, encoding) 
     
     
            Dim fileName As String = "Report1.mhtml" 
     
            Response.Clear() 
            Response.ContentType = mimeType 
            Response.Cache.SetCacheability(HttpCacheability.[Private]) 
            Response.Expires = -1 
            Response.Buffer = False 
            Response.AddHeader("Content-Disposition"String.Format("{0};FileName=""{1}""""attachment", fileName)) 
            Response.OutputStream.Write(reportBytes, 0, reportBytes.Length) 
            Response.End() 


    Give it a try and if there is still a problem please open a support ticket and send a sample project which can demonstrate it.

    Kind regards,
    Chavdar
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top