How to render report for XLSX?

8 posts, 0 answers
  1. Robert
    Robert avatar
    199 posts
    Member since:
    Aug 2009

    Posted 16 Mar 2011 Link to this post

    I am trying to figure out how to render an excel report into the Office 2007 format but I keep getting errors that the report extension is corrupt.

    What do I need to change here:

    I have tried setting the filname to xlsx and the reponse content type to application/vnd.openxmlformats-officedocument.spreadsheetml.sheet with no luck.

    Dim reportProcessor As New Telerik.Reporting.Processing.ReportProcessor()
    Dim result As Telerik.Reporting.Processing.RenderingResult = reportProcessor.RenderReport("XLS", myReport, Nothing)
    Dim fileName As String = result.DocumentName + ".xls"
        Response.Clear()
        Response.ContentType = "Application/XLS"
        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(result.DocumentBytes, 0, result.DocumentBytes.Length)
        Response.End()

  2. Chavdar
    Admin
    Chavdar avatar
    898 posts

    Posted 16 Mar 2011 Link to this post

    Hi Robert,

    To render a report in the Office 2007 Excel Worksheet format you have to use "XLSX" for the first argument of the RenderReport method.

    Best wishes,
    Chavdar
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. Robert
    Robert avatar
    199 posts
    Member since:
    Aug 2009

    Posted 16 Mar 2011 Link to this post

    Dim result As Telerik.Reporting.Processing.RenderingResult = reportProcessor.RenderReport("XLSX", myReport, Nothing)

    I get a RenderedNotAvailableException when I use "XLSX" as the first argument:

    XLSX Redering format is not available.

    Robert


  4. Chavdar
    Admin
    Chavdar avatar
    898 posts

    Posted 16 Mar 2011 Link to this post

    Hello Robert,

    Microsoft Office 2007 formats are available from the latest version of Telerik Reporting (Q1 2011) which we have just released. Please, upgrade and try again. Note that you also have to install Open XML SDK 2.0 for Microsoft Office as the new rendering extensions depend on it.

    Greetings,
    Chavdar
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  5. Robert
    Robert avatar
    199 posts
    Member since:
    Aug 2009

    Posted 16 Mar 2011 Link to this post

    Also needed to add a reference to Telerik.Reporting.OpenXmlRendering assembly in Web.Config.

    Thanks
  6. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 17 Mar 2011 Link to this post

    Hello Robert,

    This information is available in the Deploying Applications using Telerik Reporting help section.

    Greetings,
    Steve
    the Telerik team
  7. Matt
    Matt avatar
    7 posts
    Member since:
    Jun 2014

    Posted 16 Oct 2014 Link to this post

    Link is now broken. http://www.telerik.com/help/reporting/installation-deploying-on-server.html
  8. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 17 Oct 2014 Link to this post

    Hello Matthew,

    The deployment articles are moved per viewer. For example check Deploying Web Applications:
    DOCX/PPTX/XLSX rendering extensions require Telerik.Reporting.OpenXmlRendering.dll and Open XML SDK 2.0 for Microsoft Office (DocumentFormat.OpenXml.dll v.2.0.5022.0 or above).


    I hope this information helps you.

    Regards,
    Stef
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top