I am not sure whats going on because this used to work fine. And it's happening across the application, not specific to 1 grid. I know that there have been 2 updates to the telerik controls since these were implemented... the most recent version prior to Q3. and Q3.
I have a link button on the commanditem bar and use the ItemCommand event for the export as:
Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
COMMAND_NAME = e.CommandName
Select Case COMMAND_NAME
Case "RemoveFilters"
bResetSelections = True
Case RadGrid.ExportToExcelCommandName
Dim t As DateTime = Now()
bExport = True
Dim sHTML As String = ""
sHTML += "<div align='left' style='font-weight:bold;color:Blue;font-size:large'>Regulation Tracking System</div>"
sHTML += "<div align='left' style='font-weight:bold;color:Blue'>Regulation Records Data Dump</div>"
sHTML += "<div align='left' style='font-weight:bold;color:Blue'>" + t.ToLongDateString() + "</div>"
sHTML += "<div> </div>"
RadGrid1.MasterTableView.Caption = sHTML
RadGrid1.ExportSettings.FileName = RTS.GetFileName("RegulationRecords")
RadGrid1.ExportSettings.IgnorePaging = True
RadGrid1.ExportSettings.ExportOnlyData = True
RadGrid1.ExportSettings.OpenInNewWindow = True
RadGrid1.MasterTableView.ExportToExcel()
End Select
End Sub
25 Answers, 1 is accepted
Please try to reproduce this using our online example and let us know about the result.
All the best,
Pavlina
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.
I reduced the length of the name and it's working as it should.
http://support.microsoft.com/kb/326039
As we promised in the support ticket we will remove the explicit encoding for IE6 and IE7.
The fix will be included in the next release of RadControls for ASP.NET AJAX. The expected release date is around the midst of December.
Please excuse us for the inconvenience.
Best wishes,
Pavlina
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.
I was getting those URL-encoded filenames too, until I switched from export's default (HTML) to ExcelML.
Nevertheless, I have not been able to get export to work with command link buttons and notice you are testing for a args value of
RadGrid.ExportToExcelCommandName
Is this right? I have been testing for simply "ExportToExcelCommand" and got nowhere. Of course (and you knew this was coming), the documentation should cover this, if there was any documentation.
Cheers!
Mark
Hey Mark... I believe RadGrid.ExportToExcelCommandName is in the documentation. Then again it may have been used in one of their demos. Whats aggravating is that this used to work just fine.
Why havent you been able to get the exporting to work with command item links?
Are you getting scripting error? If so you probably need to turn off Ajax on the export.
Here's what I do:
function mngRequestStarted(ajaxManager, eventArgs)
{
// disable ajax on the grid for the excel export.
if (eventArgs.get_eventTarget().indexOf("lnkExcel") != -1) {
eventArgs.set_enableAjax(
false);
}
}
Robert
A fixed version will be available in the latest internal builds in the next week.
Excuse us for the inconvenience.
Regards,
Daniel
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.
Had problems with exports.
Started digging for an ajax ie6 issue, but it turned out to be the inch symbol (") in filenames in office 2000.
(It was working fine on my ie7, firefox / Office 2003 setup, but not on the old user machines)
This thread reminded me about file name issues, thanks.
Just adding a note for others: watch out for those ugly symbols in file name...
Best regards,
Nicolai
Thank you for the clarification.
I'd like to note that versions prior to Microsoft Office 2003 are not supported.
As to the quotes - depending on the browser you will observe different behavior. Internet Explorer 8 will probably replace the quote with an underscore. I believe Firefox 3.5 will replace the whole name with the default one.
<
ExportSettings
FileName
=
"a\"
" ... />
Best regards,
Daniel
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.
A fixed version will be available in the latest internal builds in the next week. |
Excuse us for the inconvenience. |
Daniel, I've been looking for a new build. What is the diff between a "dev" and a "trial" hotfix?
Cheers!
Mark
"I'd like to note that versions prior to Microsoft Office 2003 are not supported."
- I'm aware of that, but my users are all on office 2000 and ie6.
So what can we do... I'm sure others (Telerik users) have a similar situation...
MUST have excel export; MUST make it work, supported or not....
So far, I've usually gotten the export to work; limitations can usually be overcome one way or another...
File names is one limitation that can be very easily overcome.
Best regards,
Nicolai
@Mark: The so-called "dev" build is intended for our licensed customers. And the contrariwise, the "trial" build is for the trial users.
We are not ready with the depicted hotfix yet, but it will be released in the next few days as I promised.
@Nicolai: I believe I understand the situation very well and I'm glad that you found a way to overcome the limitation. Keep up the good work.
@Robert: We are constrantly trying to avoid the limitations but in some cases it is not in our power to sidestep the unwanted behavior.
Regards,
Daniel
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.
<CommandItemSettings |
ShowExportToWordButton="true" |
ShowExportToExcelButton="true" |
ShowExportToCsvButton="true" |
ShowExportToPdfButton="true" |
/> |
This worked until I put in the ajax manager. Now it's broken. The buttons look like they are there, and the alt tags pop up. However, when I click on any of the buttons, nothing happens. I tried using the information provided at this link: http://www.telerik.com/community/code-library/aspnet-ajax/general/export-radgrid-content-to-excel-word-csv-pdf-with-ajax-enabled.aspx, but it's not working. Am I naming the buttons wrong? Is there more code that I am missing?
Here's the two snippets of code I tried:
ASP attempt:
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> |
<script type="text/javascript"> |
function mngRequestStarted(ajaxManager, eventArgs) |
{ |
if (eventArgs.get_eventTarget().indexOf("ExportToExcelButton") != -1) |
eventArgs.set_enableAjax(false); |
} |
</script> |
</telerik:RadCodeBlock> |
<%--further down the line I have this code:--%> |
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" ClientEvents-OnRequestStart="mngRequestStarted"> |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="Button1"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="RadGrid1" |
LoadingPanelID="RadAjaxLoadingPanel1" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
<telerik:AjaxSetting AjaxControlID="ExportToExcelButton"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="RadGrid1" /> |
<telerik:AjaxUpdatedControl ControlID="ExportToExcelButton" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
<ClientEvents OnRequestStart="mngRequestStarted" /> |
VB attempt - This happens after I bind the data to the grid:
Dim cmdItem As GridCommandItem |
cmdItem = RadGrid1.MasterTableView.GetItems(GridItemType.CommandItem)(0) |
Dim btncmd As New Button |
btncmd = cmdItem.FindControl("ExportToExcelButton") |
RadScriptManager1.RegisterPostBackControl(btncmd) |
btncmd = cmdItem.FindControl("ExportToWordButton") |
RadScriptManager1.RegisterPostBackControl(btncmd) |
btncmd = cmdItem.FindControl("ExportToCSVButton") |
RadScriptManager1.RegisterPostBackControl(btncmd) |
btncmd = cmdItem.FindControl("ExportToPDFButton") |
RadScriptManager1.RegisterPostBackControl(btncmd) |
Thank you for your help in this matter. I hope you have a terrific day.
I am not sure about the "New" method of exorting you are referring to but... You need to give your command item links the CommandName property either in the designer or as so:
<asp:LinkButton Font-Underline="true" CssClass="clink" ID="lnkExcel" runat="server" CommandName="ExportToExcel" ToolTip="Export Analyst / Author List To Excel">XLS</asp:LinkButton>
Then you need to handle the RadGrid1_ItemCommand() event and initiate the export:
Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
COMMAND_NAME = e.CommandName
Select Case COMMAND_NAME
Case RadGrid.ExportToExcelCommandName
RadGrid1.MasterTableView.Caption = sHTML
RadGrid1.ExportSettings.FileName = RTS.GetFileName("RegulationRecords")
RadGrid1.ExportSettings.IgnorePaging = True
RadGrid1.ExportSettings.ExportOnlyData = True
RadGrid1.ExportSettings.OpenInNewWindow = True
RadGrid1.MasterTableView.ExportToExcel()
End Select
End Sub
If I had looked a little bit more closely at that demo sooner, I would have figured it out much more quickly.
Thanks for the help!
I wanted to let you know that we solved the problem with the encoded file names. You can test the latest release of RadControls - Q3 2009 SP1.
As usual, your feedback is welcome.
Best regards,
Daniel
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.
Cheers!
Mark
Mark
I believe your license doesn't allow you download the latest version. Please examine the following links:
License Comparison
Telerik Premium Collection for .NET
Don't hesitate to contact us if you need more information.
Contact Sales
Best regards,
Daniel
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.
Cheers!
Mark