From 1fe3f3659680fc73eea3c4b9a3c4f89cbffd2dbb Mon Sep 17 00:00:00 2001 From: lsm Date: Thu, 8 Aug 2024 10:17:42 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=A8=A1=E6=9D=BF=E5=B0=81=E9=9D=A2?= =?UTF-8?q?=E9=95=82=E7=A9=BA=E4=BD=8D=E7=BD=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PEIS/ReportFiles/PReport-德宏州妇幼.frx | 540 +++++++++++++++++++ PEIS/ReportFiles/PReport.frx | 40 +- 2 files changed, 560 insertions(+), 20 deletions(-) create mode 100644 PEIS/ReportFiles/PReport-德宏州妇幼.frx diff --git a/PEIS/ReportFiles/PReport-德宏州妇幼.frx b/PEIS/ReportFiles/PReport-德宏州妇幼.frx new file mode 100644 index 0000000..a2c0203 --- /dev/null +++ b/PEIS/ReportFiles/PReport-德宏州妇幼.frx @@ -0,0 +1,540 @@ + + + using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Windows.Forms; +using System.Drawing; +using System.Drawing.Imaging; +using System.Data; +using System.IO; +using FastReport; +using FastReport.Data; +using FastReport.Dialog; +using FastReport.Barcode; +using FastReport.Table; +using FastReport.Utils; + +namespace FastReport +{ + public class ReportScript + { + String _pDeptName = "科室"; + string picpathbase = System.Windows.Forms.Application.StartupPath + "\\ReportFiles\\"; + private void Logo_BeforePrint(object sender, EventArgs e) + { + Logo.ImageLocation = picpathbase + "Logo.jpg"; + } + + private void General_AfterData(object sender, EventArgs e) + { + DataSourceBase rowData = Report.GetDataSource("G"); + Text95.Text = rowData["Summary"].ToString(); + Text97.Text = rowData["Checker"].ToString(); + Text99.Text = rowData["CheckTime"].ToString(); + } + + private void FeeItems_AfterData(object sender, EventArgs e) + { + DataSourceBase rowData = Report.GetDataSource("F"); + Object rowValue = rowData.CurrentRow; + Text132.Text = rowData["IsDeptGiveUp"].ToString() == "1" ? "是" : ""; + Text134.Text = rowData["GiveUpTime"] == null ? "" : "是"; + } + + private void Picture3_BeforePrint(object sender, EventArgs e) + { + Picture3.Image = Base64ToImage((string)Report.GetParameterValue("Avatar")); + } + + private void Cell171_AfterData(object sender, EventArgs e) + { + if(Cell171.Text.Contains("↑")) + { + Cell167.FillColor = Color.LightCoral; + Cell168.FillColor = Color.LightCoral; + Cell169.FillColor = Color.LightCoral; + Cell170.FillColor = Color.LightCoral; + Cell171.FillColor = Color.LightCoral; + }else if (Cell171.Text.Contains("↓")) + { + Cell167.FillColor = Color.LightCyan; + Cell168.FillColor = Color.LightCyan; + Cell169.FillColor = Color.LightCyan; + Cell170.FillColor = Color.LightCyan; + Cell171.FillColor = Color.LightCyan; + }else + { + Cell167.FillColor = Color.White; + Cell168.FillColor = Color.White; + Cell169.FillColor = Color.White; + Cell170.FillColor = Color.White; + Cell171.FillColor = Color.White; + } + } + + private void Picture4_BeforePrint(object sender, EventArgs e) + { + DataSourceBase rowData = Report.GetDataSource("P"); + + Object rowValue = rowData.CurrentRow; + var Picture = rowValue.GetType().GetProperty("PImage").GetValue(rowValue, null); + + if(rowData["PImage"] != null){ + Picture4.Image = Image.FromStream(new MemoryStream((Byte[])Picture)); + Picture4.Visible = true; + }else{ + Picture4.Image = null; + Picture4.Visible = false; + } + } + + private void Page6_StartPage(object sender, EventArgs e) + { + DataSourceBase rowData = Report.GetDataSource("I"); + Object rowValue = rowData.CurrentRow; + if(rowValue == null) + { + Page6.Visible = false; + return; + } + } + + private void Picture5_BeforePrint(object sender, EventArgs e) + { + DataSourceBase rowData = Report.GetDataSource("I"); + Object rowValue = rowData.CurrentRow; + if(rowValue == null) + { + Page6.Visible = false; + return; + } + + var Picture = rowValue.GetType().GetProperty("ReportImage").GetValue(rowValue, null); + if(rowData["ReportImage"] != null){ + Picture5.Image = Image.FromStream(new MemoryStream((Byte[])Picture)); + Picture5.Visible = true; + }else{ + Picture5.Image = null; + Picture5.Visible = false; + } + } + + public Image Base64ToImage(string base64Str) + { + if(base64Str == null || base64Str == "") + { + return null; + } + + byte[] imageBytes = Convert.FromBase64String(base64Str); + using (MemoryStream ms = new MemoryStream(imageBytes)) + { + Image image = Image.FromStream(ms); + using (MemoryStream stream = new MemoryStream()) + { + image.Save(stream, ImageFormat.Png); + return image; + } + + } + } + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PEIS/ReportFiles/PReport.frx b/PEIS/ReportFiles/PReport.frx index f7754e7..a2c0203 100644 --- a/PEIS/ReportFiles/PReport.frx +++ b/PEIS/ReportFiles/PReport.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -165,22 +165,22 @@ namespace FastReport - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -265,7 +265,7 @@ namespace FastReport - + @@ -422,7 +422,7 @@ namespace FastReport - + @@ -534,7 +534,7 @@ namespace FastReport - +