public void GeneratePDF() { GeneratePDFReport genTable = new GeneratePDFReport("temp"); var query = this.ObjectContext.Liecivo.Include("Ucinna_latka").Include("Forma").Include("Nazov_lieciva").Include("Distributor"); var drugList = new DrugInfoList(); foreach (var drug in query) { DrugInfo drugEntity = new DrugInfo(); drugEntity.DrugName = drug.Nazov_lieciva.nazov_lieciva1; drugEntity.BarCode = drug.ciarovy_kod; drugEntity.SuklCode = drug.sukl_kod; drugEntity.Forma = drug.Forma.forma1; drugEntity.ActiveSubstance = drug.Ucinna_latka.nazov; drugEntity.Prescription = (drug.na_predpis == "0") ? "Nie" : "Áno"; drugEntity.Price = drug.jednotkova_cena.ToString(); drugEntity.DistributorName = drug.Distributor.nazov_distributora; drugEntity.RegNumber = drug.Distributor.registracne_cislo; drugEntity.CorpName = drug.Distributor.nazov_firmy; //drugEntity.StreetAddress = drug.Distributor.ulica; //drugEntity.CityAddress = drug.Distributor.Cis_Obec.Nazov; drugList.AddDrug(drugEntity); } genTable.CreateDrugList(drugList); genTable.CreateDocument(); }
public Byte[] PrintReportService(string reportID, InputArg parameter) { //try //{ // var reportParameters = new List<ReportParameter> //{ // new ReportParameter() { ParaName = "Operate", ParaValue = "Report" }, // new ReportParameter() { ParaName = "UserID", ParaValue = parameter.UserID }, // new ReportParameter() { ParaName = "SchoolYear", ParaValue =parameter.SchoolYear }, // new ReportParameter() { ParaName = "SchoolCode", ParaValue = parameter.SchoolCode }, // new ReportParameter() { ParaName = "PersonID", ParaValue = parameter.ObjID} //}; var goPageparameter = new { Operate = "", UserID = "mif", UserRole = "Admin", SchoolYear = "20202021", SchoolCode = "0205", Grade = "", StudentID = "00881172306", PageID = reportID, Term = "1" }; var myGoPageItem = AppsPage.GoPageItemsList <GoPageItems>(goPageparameter)[0]; string reportingService = myGoPageItem.PageSite; string reportPath = myGoPageItem.PagePath; string reportName = myGoPageItem.PageFile; string PagePara = myGoPageItem.PagePara; var reportPara = new ReportBase { ReportService = myGoPageItem.PageSite, ReportPath = myGoPageItem.PagePath, ReportName = myGoPageItem.PageFile, ReportType = "IEP", ReportFormat = "PDF" }; Byte[] myReport = null; try { myReport = GeneratePDFReport.GetOneReport(reportPara, parameter); return(myReport); } catch (Exception ex) { var em = ex.Message; return(null); } }