How to insert a Page Break between each RenerControl(HtmlTextWriter)?

R

Rudy Ko

Hi, All:

I'm populating database records into a panel controls and want to render
that panel into a HtmlTextWriter which will creating a word document. Do you
know how to insert a page break between each records?
Thank you for the help.

Below is my code:

Response.AddHeader("Content-Disposition", "attachment;
filename=NSG_BCP.doc");
Response.ContentType = "application/msword";

Response.Charset = "";

StringWriter tw = new StringWriter();

HtmlTextWriter hw = new HtmlTextWriter(tw);

foreach(DataRow dr in ds.Tables[0].Rows)

{

PopulateServerPanel(tabindex);

PanelExport.RenderControl(hw);

Response.Write(tw.ToString());

// I want to add a page break here

// -----Help !!!!!

}

Response.End();
 
G

Guest

I don't know if this will work in your application, but I do something
similar with sending data to Adlib Express to create PDF documents. I
include the html fragment '<div style="page-break-after:always"></div>' where
I want page breaks and it works perfectly for me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top