Ejemplo n.º 1
0
 public void AddRDLC(ref DocumentVO documentVO, string RDLCPath, string DataSetName)
 {
     RDLC r = new RDLC();
     r.DataSetName = DataSetName;
     r.RDLCName = RDLCPath;
     documentVO.RDLCList.Add(r);
 }
Ejemplo n.º 2
0
 public void AddRDLC(string documentVOPath, string RDLCPath, string DataSetName, RDLC[] SubReportList)
 {
     string jsonData = File.ReadAllText(documentVOPath, Encoding.UTF8);
     DocumentVO dVO = JsonConvert.DeserializeObject<DocumentVO>(jsonData);
     AddRDLC(ref dVO, RDLCPath, DataSetName, SubReportList);
     jsonData = JsonConvert.SerializeObject(dVO);
     File.WriteAllText(documentVOPath, jsonData);
 }
Ejemplo n.º 3
0
 public void AddRDLC(ref DocumentVO documentVO, string RDLCPath, string DataSetName, RDLC[] SubReportList)
 {
     RDLC r = new RDLC();
     r.DataSetName = DataSetName;
     r.RDLCName = RDLCPath;
     r.SubReportList = SubReportList;
     documentVO.RDLCList.Add(r);
 }
Ejemplo n.º 4
0
 public void ExcelWriter(string FilePath, RDLC report)
 {
     ReportViewer Viewer = GetReportViewer(report);
     byte[] byteListData = Viewer.LocalReport.Render("EXCEL");
     using (FileStream fs = File.Create(FilePath))
     {
         fs.Write(byteListData, 0, byteListData.Length);
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 외부에서 주입받은 ReportViewer 즉, Viewer 객체를 세팅한다
 /// </summary>
 /// <param name="RDLCPath">리포트 정의파일의 경로</param>
 /// <param name="data">리포트 작성에 사용될 데이터테이블</param>
 public ReportViewer GetReportViewer(RDLC report)
 {
     ReportViewer Viewer = new ReportViewer();
     string DIRPath = string.Format("{0}\\rdlc", Environment.CurrentDirectory);
     if (!Directory.Exists(DIRPath))
     {
         Directory.CreateDirectory(DIRPath);
     }
     Viewer.LocalReport.ReportPath = string.Format("{0}\\{1}", DIRPath, report.RDLCName);
     report.SetReport(ref Viewer);
     return Viewer;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 정해진 보고서 형식에 따라 
 /// 호환파일형식으로 
 /// 파일을 만든다
 /// </summary>
 /// <param name="FileType"></param>
 /// <param name="FilePath"></param>
 public void Converter(호환파일형식 FileType, string FilePath,RDLC ReportInfo,object data)
 {
     ReportInfo.Data = data;
     switch (FileType)
     {
         case 호환파일형식.Excel:
             reportModel.ExcelWriter(FilePath, ReportInfo);
             break;
         case 호환파일형식.PDF:
             reportModel.PDFWriter(FilePath, ReportInfo);
             break;
         case 호환파일형식.Word:
             reportModel.WordWriter(FilePath, ReportInfo);
             break;
         case 호환파일형식.Image:
             reportModel.ImageWriter(FilePath, ReportInfo);
             break;
         default:
             break;
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// DocumentVO 에서 리스트에 등록된 RDLC 변경
 /// </summary>
 /// <param name="rdlc"></param>
 /// <param name="dv"></param>
 private void ModifyDocumentVO_ChangeRDLC(RDLC rdlc, ref DocumentVO dv)
 {
     IList<RDLC> newRDLCList = new List<RDLC>();
     foreach (RDLC r in dv.RDLCList)
     {
         if (r.RDLCName != rdlc.RDLCName)
         {
             newRDLCList.Add(r);
         }
     }
     newRDLCList.Add(rdlc);
     dv.RDLCList = newRDLCList;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 리포트뷰어에 매개변수의 RDLC를 가지고 리포트를 보여준다
 /// </summary>
 /// <param name="viewer"></param>
 /// <param name="rdlc"></param>
 /// <param name="Data"></param>
 public void SetReporter(ref ReportViewer viewer, RDLC rdlc, object Data)
 {
     rdlc.Data = Data;
     reportModel.GetReportViewer(ref viewer, rdlc);
 }
Ejemplo n.º 9
0
 public void ModifyDocumentInfoFile_RDLC(string DocumentFilePath, RDLC RDLC)
 {
     DocumentVO dv = JsonConvert.DeserializeObject<DocumentVO>(File.ReadAllText(DocumentFilePath, Encoding.UTF8));
     ModifyDocumentVO_ChangeRDLC(RDLC, ref dv);
     File.WriteAllText(DocumentFilePath, JsonConvert.SerializeObject(dv), Encoding.UTF8);
 }
Ejemplo n.º 10
0
 public DocumentVO MakeDocumentVO(string RDLCName, string DataSetName, string printerName)
 {
     DocumentVO documentVO = new DocumentVO();
     IList<RDLC> RDLCList = new List<RDLC>();
     RDLC defaultRDLC = new RDLC(RDLCName, DataSetName);
     RDLCList.Add(defaultRDLC);
     documentVO = new DocumentVO();
     documentVO.RDLCList = RDLCList;
     documentVO.DefaultRDLC = defaultRDLC;
     return documentVO;
 }
Ejemplo n.º 11
0
 public DocumentVO MakeDocumentVO(RDLC defaultRDLC, string printerName)
 {
     DocumentVO documentVO = new DocumentVO();
     IList<RDLC> RDLCList = new List<RDLC>();
     RDLCList.Add(defaultRDLC);
     documentVO = new DocumentVO();
     documentVO.RDLCList = RDLCList;
     documentVO.DefaultRDLC = defaultRDLC;
     documentVO.DefaultRDLC.PrinterName = printerName;
     return documentVO;
 }
Ejemplo n.º 12
0
 /// <summary>
 /// 외부에서 주입받은 ReportViewer 즉, Viewer 객체를 세팅한다
 /// </summary>
 /// <param name="RDLCPath">리포트 정의파일의 경로</param>
 /// <param name="data">리포트 작성에 사용될 데이터테이블</param>
 public ReportViewer GetReportViewer(ref ReportViewer Viewer, RDLC report)
 {
     Viewer.LocalReport.ReportPath = string.Format("{0}\\{1}", Environment.CurrentDirectory, report.RDLCName); ;
     report.SetReport(ref Viewer);
     return Viewer;
 }