1. Are now of Type ".Xls" vs. ".XML". Is there some detailed list of changes for each I can review / search through to see how my code will be impacted?
2. Now generate a "The file you are trying to open, '<FileName>.xls', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?" where it didn't generate any message before. Selecting "Yes" appears to allow it to open the the file correctly.
Telerik 2009Q2 (2009.2.9.729), VS 2005 (v8.0.50727.762 SP.050727-7600), XP SP3 on Core2Duo 2.99GHZ with 3GB.
17 Answers, 1 is accepted
Thank you for writing.
1. ExportToExcelML has always crated XML file but "masked" as an excel file with XLS extension. We do not change this since the first time we present ExportToExcelML class. If another extension is used, you would not be able to open the file with MS Excel by dbl-clicking on it in Windows Explorer.
2. Because ExcelML differs from native excel format (it is a XML with special formatting), MS Excel 2007 will show warning message when you try to open such a file. This comes from Microsoft and it is independently from used Telerik version.
You can find detailed description for all changes in Release Notes document for every release. Please, take a look to the Release History section in Telerik website. Do not hesitate to contact me again if you have other questions.
Best wishes,
Martin Vasilev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2. The same grid data exported by the RunExport method in 2009Q2 generates a file that's ~45% (1056 Kb vs. 729 KB) vs. the one in 2009Q1. That was not in the Release Notes either.
Thank you for getting back to me. We slightly changed the way ExportToExcelML works by adding an extension for the generated files. It is possible that in our previous versions - in some specific circumstances - you were able to export with the xml extension but now it is only xls. Our goal is to make the resulting file looks like an excel file and be open by MS Excel by default. If you still want other extensions for your exported files, you can easily implement an extension substitution on your own.
The larger file size is because the new version processes styles in a different way. Currently the exported files contain more information about excel styles and this improves data formatting in many cases. All fixes and improvements are mentioned in the release notes.
Write me back if you have other questions.
Regards,
Martin Vasilev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Thank you for writing.
Actually, we considered to add a new property which would specify the extension of exported file. This will give more exporting flexibility in terms of file recognizing. We will introduce this property in the next major release: Q1 2010. Let me know if you have any other questions.
All the best,
Martin Vasilev
the Telerik team
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Thank you for contacting us. We have postponed this feature for the next release, because we are going to introduce the new export formats and revised ExporToExcelML class together with a completely refactored RadGridView. Let me know if you have any additional questions.
All the best,
Martin Vasilev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items.
i am using the following code to export a grid to excel
Dim
objExporter As ExportToExcelML = New ExportToExcelML(RadGridView1)
objExporter.ExportVisualSettings =
True
objExporter.SummariesExportOption = SummariesOption.ExportAll
'objExporter.HiddenColumnOption = Telerik.WinControls.UI.Export.E
Dim strTempFileName As String = "D:\Exported\Test.xls"
objExporter.RunExport(strTempFileName)
But when i look @ the exported file i could not find gridlines
Also i could not find the event
exporter_ExcelCellFormatting event
Thanks,
Senthil
Thank you for contacting us.
I suppose you need to include the borders into the result Excel file. This can be done only through the ExcelCellFormatting event as shown in the Events section of the ExportToExcelML documentation. You can create an event handler for ExcelCellFormatting as it follows:
AddHandler
ExportToExcelML.ExcelCellFormatting,
AddressOf
ExportToExcelML_ExcelCellFormatting
Let me know if you have any other questions.
Best wishes,
Martin Vasilev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items.
We are using Q1 2011 and I still get the warning message when opening the exported xls file in Excel. I can see the format is still XML as mentioned above in the thread. Has there been any changes to ExportToExcelML functionality as mentioned by Martin Vasilev above.
Is there a workaround to avoid getting the warning message.
Thanks,
Lester Lasrado
Thank you for writing.
Yes, ExportToExcelML still uses a special XML format to create an exported file, hence the warning message while opening the file. However, there is an easy way to avoid the warning: export the file with xml instead the default xls extension:
ExportToExcelML exporter =
new
ExportToExcelML(
this
.radGridView1);
exporter.FileExtension =
"xml"
;
In this way MS Excel will still open the file, but a warning will not be shown, because the extension matches the file format.
Hope this helps. Let me know if you have any other questions.
Kind regards,
Martin Vasilev
the Telerik team
Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.
Changing to xml doesn't work as you'd need a group policy change to force excel to open the fix rather than IE by default, in our case this would break other systems and isn't a satisfactory solution.
The code below generates Text.xml but has an excel association but obvioulsy tries to open with IE.
Dim
exporter
As
ExportToExcelML =
New
ExportToExcelML(
Me
.radgrid_dataview)
exporter.FileExtension =
"xml"
exporter.ExportVisualSettings =
True
exporter.RunExport(
"D:\Test.xls"
)
System.Diagnostics.Process.Start(
"D:\Test.xls"
) -- errors
As it stands we have to use the CSV export on give up on this gridview which is a shame as it has some nice feature, we bought Ultimate edition but generally it was for WPF controls, this is our 1st usage of the winforms controls and it's been a major disappointment,
This is using the latest build in .NET4 on Win7 64bit and office 2010 32bit
Indeed, as I have replied in your support ticket, if the xml file is associated with a certain application, it will always be opened with that application, no matter what the content of the file says.
In general, the only two solutions are:
- Change the file extension to xml, but remove the application association that your system has with the XML file type.
- Disable the warning message which appears when you open the XLS file exported by RadGridView Excel exporter by following this article.
As I replied in your support ticket, it is not our feature that is not built according to the xml specifications of the Excel format, but it is the OS that wants to prevent you from possible security risks, because of the fact that the file ends up with XLS, while it is in xml format. There is nothing else that can be done in this case, apart from the solutions that I provided above.
Nikolay
the Telerik team
Thanks for your response. I have responded to the ticket.
I can't accept your argument as I have used TxTextControl and other reporting tools to export to excel for opening (2003,2007 & 2010) with no such issues, why is this piece of software the exception to the rule?
Unfortunately this makes the control useless for our needs and therefore the winforms controls. I can confirm after discussions internally that we won't purchase Ultimate next time round.
Regards,
Norman.
I regret to hear about your decision.
At this time I can't comment the capabilities of our competitor, but as far as our suite is concerned, these are the options in order to prevent the warning message from appearing. We will investigate if something can be improved in this direction, but until now we have not found other ways to avoid the warning message.
Let us know if you have additional questions.
Nikolay
the Telerik team
I appreciate your assistance in trying to sort this.
We do need the grouping so we'll have to live with the CSV export, it's not the end of the world but it's not very slick to say the least but at least we can export and open in excel. I left feedback on the ticket regarding why we've decided not to carry on with Ultimate.
We could never implement the workarounds as XML documents should be associated with IE and it would potentially break a lot of legacy systems, our group policy guys and the dev team agreed it was a non-starter. No one can understand why openxml format wasn't used.
I would suggest Telerik do revisit this if possible and also consider changing the feature so you can dump the data into excel rather than having to create a file although I can understand why that might be difficult, I saw a lot of people asking for that feature on the forums.
Regards,
Norman.
Indeed, it will be a step in the right direction if we implement exporting in the native Excel format. We will discuss this feature and research it further, but currently I am not able to provide you with any time frame in which this would happen.
Kind regards,
Nikolay
the Telerik team