http://www.aspsnippets.com/Articles/Export-GridView-with-Images-to-Word-Excel-and-PDF-Formats-in-ASP.Net.aspx
In your above website,You have stored imagepath as Image/file.jpg.I have created a database and stored image as "~/Images/File.jpg" and then how should i show that image in excel.pdf from gridview.
When i an making this method
protected string GetUrl(string imagepath)
{
string[] splits = Request.Url.AbsoluteUri.Split('/');
if (splits.Length >= 2)
{
string url = splits[0] + "//";
for (int i = 2; i < splits.Length - 1; i++)
{
url += splits[i];
url += "/";
}
return url + imagepath;
}
return imagepath;
}
Its not woking for me..I want to export gridview data in excel/pdf but my image in database in like "~/Images/file.jpg"..kindly help me