This is a migrated thread and some comments may be shown as answers.

how to change excel version in reportviewer using telerik

11 Answers 358 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
M Kumar
Top achievements
Rank 1
Iron
Veteran
M Kumar asked on 14 Jun 2019, 06:23 AM

Hi sir,

 

 

                  I am using telerik report viewer in  that we need to export the report to excel with new version. how can i change this as show in below screenshot.

http://prntscr.com/o1oehl

 

i use this version for the Telerik.ReportViewer.WebForms.dll as show below screenshot.

 

http://prntscr.com/o1odsx

 

 

 

 

 

11 Answers, 1 is accepted

Sort by
0
Eric R | Senior Technical Support Engineer
Telerik team
answered on 18 Jun 2019, 05:18 PM
Hi M Kumar,

My first suggestion is to try upgrading to the latest HTML5 Report Viewer. The latest version works with the XLSX rendering extension and ASP.NET WebForms. 

If the option to upgrade is not available, their may be some additional configuration that is needed since the Legacy Report Viewer is being used.

Rendering extensions can be configured using the application configuration file. More details are available in the Configure the Rendering Extensions documentation. Additionally, an example is shown in the Rendering Extensions Element documentation.

Please let me know if you have any additional questions. Thank you for choosing Telerik Reporting.

Regards,

Eric R
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
M Kumar
Top achievements
Rank 1
Iron
Veteran
answered on 20 Jun 2019, 10:35 AM

hi,

   Thanks for ur reply as per suggestion i put the "Telerik.ReportViewer.Html5.WebForms.dll" and create the new page and from the tool i draw the reportviewer.

 In config also add 

http://prntscr.com/o4ba4i

and also i add the this setting also

http://prntscr.com/o4baqp

http://prntscr.com/o4bb2e

but no xlsx format show.

0
Eric R | Senior Technical Support Engineer
Telerik team
answered on 24 Jun 2019, 07:06 PM
Hi M Kumar,

Thank you for providing the screenshots. It looks like you would like to upgrade to the HTML5 version which is the recommended approach. I was able to replicate this same issue and found that this can be caused by a missing DocumentFormat.OpenXml.dll reference. You can install the required package using NuGet as seen in the screenshot below.




Additionally, this will add the dependentAssembly entry in the web.config as shown in the following code snippet.

<dependentAssembly>
  <assemblyIdentity name="DocumentFormat.OpenXml" publicKeyToken="8fb06cb64d019a17" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-2.9.1.0" newVersion="2.9.1.0" />
</dependentAssembly>


Lastly, I have attached a working ASP.NET WebForms example with the Reporting REST Service and a Sample Report. 

Please let me know if you have any additional issues with getting the XLSX export feature configured. Thank you for choosing Telerik.


Regards,

Eric R
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
M Kumar
Top achievements
Rank 1
Iron
Veteran
answered on 25 Jun 2019, 04:41 AM

Hi Eric R

 

            Thanks for ur reply i update " DocumentFormat.OpenXml.dll "reference. using NuGet package even though i did not get XLSX format.

telerik report html5 version show below screenshot

http://prntscr.com/o68rzz

i add this value in config also

http://prntscr.com/o68rdu

DocumentFormat.OpenXml.dll also add in bin folder

http://prntscr.com/o68rll

but no new format show 

http://prntscr.com/o68sp0

 

 

0
Eric R | Senior Technical Support Engineer
Telerik team
answered on 26 Jun 2019, 05:51 PM
Hi M Kumar,

From you screenshots, I was able to build a working sample project for you and attached it to this thread. It includes the export to XLSX feature but I had to make specific changes to the project. Because this is using a Web Site project the assemblies need to be exact. I recommend carefully comparing the attached sample and your project for any discrepancies. Below are the items to pay close attention to. 

Required Assembly References
Ensure the required assemblies are installed.

Telerik.ReportViewer.WebForms.dll
Telerik.Reporting.OpenXmlRendering.dll
DocumentFormat.OpenXml.dll

Note that the legacy report viewer does not need the Telerik.ReportViewer.Html5.WebForms.dll. This can safely be removed.

Required Configuration (web.config)
Locate the assemblies node in the configuration file and ensure it looks like below. 

<assemblies>
  <add assembly="Telerik.Reporting.Adomd, Version=11.1.17.614, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>
  <add assembly="Telerik.Reporting.Cache.Database, Version=11.1.17.614, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>
  <add assembly="Telerik.Reporting.Cache.StackExchangeRedis, Version=11.1.17.614, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>
  <add assembly="Telerik.Reporting, Version=11.1.17.614, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>
  <add assembly="Telerik.Reporting.XpsRendering, Version=11.1.17.614, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>
  <add assembly="Telerik.ReportViewer.WebForms, Version=11.1.17.614, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>
  <add assembly="Telerik.Reporting.OpenXmlRendering, Version=11.1.17.614, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>       
  <add assembly="DocumentFormat.OpenXml, Version=2.0.5022.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblies>

