Мой вопрос кажется дублирующим вопросом, но у меня здесь странная проблема. У нас есть веб-приложение, которое преобразует отчеты RDLC в формат PDF, у которого есть некоторый параметр, который будет установлен в коде, а затем добавлен к отчету и преобразован в PDF. У меня есть этот код:
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();
Проблема здесь в том, что всякий раз, когда я развертываю приложение, используя этот код, значения ReportParameter, которые устанавливаются из значений текстовых полей в ASP, не отражаются в сгенерированном файле PDF. При первой попытке значения отображаются, но во второй раз значения не обновляются в PDF. Это происходит в браузерах IE и Opera, но в других браузерах все нормально, и обратите внимание, как только веб-приложение было развернуто в IIS, но на моем локальном компьютере оно отлично работает во всех браузерах. Заранее спасибо.