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

not a valid virtual path

2 Answers 134 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Nick asked on 22 Jul 2008, 12:52 AM
Hello,

I have a template column with an image that is dynamically generated (by another page) based on other values in the grid:

((Image)myRow["Chart"].FindControl("imgChart")).ImageUrl = "~/Reports/cst/ListBar.aspx?pl=" + perflevel.ToString() + "&ss=" + myValue[0].ToString(); 

It works fine for showing the grid, but when I try to do a PDF export it throws an exception "System.Web.HttpException: '/Reports/cst/ListBar.aspx?pl=5&ss=406' is not a valid virtual path.
   at System.Web.VirtualPath.Create(String virtualPath, VirtualPathOptions options)
   at System.Web.HttpServerUtility.MapPath(String path)
   at Telerik.Web.Apoc.Image.ApocImageFactory.Make(String href)
"

Is there a way to fix this without needing to save a zillion temporary image files to the server?

Thanks,
Nick


2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 22 Jul 2008, 05:23 AM
Hi Nick,

Go through the following forum link which discuss a similar error.
RadGrid ExportToPDF gets exception Excel and Word work

Princy
0
Nick
Top achievements
Rank 1
answered on 22 Jul 2008, 04:12 PM
It works if I set ExportOnlyData to true, but then it doesn't export the images, which I need. Any other ideas?

It seems like this could be a bug in RadGrid.
Tags
Grid
Asked by
Nick
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Nick
Top achievements
Rank 1
Share this question
or