second page of the grid comes when printing in asp.net C#
I am printing the grid as a part of my html report. I have used a
printhelper function for printing the grid(kept grid in session and
passing it to another page for printing). I have paging enabled on my
grid. So, when I came to next page of the grid and click the print button,
I only get the second page grid records to print. How can I get the whole
grid for printing? Do i have to remove paging from my grid in order to get
all the records?
following is my code
1) Print buttons coding.
protected void btn_betweeen_date_print_Click(object sender, EventArgs e)
{
try
{
Session["ctrl"] = pnl_between_dates_grid;
ClientScript.RegisterStartupScript(this.GetType(), "onclick",
"<script
language=javascript>window.open('Print.aspx','PrintMe','height=500px,width=500px,scrollbars=1');</script>");
}
catch (Exception ex)
{
lblmsg.Text = ex.Message;
}
}
2) Page load of the print form
protected void Page_Load(object sender, EventArgs e)
{
Control ctrl = (Control)Session["ctrl"];
PrintHelper.PrintWebControl(ctrl);
}
No comments:
Post a Comment