I have button on one page(default.aspx). When i clicked on it another page(PrintPdf.aspx) gets open and pdf gets download. Till here ok. but i want to refresh page(default.aspx) after report gets downloaded.
on button click of default.aspx
DocketNo = "DOC/CC/12/0021";
ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "onclick", "view('" + DocketNo.ToString() + "');", true);
script
function view(WID) {
var popUp = window.open('../PrintPDF.aspx?DocketNo=' + WID + '', 'Challan', 'width=650,height=500,top=80,left=80');
document.location.href = docment.location.href;
if (popUp == null || typeof (popUp) == 'undefined') {
alert('Please disable your pop-up blocker and click the "Open" link again.');
}
else {
popUp.focus();
}
}
on PrintPDF.aspx Page load
DataTable DT = ds.Tables[0];
ReportDocument Doc = new ReportDocument();
Doc.Load(Server.MapPath("~/Reports/Challan.rpt"));
Doc.SetCssClass(CrystalDecisions.Shared.ObjectScope.PageHeaderSections, "h1");
Doc.SetCssClass(CrystalDecisions.Shared.ObjectScope.DetailSections, "body");
Doc.SetCssClass(CrystalDecisions.Shared.ObjectScope.GroupHeaderSections, "h1");
Doc.SetCssClass(CrystalDecisions.Shared.ObjectScope.AllReportObjectsInReportHeaderSections, "h1");
Doc.SetDataSource(DT);
Doc.Database.Tables["DocketNo"].SetDataSource((DataTable)DT);
Doc.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, false, "Challan");