From 566c6b3d089579fa35f6975dc660867ddefd0436 Mon Sep 17 00:00:00 2001 From: Marvin Date: Sat, 18 Jun 2022 23:56:02 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=96=B0=E5=A2=9ERDLC=E6=B8=AC=E8=A9=A6?= =?UTF-8?q?=E5=8A=9F=E8=83=BDRPT001=201.1.=E6=96=B0=E5=A2=9E=E6=A8=A1?= =?UTF-8?q?=E7=B5=84RPT=201.2.=E6=96=B0=E5=A2=9E=E5=8A=9F=E8=83=BDRPT001?= =?UTF-8?q?=201.3.RDLC=E4=BF=9D=E5=AD=98=E7=9B=AE=E9=8C=84wwwroot=E4=B8=8B?= =?UTF-8?q?Reports=201.4.Web=E5=A2=9E=E5=8A=A0Nuget=E5=BC=95=E7=94=A8AspNe?= =?UTF-8?q?tCore.Reporting=201.5.Web=E5=A2=9E=E5=8A=A0Nuget=E5=BC=95?= =?UTF-8?q?=E7=94=A8System.CodeDom=201.6.Web=E5=A2=9E=E5=8A=A0Nuget?= =?UTF-8?q?=E5=BC=95=E7=94=A8System.Data.SqlClient=202.=E4=BF=AE=E6=94=B9G?= =?UTF-8?q?etWipStations=E6=94=AF=E6=8C=81=E5=8E=9F=E7=94=9FSQL=E6=9F=A5?= =?UTF-8?q?=E8=A9=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AMESCoreStudio.Web/AMESCoreStudio.Web.csproj | 3 + .../Controllers/BASController.cs | 1 - .../Controllers/RPTController.cs | 44 ++ AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs | 7 + AMESCoreStudio.Web/Views/RPT/RPT001.cshtml | 18 + .../wwwroot/Reports/Report1.rdlc | 153 +++++ .../wwwroot/Reports/TEST02.rdlc | 596 ++++++++++++++++++ .../Controllers/AMES/WipStationController.cs | 84 ++- 8 files changed, 904 insertions(+), 2 deletions(-) create mode 100644 AMESCoreStudio.Web/Controllers/RPTController.cs create mode 100644 AMESCoreStudio.Web/Views/RPT/RPT001.cshtml create mode 100644 AMESCoreStudio.Web/wwwroot/Reports/Report1.rdlc create mode 100644 AMESCoreStudio.Web/wwwroot/Reports/TEST02.rdlc diff --git a/AMESCoreStudio.Web/AMESCoreStudio.Web.csproj b/AMESCoreStudio.Web/AMESCoreStudio.Web.csproj index a58b631e..eb3741b8 100644 --- a/AMESCoreStudio.Web/AMESCoreStudio.Web.csproj +++ b/AMESCoreStudio.Web/AMESCoreStudio.Web.csproj @@ -31,11 +31,14 @@ + + + diff --git a/AMESCoreStudio.Web/Controllers/BASController.cs b/AMESCoreStudio.Web/Controllers/BASController.cs index 2067def3..49b35147 100644 --- a/AMESCoreStudio.Web/Controllers/BASController.cs +++ b/AMESCoreStudio.Web/Controllers/BASController.cs @@ -9,7 +9,6 @@ using Microsoft.AspNetCore.Mvc.Rendering; using AMESCoreStudio.WebApi.Models.BAS; using AMESCoreStudio.WebApi.Models.AMES; using AMESCoreStudio.CommonTools.Result; -using System.Collections.Generic; using System.Linq; namespace AMESCoreStudio.Web.Controllers diff --git a/AMESCoreStudio.Web/Controllers/RPTController.cs b/AMESCoreStudio.Web/Controllers/RPTController.cs new file mode 100644 index 00000000..754f9c64 --- /dev/null +++ b/AMESCoreStudio.Web/Controllers/RPTController.cs @@ -0,0 +1,44 @@ +using Microsoft.AspNetCore.Mvc; +using AspNetCore.Reporting; +using Microsoft.AspNetCore.Hosting; +using System.Collections.Generic; +using System.Threading.Tasks; +using System.Data; +using Oracle.EntityFrameworkCore; +using Oracle.ManagedDataAccess.Client; + +// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860 + +namespace AMESCoreStudio.Web.Controllers +{ + public class RPTController : Controller + { + private readonly IWebHostEnvironment environment = null; + public readonly IPCS _pcsApi; + + public RPTController(IWebHostEnvironment environment,IPCS pcsApi) + { + this.environment = environment; + System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance); + _pcsApi = pcsApi; + + } + + public async Task RPT001() + { + string mimeType = ""; + int extension = 1; + var path = $"{this.environment.WebRootPath}\\Reports\\TEST02.rdlc"; + LocalReport localReport = new LocalReport(path); + Dictionary param = new Dictionary(); + //param.Add("rp1", "Hello RDLC Report!"); + var wip_station = await _pcsApi.GetWipStation(); + + localReport.AddDataSource("WIP_STATION", wip_station); + + + var result = localReport.Execute(RenderType.Pdf, extension, param, mimeType); + return File(result.MainStream, "application/pdf"); + } + } +} diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs index 18480dfa..14bf79f9 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs @@ -1202,5 +1202,12 @@ namespace AMESCoreStudio.Web [WebApiClient.Attributes.HttpGet("api/SerialRules/Sample/num/{num}")] ITask> GetSampleSerialRule(int num); #endregion + + /// + /// 獲取工單各站數量資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/WipStation")] + ITask> GetWipStation(); } } diff --git a/AMESCoreStudio.Web/Views/RPT/RPT001.cshtml b/AMESCoreStudio.Web/Views/RPT/RPT001.cshtml new file mode 100644 index 00000000..5b1399d7 --- /dev/null +++ b/AMESCoreStudio.Web/Views/RPT/RPT001.cshtml @@ -0,0 +1,18 @@ +@{ + ViewData["Title"] = "TEST RDLC"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; +} + +
+
+
+
+
@ViewBag.Title
+
+
+
+ +
+ +
+
\ No newline at end of file diff --git a/AMESCoreStudio.Web/wwwroot/Reports/Report1.rdlc b/AMESCoreStudio.Web/wwwroot/Reports/Report1.rdlc new file mode 100644 index 00000000..6cc3ea55 --- /dev/null +++ b/AMESCoreStudio.Web/wwwroot/Reports/Report1.rdlc @@ -0,0 +1,153 @@ + + + 0 + + + + + + true + true + + + + + =Parameters!rp1.Value + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Thank you. + + + 2pt + 2pt + 2pt + 2pt + + + + 2in + + + + + + + Textbox1 + 0.57891cm + 2.72203cm + 1.04979cm + 10.04063cm + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 29.7cm + 21cm + 2cm + 2cm + 2cm + 2cm + 0.13cm + + + + + + + Textbox2 + + + + LightGrey + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + =Sum(Fields!FirstCnt.Value) + + + + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + =Sum(Fields!FirstCnt.Value) + + + + + + + LightGrey + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + [Sum(FirstCnt)] + + + + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + 3.71708cm + + + true + true + + + + + WIP ID + + + + + + + Textbox5 + + + + LightGrey + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 4.37854cm + + + true + true + + + + + RULE STATUS + + + + + + + Textbox3 + + + + LightGrey + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + =Fields!WipID.Value + + + + + =Fields!WipID.Value + + + + 3.71708cm + + + true + true + + + + + =Fields!WipID.Value + + + + + + + LightGrey + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + + =Fields!RuleStatus.Value + + + + + =Fields!RuleStatus.Value + + + + 4.37854cm + + + true + true + + + + + =Fields!RuleStatus.Value + + + + + + + LightGrey + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + + true + WipID + + + + + 4.37854cm + + + true + true + + + + + 总计 + + + + + + + LightGrey + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + + Before + + + + + + 3.71708cm + + + true + true + + + + + 总计 + + + + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 4.37854cm + + + true + true + + + + + + + + + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + Before + + + + WIP_STATION + 2.4cm + 12.36833cm + + + + + + 2in +