My question seems a duplicate question but I have an strange issue here. We have a web application that render RDLC reports to PDF format that has some parameter that will be set in code then append to the report and render it to PDF. I have this code behind:
LocalReport rep = new LocalReport();
rep.ReportPath = "ReimbursementClaimForm.rdlc";
List<ReportParameter> param = new List<ReportParameter>();
param.Add(new ReportParameter("NameofthePatient", txtNameofthePatient.Text));
param.Add(new ReportParameter("MBASIDNo", txtMBASIDNo.Text));
param.Add(new ReportParameter("DateofBirth", string.Format("{0:dd MMMM, yyyy}", Convert.ToDateTime(txtDateofBirth.Text))));
param.Add(new ReportParameter("CompleteHomeAddress", txtCompleteHomeAddress.Text));
param.Add(new ReportParameter("EmailAddress", txtEmailAddress.Text));
param.Add(new ReportParameter("ContactNos", txtContactNos.Text));
param.Add(new ReportParameter("ExpenseClaim", txtExpenseClaim.Text));
param.Add(new ReportParameter("AccountHolderName", txtAccountHolderName.Text));
param.Add(new ReportParameter("AccountHolderName2", txtAccountHolderName2.Text));
param.Add(new ReportParameter("AccountNoandAccountType", txtAccountNoandAccountType.Text));
param.Add(new ReportParameter("BankName", txtBankName.Text));
param.Add(new ReportParameter("BankBranch", txtBankBranch.Text));
param.Add(new ReportParameter("BankContactNo", txtBankContactNo.Text));
param.Add(new ReportParameter("BankAddress", txtBankAddress.Text));
param.Add(new ReportParameter("BICSwiftCode", txtBICSwiftCode.Text));
param.Add(new ReportParameter("RTGSCode", txtRTGSCode.Text));
param.Add(new ReportParameter("IBAN", txtIBAN.Text));
rep.SetParameters(param);
rep.DisplayName = "ReimbursementClaimForm";
rep.Refresh();
HttpContext.Current.Response.Buffer = true;
//HttpContext.Current.Response.Clear();
HttpContext.Current.Response.AppendHeader("content-disposition", "attachement filename=" + Rep.DisplayName + ".pdf");
HttpContext.Current.Response.ContentType = "application/PDF";
Warning[] warnings;
string[] streamids;
string mimeType;
string encoding;
string extension;
byte[] bytes = item.Render("Pdf", null, out mimeType, out encoding, out extension, out streamids, out warnings);
HttpContext.Current.Response.BinaryWrite(bytes);
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.End();
The problem here is that whenever I deploy the app using this code values on the ReportParameter that are set from the values of textboxes on ASP are not reflected in the generated PDF file. At first try values rendered but on the second time around values not updated on the PDF. This happens on IE and Opera browsers but on other browsers its fine and take note once the web app was deployed on IIS but on my local machine it works fine in all browsers. Thanks in advance.
Most probably caching issues. Add this line to just over your Response.Clear()
Clear your browser cache and try again