Hi,
Its possible only,
try the following...
Step 1: Download the DLL UrlScreenShot.dll and give reference to that DLL
Step2: have a new page contains the grid to print(eg:grid.aspx)(working as a background process)
step3: write the following code in the page (eg:page1.aspx) button click event
using System;
using System.Web;
using be.taiki.UrlScreenshot;
public partial class page1 : System.Web.UI.Page
{
public string ScreenshotFullLength(string Url,string fname)
{
UrlScreenshot Shot = new UrlScreenshot(Url);
int newHeight = (Shot.Bitmap.Width / 400) * Shot.Bitmap.Height;
Shot.Resize(400, newHeight);
string Filename = LazyAssFilename();
//Shot.Bitmap.Save(Server.MapPath(Filename));
Shot.Bitmap.Save("D:/" + fname);
return Filename;
}
private string LazyAssFilename()
{
return Guid.NewGuid().ToString().Replace("-", "") + ".jpg";
}
protected void Button1_Click(object sender, EventArgs e)
{
ScreenshotFullLength("http://localhost:2462/UrlScreenshot-Example/grid.aspx", "grid.jpg");
}
}
conclusion:
after u click the button the image with that grid is stored in the path as u specified(here in D Drive) as a image.