34 Answers, 1 is accepted
Please check this demo for more info about available grid export options:
http://demos.telerik.com/silverlight/#GridView/Exporting
Kind regards,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.Requested URL: /Export.xls
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
can u help me?
thanks
I just tried our demo however the exporting worked fine - screenshot attached.
Can you provide more info about your browser?
Sincerely yours,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
IE browser Version 6
pls urgent! thanks
I tried our demo in IE7, FireFox 3 and Chrome and again everything worked fine - unfortunately I'm not sure why you have such problems at your end.
You can try our demos locally.
All the best,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
hi
i test alreday with my proj. but still got error! because my proj http is http://localhost/mytestingpage.aspx
following error.....
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. Requested URL: /Export.xls
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
can u help me?
thanks
Can you send us (via support ticket ticket) the project where this can be reproduced?
Sincerely yours,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
acutally code is working! but my app http is wrong way!
my app http is address is http://localhost/myappname.aspx
and then click the Export Button! after that http address is http://localhost/Export.xls
show the following error message!
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.Requested URL: /Export.xls
still trying
thanks
i think i need to change
that one!
Uri
uri = new Uri(HtmlPage.Document.DocumentUri, String.Format("ExportHandler.aspx?type={0}", extension));
ExportHandler.aspx to myapptestingpage.aspx
but! also can not!
let me know
hi
my code here!
Uri uri = new Uri(HtmlPage.Document.DocumentUri, String.Format("SanofiApplicationTestPage.aspx?type={0}", extension));
WebClient client = new WebClient();
client.UploadStringCompleted +=
new UploadStringCompletedEventHandler(client_UploadStringCompleted);
client.UploadStringAsync(uri,content);
void client_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
{
HtmlPage.Window.Navigate(new Uri(HtmlPage.Document.DocumentUri, String.Format("Export.{0}", extension)), "_blank");
}
i use mytestpage name aspx instead of ExportHandler.aspx
can i use?
i think so!
Requested URL: /Export.xls
help me urgent!pls
thanks
Indeed you can use your own page to save the export to file.
Greetings,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
so! u mean! export.xls file is autocreat right!
THANKS
Here is the relevant code for export file saving:
protected void Page_Load(object sender, EventArgs e)
{
string path = Server.MapPath(String.Format("~/Export.{0}", Request.QueryString["type"]));
if (File.Exists(path))
{
File.Delete(path);
}
using (FileStream fs = File.Create(path))
{
using (StreamReader sr = new StreamReader(Request.InputStream))
{
Byte[] info = System.Text.Encoding.Default.GetBytes(sr.ReadToEnd());
fs.Write(info, 0, info.Length);
}
}
}
You need to add this in your page.
Regards,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Line 9: protected void Page_Load(object sender, EventArgs e) Line 10: { Line 11: string path = Server.MapPath(String.Format("~/Export.{0}", Request.QueryString["type"]));Line 12: Line 13: if (System.IO.File.Exists(path))
help me pls!
thanks
actually following code is inside mysilverlight control xaml cs file
Uri uri = new Uri(HtmlPage.Document.DocumentUri, String.Format("SanofiApplicationTestPage.aspx?type={0}", extension));
WebClient client = new WebClient();
//client.Headers[HttpRequestHeader.ContentType] = "application/vnd.ms-excel";
client.UploadStringCompleted +=
new UploadStringCompletedEventHandler(client_UploadStringCompleted);
client.UploadStringAsync(uri,content);
}
void client_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
{
HtmlPage.Window.Navigate(new Uri(HtmlPage.Document.DocumentUri, String.Format("Export.{0}", extension)), "_blank");
}
this following code is inside myapptname.aspx page!
protected void Page_Load(object sender, EventArgs e)
{
string path = Server.MapPath(String.Format("~/Export.{0}", Request.QueryString["type"]));
if (File.Exists(path))
{
File.Delete(path);
}
using (FileStream fs = File.Create(path))
{
using (StreamReader sr = new StreamReader(Request.InputStream))
{
Byte[] info = System.Text.Encoding.Default.GetBytes(sr.ReadToEnd());
fs.Write(info, 0, info.Length);
}
}
}
but! show the error message "Failed to map the path '/Export'."
so! how can i do that!
thanks
Do you have any value in "extension" field?
Regards,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
i have extension "xls"
thanks
I am also facing the same problem. Can you please help me in exporting the grid.
Here is my code:
Uri
uri = new Uri(HtmlPage.Document.DocumentUri, String.Format("ExportHandler.aspx?type={0}", extension));
WebClient client = new WebClient();
client.UploadStringCompleted +=
new UploadStringCompletedEventHandler(client_UploadStringCompleted);
client.UploadStringAsync(uri, content);
void client_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
{
HtmlPage.Window.Navigate(new Uri(HtmlPage.Document.DocumentUri, String.Format("Export.{0}", extension)), "_blank");
}
Ahead of you for your response.
Regards
Satish
I've attached an example project demonstrating how to export RadGridView to Excel.
Kind regards,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
i got it now!
thanks a lot!
regards
lin
string
path = Server.MapPath(String.Format("~/subfloder/Export.{0}", Request.QueryString["type"]));
and then myapp deployed to Server!
but! Error!
System.Web.HttpException: Failed to map the path '/appfloder/subfloder/Export.'.
help me pls!
thanks
rgds
lin
Once I save my .xls file and i try to open it shows a warning message.
"The file you are trying to open, 'name.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 oepning the file. Do you want to open the file now?"
I press yes and it looks fine but why am I getting that warning message?
My code looks like...
private void btnExportToExcel_Click(object sender, RoutedEventArgs e) |
{ |
Uri uri = new Uri(HtmlPage.Document.DocumentUri, string.Format("ExportReport.aspx?Name={0}", uxSectionTitle.Text)); |
WebClient client = new WebClient(); |
client.UploadStringCompleted += new UploadStringCompletedEventHandler(client_UploadStringCompleted); |
client.UploadStringAsync(uri, uxKPIDetails.ToHtml(true)); |
} |
void client_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e) |
{ |
Uri uri = new Uri(HtmlPage.Document.DocumentUri, string.Format("{0}.xls", uxSectionTitle.Text)); |
HtmlPage.Window.Navigate(uri); |
} |
And in my ExportReport.aspx
protected void Page_Load(object sender, EventArgs e) |
{ |
if (Request.QueryString["Name"] != null) |
{ |
string fileName = Request.QueryString["Name"].ToString(); |
string path = Server.MapPath(fileName + ".xls"); |
if (File.Exists(path)) |
{ |
File.Delete(path); |
} |
using (StreamReader sr = new StreamReader(Request.InputStream, Encoding.UTF8)) |
{ |
StreamWriter sw = new StreamWriter(path); |
sw.Write(sr.ReadToEnd()); |
sw.Close(); |
sr.Close(); |
} |
} |
} |
Thanks,
You will get such message from Excel 2007 since the format of the file is not XLSX.
Regards,
Vlad
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.
When I run the application I get an InvalidOperationException: Access is denied...
Do you know what the problem is?
StackTrace:
at System.Windows.Browser.ScriptObject.Invoke(String name, Object[] args)
at System.Windows.Browser.HtmlWindow.Navigate(Uri navigateToUri, String target, String targetFeatures)
at System.Windows.Browser.HtmlWindow.Navigate(Uri navigateToUri, String target)
at SilverlightApplication3.Page.client_UploadStringCompleted(Object sender, UploadStringCompletedEventArgs e)
at System.Net.WebClient.OnUploadStringCompleted(UploadStringCompletedEventArgs e)
at System.Net.WebClient.UploadStringOperationCompleted(Object arg)
Thanks and regards,
Kristof
I'm not sure why you get this however since Silverlight 3 you can save directly the grid export similar to our demo - no need to upload to the server.
Regards,
Vlad
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.
In the demo you use an Export method
If dialog.ShowDialog() = True Then |
Using stream As Stream = dialog.OpenFile() |
grdMCPOverview.Export(stream, New GridViewExportOptions()) |
End Using |
End If |
But I can't use that method because Export is not a member of Telerik.Windows.Controls.RadGridView.
I use the version 2009.3.1103.1030 of the dll's.
Is there an other way to do it...
Thanks and regards,
Kristof
Generally Export() method is added for Q1 2010 however with Q3 2009 you can use ToXXX extension methods to achieve your goal.
Greetings,
Vlad
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.
Currently exporting to PDF is not supported.
Greetings,
Vlad
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.
Will exporting to PDF ever be supported?
Regards
Mike
You can check this demo for more info:
http://demos.telerik.com/silverlight/#GridView/PrintAndExportWithRadDocument
Vlad
the Telerik team
Missed that demo.
Regards
Mike
A possible way to fulfill your requirement is to follow our SpreadProcessing/RadGridViewIntegration online demo, which provides a way to decide what will be written on each row in the excel or pdf file.
I attached an updated version of the demo that prints only the parent rows in TreeListView.
I hope this help.
Regards,
Boris
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.