More detailed information is available in the Missing DOCX, XLSX, PPTX, XPS Export Options KB article.

Please give this a try and let me know the results. If this doesn't work, please provide a screenshot of your project references and the assemblies node of your configuration file. Thank you and I look forward to your reply.

Regards,

Eric R
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
M Kumar
Top achievements
Rank 1
Iron
Veteran
answered on 27 Jun 2019, 06:31 AM

Hi Eric R

     Thanks for reply i run ur project but it the error like this.

http://prntscr.com/o79szh

I add the reference Assembly above u yellow mark

http://prntscr.com/o79qs6

in bin folder

http://prntscr.com/o79rw5

http://prntscr.com/o79s74

 

and add this also 

http://prntscr.com/o79she

 

Pls rectify this ASAP

0
Eric R | Senior Technical Support Engineer
Telerik team
answered on 27 Jun 2019, 04:05 PM
Hi M Kumar,

There seems to be a number of different issues happening here. This appears to stem from different Report Viewer versions and the export to XLSX issue is from missing assemblies. Let's review the error and using the correct report viewer.

The error on the page is indicating that the Report Viewer in use is the HTML5 version. However, from export to xlsx screenshot, the obsolete report viewer is in use. Below are two screenshots showing the network calls and the styling. Note that the Legacy Report Viewer doesn't make a network call to the api/reports endpoint.

HTML5 Report Viewer




Legacy Report Viewer




At this point, it is difficult to troubleshoot this issue without seeing the actual code and the screenshots haven't been sufficient to grasp the whole scenario. If you conform that you can provide your project, I can give you the ability to attach it to the thread. This way, I can troubleshoot more thoroughly.

Ultimately, there isn't much I can do other than review your code as I have already provided working samples that show how to use both Report Viewers. Please let me know if you can provide your project. Thank you and I look forward to your reply.

Regards,

Eric R
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
M Kumar
Top achievements
Rank 1
Iron
Veteran
answered on 02 Jul 2019, 05:36 AM

Hi Eric R

 

                  Thank's for ur reply i download ur sample second one u send that one i run in my system it show latest version of excel but same thing i do in  my project it does not latest version it show old version. I send my project with code. pls check and reply

Sample Project that i try:

 

https://www.dropbox.com/s/dftobelnmhpwxz3/teleriksamp.rar?dl=0

 

0
Todor
Telerik team
answered on 04 Jul 2019, 03:59 PM
Hello M Kumar,

In the provided project the DocumentFormat.OpenXml.dll that is referred is version 2.9.1.0, which PublicKeyToken is 8fb06cb64d019a17.

Our Telerik.Reporting.OpenXmlRendering assembly uses DocumentFormat.OpenXml.dll with version 2.0.5022.0 and PublicKeyToken 31bf3856ad364e35. Note the different PublicKeyTokens, which makes impossible to use for example BindingRedirects to refer newer DocumentFormat.OpenXml.dlls. You will need to :

 1. Replace the current DocumentFormat.OpenXml.dll with an older one (e.g. version 2.0.5022.0) with PublicKeyToken 31bf3856ad364e35.


 2. Replace the following line in the Web.config :

<add assembly="DocumentFormat.OpenXml, Version=2.9.1.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17"/>

with this  :

<add assembly="DocumentFormat.OpenXml, Version=2.0.5022.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

Regards,
Todor
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
M Kumar
Top achievements
Rank 1
Iron
Veteran
answered on 26 Jul 2019, 04:28 AM
Hi, Thanks , its work, but after export to excel , row and column divider missing , i mean there is no cell border, it look like plain , but when we click column and row it will move like cells, we need border in each cell.

Without borders :  http://prntscr.com/ok772w
we need with borders  like this: http://prntscr.com/ok781r

Thanks
0
Todor
Telerik team
answered on 30 Jul 2019, 03:29 PM
Hello M Kumar,

When the report items in the report have borders, they will appear with borders also in Excel rendering. This behavior is by design, as the Reporting engine tries to reproduce as much of the original report as possible regarding layout and styling.
If you need borders, you should add them to the corresponding report items/sections.

Regards,
Todor
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
M Kumar
Top achievements
Rank 1
Iron
Veteran
Answers by
Eric R | Senior Technical Support Engineer
Telerik team
M Kumar
Top achievements
Rank 1
Iron
Veteran
Todor
Telerik team
Share this question
or