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";
+}
+
+
\ 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
+
+
+
+
+
+
+ Textbox2
+ 0.3937cm
+ 2.72203cm
+ 0.6cm
+ 2.5cm
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ Thank you.
+
+
+
+
+
+
+ Textbox3
+ 1.48167cm
+ 2.72203cm
+ 0.6cm
+ 2.5cm
+ 1
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ 2in
+
+
+ 6.5in
+
+
+ 2.01083cm
+ true
+ true
+
+
+ true
+ true
+
+
+
+
+ ASP.NET Core RDLC Test
+
+
+
+
+
+
+ Textbox1
+ 0.57891cm
+ 2.72203cm
+ 1.04979cm
+ 10.04063cm
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 29.7cm
+ 21cm
+ 2cm
+ 2cm
+ 2cm
+ 2cm
+ 0.13cm
+
+
+
+
+
+
+ String
+ true
+ true
+ ReportParameter1
+
+
+
+
+ 4
+ 2
+
+
+ 0
+ 0
+ rp1
+
+
+
+
+ Cm
+ 3b61a184-c57b-48f1-8908-2850170d6211
+
\ No newline at end of file
diff --git a/AMESCoreStudio.Web/wwwroot/Reports/TEST02.rdlc b/AMESCoreStudio.Web/wwwroot/Reports/TEST02.rdlc
new file mode 100644
index 00000000..d85cb2ab
--- /dev/null
+++ b/AMESCoreStudio.Web/wwwroot/Reports/TEST02.rdlc
@@ -0,0 +1,596 @@
+
+
+
+
+
+
+
+
+ 4.27271cm
+
+
+
+
+ 0.6cm
+
+
+
+
+ true
+ true
+
+
+
+
+ FIRST CNT
+
+
+
+
+
+
+ Textbox2
+
+
+
+ LightGrey
+
+ 1pt
+
+ White
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 0.6cm
+
+
+
+
+ true
+ true
+
+
+
+
+ =Sum(Fields!FirstCnt.Value)
+
+
+
+
+
+
+ FirstCnt
+
+
+ White
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 0.6cm
+
+
+
+
+ true
+ true
+
+
+
+
+ =Sum(Fields!FirstCnt.Value)
+
+
+
+
+
+
+ Textbox12
+
+
+
+ LightGrey
+
+ 1pt
+
+ White
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 0.6cm
+
+
+
+
+ true
+ true
+
+
+
+
+ [Sum(FirstCnt)]
+
+
+
+
+
+
+ Textbox9
+
+
+ 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
+
+
+
+
+
+
+ WipID
+
+
+
+ LightGrey
+
+ 1pt
+
+ White
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+
+ =Fields!RuleStatus.Value
+
+
+
+
+ =Fields!RuleStatus.Value
+
+
+
+ 4.37854cm
+
+
+ true
+ true
+
+
+
+
+ =Fields!RuleStatus.Value
+
+
+
+
+
+
+ RuleStatus
+
+
+
+ LightGrey
+
+ 1pt
+
+ White
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+
+ true
+ WipID
+
+
+
+
+ 4.37854cm
+
+
+ true
+ true
+
+
+
+
+ 总计
+
+
+
+
+
+
+ Textbox11
+
+
+
+ LightGrey
+
+ 1pt
+
+ White
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+ Before
+
+
+
+
+
+ 3.71708cm
+
+
+ true
+ true
+
+
+
+
+ 总计
+
+
+
+
+
+
+ Textbox7
+
+
+ White
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 4.37854cm
+
+
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+ Textbox8
+
+
+ White
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+ Before
+
+
+
+ WIP_STATION
+ 2.4cm
+ 12.36833cm
+
+
+
+
+
+ 2in
+
+
+ 6.5in
+
+ 29.7cm
+ 21cm
+ 2cm
+ 2cm
+ 2cm
+ 2cm
+ 0.13cm
+
+
+ 0
+
+
+
+ System.Data.DataSet
+ /* Local Connection */
+
+ 5b7df398-ba46-4738-878f-2c6cda0b33ec
+
+
+
+
+
+ AMES_DB
+ /* Local Query */
+
+
+
+ WipID
+ System.Decimal
+
+
+ RULE_STATION_ID
+ System.Decimal
+
+
+ RuleStatus
+ System.String
+
+
+ FirstCnt
+ System.Decimal
+
+
+ PASS_CNT
+ System.Decimal
+
+
+ CREATE_USERID
+ System.Decimal
+
+
+ CREATE_DATE
+ System.DateTime
+
+
+ UPDATE_DATE
+ System.DateTime
+
+
+
+ AMES_DB
+ C:\Users\Admin\source\repos\VS2019Web4RDLC\VS2019Web4RDLC\App_Code\AMES_DB.xsd
+ WIP_STATION
+ Fill
+ GetData
+ WIP_STATIONTableAdapter
+
+
+
+ Cm
+ 3d6db279-309d-4d29-9940-23cf8e69bde0
+
\ No newline at end of file
diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/WipStationController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/WipStationController.cs
index 469422c4..24e3a112 100644
--- a/AMESCoreStudio.WebApi/Controllers/AMES/WipStationController.cs
+++ b/AMESCoreStudio.WebApi/Controllers/AMES/WipStationController.cs
@@ -9,6 +9,8 @@ using AMESCoreStudio.WebApi;
using AMESCoreStudio.WebApi.Models.AMES;
using AMESCoreStudio.WebApi.DTO.AMES;
using AMESCoreStudio.CommonTools.Result;
+using System.Data.Common;
+using System.Reflection;
namespace AMESCoreStudio.WebApi.Controllers.AMES
{
@@ -21,16 +23,96 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
{
private readonly AMESContext _context;
+ ///
+ ///
+ ///
+ ///
public WipStationController(AMESContext context)
{
_context = context;
}
+ ///
+ /// 獲取全部工單各站數量資料
+ ///
+ ///
// GET: api/WipStation
[HttpGet]
public async Task>> GetWipStations()
{
- return await _context.WipStations.ToListAsync();
+ //方法2
+ List list = new List();
+ string tempName = string.Empty;
+ DbConnection conn = _context.Database.GetDbConnection();
+ if (conn.State != System.Data.ConnectionState.Open)
+ {
+ await conn.OpenAsync();
+ }
+
+ using (var cmd = conn.CreateCommand())
+ {
+ cmd.CommandText = @"SELECT WIP_ID as WipID,RULE_STATION_ID as RuleStationID,RULE_STATUS as RuleStatus,FIRST_CNT as FirstCnt,
+PASS_CNT as PassCnt,CREATE_USERID as CreateUserID,CREATE_DATE as CreateDate,UPDATE_DATE as UpdateDate
+FROM JHAMES.WIP_STATION";
+
+ using (var reader = await cmd.ExecuteReaderAsync())
+ {
+ if (reader.HasRows)
+ {
+ while (reader.Read())
+ {
+ WipStation row = new WipStation();
+ PropertyInfo[] propertys = row.GetType().GetProperties();
+ foreach (PropertyInfo pi in propertys)
+ {
+ var obj = new object();
+ try
+ {
+ obj = reader[pi.Name];
+ }
+ catch
+ {
+ continue;
+ }
+
+ if (obj == DBNull.Value || obj == null)
+ {
+ continue;
+ }
+
+ var si = pi.GetSetMethod();
+ if (si == null)
+ {
+ continue;
+ }
+
+ if (obj is decimal)
+ {
+ pi.SetValue(row, Convert.ToInt32(obj), null);
+ }
+ else
+ {
+ pi.SetValue(row, obj, null);
+ }
+ }
+ list.Add(row);
+ }
+ reader.Close();
+ return list;
+ }
+ }
+ }
+
+ return list;
+
+
+ /*
+ //方法1
+ var wip_station = await _context.WipStations.FromSqlRaw("SELECT * FROM JHAMES.WIP_STATION").ToListAsync();
+ return wip_station;
+ */
+
+ //return await _context.WipStations.ToListAsync();
}
// GET: api/WipStation/5