Click here to Skip to main content
15,905,867 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,

I want to print a part of the page which i have placed in a div. Also, This div having a background image.
anybody can help me to print image with content in asp.net???

thanks in advance....
Posted
Updated 12-Jun-11 23:25pm
v2

1 solution

Hi,

try to use asp:table

and export to excel or doc

then you can print with good style.

lucky you.

pls: Export to excel function as following:

protected void OutExcel(Table dg, string name)
{
// dg.Visible = true;
Response.Clear();
Response.Buffer = true;
Response.Charset = "utf-8";
name = "attachment;filename=" + name;
Response.AppendHeader("Content-Disposition", name);
Response.ContentEncoding = System.Text.Encoding.GetEncoding(65001);
Response.Write("<meta http-equiv=Content-Type content=text/html;charset=UTF-8>");
//Response.ContentType = "application/ms-excel";
Response.ContentType = "application/vnd.word";
dg.EnableViewState = false;
System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);
dg.RenderControl(oHtmlTextWriter);
Response.Write(oStringWriter.ToString());
Response.End();
}
 
Share this answer
 
v2
Comments
abdu_karami 13-Jun-11 5:22am    
Sorry my friend, i didnt understand it..
can u pls give an example for this?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900