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
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
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.
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
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
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
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
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
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
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
Without borders : http://prntscr.com/ok772w
we need with borders like this: http://prntscr.com/ok781r
Thanks
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