2013-05-20 5 views
0

내 질문에 중복 질문이 있지만 여기에 이상한 점이 있습니다. RDLC 보고서를 코드에 설정 한 다음 보고서에 추가하고 PDF로 렌더링 할 매개 변수가있는 PDF 형식으로 렌더링하는 웹 응용 프로그램이 있습니다. 난 뒤에이 코드를 가지고 :IE 및 Opera에서 RDLC를 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(); 

여기서 문제는 내가 ASP에서 텍스트 상자의 값에서 설정되는 ReportParameter에이 코드 값을 사용하여 응용 프로그램을 배포 할 때마다 생성 된 PDF 파일에 반영되지 않은 것입니다. 처음에는 렌더링 된 값을 시도하지만 두 번째에는 PDF에서 업데이트되지 않은 값을 중심으로 시도합니다. 이것은 IE와 오페라 브라우저에서 발생하지만 다른 브라우저에서는 괜찮습니다. 일단 웹 응용 프로그램이 IIS에 배포되었지만 로컬 컴퓨터에서는 모든 브라우저에서 올바르게 작동합니다. 미리 감사드립니다.

답변

0

캐시 문제 일 가능성이 큽니다. 당신의 Response.Clear()

HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache); 

지우기 브라우저 캐시를 통해이 라인을 추가하고 다시 답장을

+0

감사를하려고 나는이 솔루션을 시도 할 것이다. – Rob

관련 문제