PDA

View Full Version : Export contents of IFrame to Word


dockies
07-15-2008, 09:19 AM
Hi,

I am using Asp.Net 2.0 C# and i am developing a printable form.

I used the code below to export my page to word or excel:


// For Direct Exporting From HTML to Word
// Call this function on Button Click , pls include the required system.web namespaces

HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.ContentType = "application/vnd-ms.word";

///uncomment the 1st line if you want to open directly in IE and comment the 2nd line
//HttpContext.Current.Response.AddHeader("content-disposition", "inline; filename=ExportWord.doc");
HttpContext.Current.Response.AddHeader("content-disposition", "attachment; filename=ExportWord.doc");

I am creating an iframe in runtime and i am loading the page in each iframe.

The above code works but my problem is i cant seem to export the objects inside my iframe. although i can export the objects like button and labels of the page but the page inside my iframe is not visible in my word or excel document. :confused:

please help me...

Thanks in advance :)