개정판 9c451472
dev issue #000 : posco and sppid util
Change-Id: Ic124b4309d200f25f4b274e6e0ae7edaa9bf025e
DTI_PID/DTI_PID.sln | ||
---|---|---|
11 | 11 |
EndProject |
12 | 12 |
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AVEVA.PID.CustomizationUtility_ACAD2018_x64", "APIDConverter\AVEVA.PID.CustomizationUtility_ACAD2018_x64.csproj", "{3D03D577-7689-46ED-829D-1152B1180706}" |
13 | 13 |
EndProject |
14 |
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "POSCO_Report", "POSCO_Report\POSCO_Report.csproj", "{0B9ACE24-227C-42FF-ADAD-A7847CB91F01}" |
|
15 |
EndProject |
|
14 | 16 |
Global |
15 | 17 |
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
16 | 18 |
Debug|Any CPU = Debug|Any CPU |
... | ... | |
59 | 61 |
{3D03D577-7689-46ED-829D-1152B1180706}.Release|x64.ActiveCfg = Release|x64 |
60 | 62 |
{3D03D577-7689-46ED-829D-1152B1180706}.Release|x64.Build.0 = Release|x64 |
61 | 63 |
{3D03D577-7689-46ED-829D-1152B1180706}.Release|x86.ActiveCfg = Release|x64 |
64 |
{0B9ACE24-227C-42FF-ADAD-A7847CB91F01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
65 |
{0B9ACE24-227C-42FF-ADAD-A7847CB91F01}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
66 |
{0B9ACE24-227C-42FF-ADAD-A7847CB91F01}.Debug|x64.ActiveCfg = Debug|Any CPU |
|
67 |
{0B9ACE24-227C-42FF-ADAD-A7847CB91F01}.Debug|x64.Build.0 = Debug|Any CPU |
|
68 |
{0B9ACE24-227C-42FF-ADAD-A7847CB91F01}.Debug|x86.ActiveCfg = Debug|Any CPU |
|
69 |
{0B9ACE24-227C-42FF-ADAD-A7847CB91F01}.Debug|x86.Build.0 = Debug|Any CPU |
|
70 |
{0B9ACE24-227C-42FF-ADAD-A7847CB91F01}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
71 |
{0B9ACE24-227C-42FF-ADAD-A7847CB91F01}.Release|Any CPU.Build.0 = Release|Any CPU |
|
72 |
{0B9ACE24-227C-42FF-ADAD-A7847CB91F01}.Release|x64.ActiveCfg = Release|Any CPU |
|
73 |
{0B9ACE24-227C-42FF-ADAD-A7847CB91F01}.Release|x64.Build.0 = Release|Any CPU |
|
74 |
{0B9ACE24-227C-42FF-ADAD-A7847CB91F01}.Release|x86.ActiveCfg = Release|Any CPU |
|
75 |
{0B9ACE24-227C-42FF-ADAD-A7847CB91F01}.Release|x86.Build.0 = Release|Any CPU |
|
62 | 76 |
EndGlobalSection |
63 | 77 |
GlobalSection(SolutionProperties) = preSolution |
64 | 78 |
HideSolutionNode = FALSE |
DTI_PID/POSCO_Report/App.config | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<configuration> |
|
3 |
<configSections> |
|
4 |
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> |
|
5 |
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> |
|
6 |
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > |
|
7 |
<section name="POSCO_Report.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> |
|
8 |
</sectionGroup> |
|
9 |
</configSections> |
|
10 |
<startup> |
|
11 |
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" /> |
|
12 |
</startup> |
|
13 |
<entityFramework> |
|
14 |
<providers> |
|
15 |
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> |
|
16 |
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" /> |
|
17 |
</providers> |
|
18 |
</entityFramework> |
|
19 |
<system.data> |
|
20 |
<DbProviderFactories> |
|
21 |
<remove invariant="System.Data.SQLite.EF6" /> |
|
22 |
<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" /> |
|
23 |
<remove invariant="System.Data.SQLite" /><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /></DbProviderFactories> |
|
24 |
</system.data> |
|
25 |
<userSettings> |
|
26 |
<POSCO_Report.Properties.Settings> |
|
27 |
<setting name="SYMBOLSETTING" serializeAs="String"> |
|
28 |
<value /> |
|
29 |
</setting> |
|
30 |
<setting name="STREAMNOATTR" serializeAs="String"> |
|
31 |
<value /> |
|
32 |
</setting> |
|
33 |
<setting name="ITEMATTR" serializeAs="String"> |
|
34 |
<value /> |
|
35 |
</setting> |
|
36 |
<setting name="TEMPLATESETTING" serializeAs="String"> |
|
37 |
<value /> |
|
38 |
</setting> |
|
39 |
</POSCO_Report.Properties.Settings> |
|
40 |
</userSettings> |
|
41 |
</configuration> |
DTI_PID/POSCO_Report/DB.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 |
using System.Data.SQLite; |
|
7 |
using System.Globalization; |
|
8 |
using System.Data; |
|
9 |
using System.Windows.Forms; |
|
10 |
|
|
11 |
namespace POSCO_Report |
|
12 |
{ |
|
13 |
|
|
14 |
|
|
15 |
public static class DB |
|
16 |
{ |
|
17 |
const string HMB_From_To = "HMB_From_To"; |
|
18 |
const string HMB_LIST = "HMB_LIST"; |
|
19 |
const string HMB_VALUE = "HMB_VALUE"; |
|
20 |
const string Stream_No = "Stream_No"; |
|
21 |
const string Components = "Components"; |
|
22 |
const string Attributes = "Attributes"; |
|
23 |
const string Symbol = "Symbol"; |
|
24 |
const string SymbolType = "SymbolType"; |
|
25 |
const string SymbolAttribute = "SymbolAttribute"; |
|
26 |
|
|
27 |
public static bool CheckConnection() |
|
28 |
{ |
|
29 |
ProjectInformation projectInformation = ProjectInformation.GetInstance(); |
|
30 |
bool result = false; |
|
31 |
try |
|
32 |
{ |
|
33 |
if (projectInformation.DBType.Equals(DBType.SQLite)) |
|
34 |
{ |
|
35 |
using (SQLiteConnection connection = new SQLiteConnection(projectInformation.ConnString, true)) |
|
36 |
{ |
|
37 |
connection.Open(); |
|
38 |
if (connection.State.Equals(ConnectionState.Open)) |
|
39 |
{ |
|
40 |
using (SQLiteCommand cmd = connection.CreateCommand()) |
|
41 |
{ |
|
42 |
cmd.CommandText = "SELECT NAME FROM sqlite_master WHERE type='table'"; |
|
43 |
using (SQLiteDataReader dr = cmd.ExecuteReader()) |
|
44 |
using (DataTable dt = new DataTable()) |
|
45 |
{ |
|
46 |
dt.Load(dr); |
|
47 |
|
|
48 |
if (dt.Select(string.Format("NAME = '{0}'", HMB_From_To)).Length.Equals(1) && |
|
49 |
dt.Select(string.Format("NAME = '{0}'", HMB_LIST)).Length.Equals(1) && |
|
50 |
dt.Select(string.Format("NAME = '{0}'", HMB_VALUE)).Length.Equals(1) && |
|
51 |
dt.Select(string.Format("NAME = '{0}'", Stream_No)).Length.Equals(1) && |
|
52 |
dt.Select(string.Format("NAME = '{0}'", Components)).Length.Equals(1) && |
|
53 |
dt.Select(string.Format("NAME = '{0}'", Attributes)).Length.Equals(1)) |
|
54 |
{ |
|
55 |
result = true; |
|
56 |
} |
|
57 |
} |
|
58 |
} |
|
59 |
|
|
60 |
} |
|
61 |
connection.Close(); |
|
62 |
} |
|
63 |
} |
|
64 |
else if (projectInformation.DBType.Equals(DBType.MSSQL)) |
|
65 |
{ |
|
66 |
throw new Exception("mssql"); |
|
67 |
} |
|
68 |
} |
|
69 |
catch (Exception ex) |
|
70 |
{ |
|
71 |
MessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
72 |
} |
|
73 |
|
|
74 |
return result; |
|
75 |
} |
|
76 |
public static DataTable GetSymbolTable() |
|
77 |
{ |
|
78 |
DataTable dt = new DataTable(); |
|
79 |
ProjectInformation projectInformation = ProjectInformation.GetInstance(); |
|
80 |
try |
|
81 |
{ |
|
82 |
if (projectInformation.DBType.Equals(DBType.SQLite)) |
|
83 |
{ |
|
84 |
using (SQLiteConnection connection = new SQLiteConnection(projectInformation.ConnString, true)) |
|
85 |
{ |
|
86 |
connection.Open(); |
|
87 |
if (connection.State.Equals(ConnectionState.Open)) |
|
88 |
{ |
|
89 |
using (SQLiteCommand cmd = connection.CreateCommand()) |
|
90 |
{ |
|
91 |
cmd.CommandText = string.Format("SELECT s.UID, s.Name, st.Type, s.BaseSymbol FROM {0} s LEFT JOIN {1} st on s.SymbolType_UID = st.UID", Symbol, SymbolType); |
|
92 |
using (SQLiteDataReader dr = cmd.ExecuteReader()) |
|
93 |
dt.Load(dr); |
|
94 |
} |
|
95 |
|
|
96 |
} |
|
97 |
connection.Close(); |
|
98 |
} |
|
99 |
} |
|
100 |
else if (projectInformation.DBType.Equals(DBType.MSSQL)) |
|
101 |
{ |
|
102 |
throw new Exception("mssql"); |
|
103 |
} |
|
104 |
} |
|
105 |
catch (Exception ex) |
|
106 |
{ |
|
107 |
MessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
108 |
} |
|
109 |
return dt; |
|
110 |
} |
|
111 |
public static DataTable GetSymbolAttributeTable() |
|
112 |
{ |
|
113 |
DataTable dt = new DataTable(); |
|
114 |
ProjectInformation projectInformation = ProjectInformation.GetInstance(); |
|
115 |
try |
|
116 |
{ |
|
117 |
if (projectInformation.DBType.Equals(DBType.SQLite)) |
|
118 |
{ |
|
119 |
using (SQLiteConnection connection = new SQLiteConnection(projectInformation.ConnString, true)) |
|
120 |
{ |
|
121 |
connection.Open(); |
|
122 |
if (connection.State.Equals(ConnectionState.Open)) |
|
123 |
{ |
|
124 |
using (SQLiteCommand cmd = connection.CreateCommand()) |
|
125 |
{ |
|
126 |
cmd.CommandText = string.Format("SELECT DISTINCT Attribute FROM {0}", SymbolAttribute); |
|
127 |
using (SQLiteDataReader dr = cmd.ExecuteReader()) |
|
128 |
dt.Load(dr); |
|
129 |
} |
|
130 |
|
|
131 |
} |
|
132 |
connection.Close(); |
|
133 |
} |
|
134 |
} |
|
135 |
else if (projectInformation.DBType.Equals(DBType.MSSQL)) |
|
136 |
{ |
|
137 |
throw new Exception("mssql"); |
|
138 |
} |
|
139 |
} |
|
140 |
catch (Exception ex) |
|
141 |
{ |
|
142 |
MessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
143 |
} |
|
144 |
return dt; |
|
145 |
} |
|
146 |
public static DataTable GetHMBCaseDataTable() |
|
147 |
{ |
|
148 |
DataTable dt = new DataTable(); |
|
149 |
ProjectInformation projectInformation = ProjectInformation.GetInstance(); |
|
150 |
try |
|
151 |
{ |
|
152 |
if (projectInformation.DBType.Equals(DBType.SQLite)) |
|
153 |
{ |
|
154 |
using (SQLiteConnection connection = new SQLiteConnection(projectInformation.ConnString, true)) |
|
155 |
{ |
|
156 |
connection.Open(); |
|
157 |
if (connection.State.Equals(ConnectionState.Open)) |
|
158 |
{ |
|
159 |
using (SQLiteCommand cmd = connection.CreateCommand()) |
|
160 |
{ |
|
161 |
cmd.CommandText = string.Format(@" |
|
162 |
SELECT hv.UID, hv.Value, hv.[Case], hv.HMB_LIST_UID, hl.Name, hl.Unit, hl.Type, st.Stream_No |
|
163 |
FROM {0} hv |
|
164 |
LEFT JOIN {1} hl |
|
165 |
ON hv.HMB_LIST_UID = hl.UID |
|
166 |
LEFT JOIN {2} st |
|
167 |
ON hv.Stream_No_UID = st.UID", HMB_VALUE, HMB_LIST, Stream_No); |
|
168 |
using (SQLiteDataReader dr = cmd.ExecuteReader()) |
|
169 |
dt.Load(dr); |
|
170 |
} |
|
171 |
|
|
172 |
} |
|
173 |
connection.Close(); |
|
174 |
} |
|
175 |
} |
|
176 |
else if (projectInformation.DBType.Equals(DBType.MSSQL)) |
|
177 |
{ |
|
178 |
throw new Exception("mssql"); |
|
179 |
} |
|
180 |
} |
|
181 |
catch (Exception ex) |
|
182 |
{ |
|
183 |
MessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
184 |
} |
|
185 |
return dt; |
|
186 |
} |
|
187 |
public static DataTable GetHMBListDataTable() |
|
188 |
{ |
|
189 |
DataTable dt = new DataTable(); |
|
190 |
ProjectInformation projectInformation = ProjectInformation.GetInstance(); |
|
191 |
try |
|
192 |
{ |
|
193 |
if (projectInformation.DBType.Equals(DBType.SQLite)) |
|
194 |
{ |
|
195 |
using (SQLiteConnection connection = new SQLiteConnection(projectInformation.ConnString, true)) |
|
196 |
{ |
|
197 |
connection.Open(); |
|
198 |
if (connection.State.Equals(ConnectionState.Open)) |
|
199 |
{ |
|
200 |
using (SQLiteCommand cmd = connection.CreateCommand()) |
|
201 |
{ |
|
202 |
cmd.CommandText = string.Format(@" |
|
203 |
SELECT * |
|
204 |
FROM {0}", HMB_LIST); |
|
205 |
using (SQLiteDataReader dr = cmd.ExecuteReader()) |
|
206 |
dt.Load(dr); |
|
207 |
} |
|
208 |
|
|
209 |
} |
|
210 |
connection.Close(); |
|
211 |
} |
|
212 |
} |
|
213 |
else if (projectInformation.DBType.Equals(DBType.MSSQL)) |
|
214 |
{ |
|
215 |
throw new Exception("mssql"); |
|
216 |
} |
|
217 |
} |
|
218 |
catch (Exception ex) |
|
219 |
{ |
|
220 |
MessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
221 |
} |
|
222 |
return dt; |
|
223 |
} |
|
224 |
|
|
225 |
public static DataTable GetSymbolStreamData(string streamNoAttrName) |
|
226 |
{ |
|
227 |
DataTable dt = new DataTable(); |
|
228 |
ProjectInformation projectInformation = ProjectInformation.GetInstance(); |
|
229 |
try |
|
230 |
{ |
|
231 |
if (projectInformation.DBType.Equals(DBType.SQLite)) |
|
232 |
{ |
|
233 |
using (SQLiteConnection connection = new SQLiteConnection(projectInformation.ConnString, true)) |
|
234 |
{ |
|
235 |
connection.Open(); |
|
236 |
if (connection.State.Equals(ConnectionState.Open)) |
|
237 |
{ |
|
238 |
using (SQLiteCommand cmd = connection.CreateCommand()) |
|
239 |
{ |
|
240 |
cmd.CommandText = string.Format(@" |
|
241 |
SELECT c.UID, c.SYMBOL_UID, a.[VALUE], sa.ATTRIBUTE |
|
242 |
FROM COMPONENTS c, Attributes a, SymbolAttribute sa |
|
243 |
WHERE c.UID = a.COMPONENTS_UID AND a.SymbolAttribute_UID = sa.UID AND sa.Attribute = '{0}'", streamNoAttrName); |
|
244 |
using (SQLiteDataReader dr = cmd.ExecuteReader()) |
|
245 |
dt.Load(dr); |
|
246 |
} |
|
247 |
|
|
248 |
} |
|
249 |
connection.Close(); |
|
250 |
} |
|
251 |
} |
|
252 |
else if (projectInformation.DBType.Equals(DBType.MSSQL)) |
|
253 |
{ |
|
254 |
throw new Exception("mssql"); |
|
255 |
} |
|
256 |
} |
|
257 |
catch (Exception ex) |
|
258 |
{ |
|
259 |
MessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
260 |
} |
|
261 |
return dt; |
|
262 |
} |
|
263 |
|
|
264 |
public static DataTable GetSymbolItemData(string itemAttrName) |
|
265 |
{ |
|
266 |
DataTable dt = new DataTable(); |
|
267 |
ProjectInformation projectInformation = ProjectInformation.GetInstance(); |
|
268 |
try |
|
269 |
{ |
|
270 |
if (projectInformation.DBType.Equals(DBType.SQLite)) |
|
271 |
{ |
|
272 |
using (SQLiteConnection connection = new SQLiteConnection(projectInformation.ConnString, true)) |
|
273 |
{ |
|
274 |
connection.Open(); |
|
275 |
if (connection.State.Equals(ConnectionState.Open)) |
|
276 |
{ |
|
277 |
using (SQLiteCommand cmd = connection.CreateCommand()) |
|
278 |
{ |
|
279 |
cmd.CommandText = string.Format(@" |
|
280 |
SELECT c.UID, c.SYMBOL_UID, a.[VALUE], sa.ATTRIBUTE |
|
281 |
FROM COMPONENTS c, Attributes a, SymbolAttribute sa |
|
282 |
WHERE c.UID = a.COMPONENTS_UID AND a.SymbolAttribute_UID = sa.UID AND sa.Attribute = '{0}'", itemAttrName); |
|
283 |
using (SQLiteDataReader dr = cmd.ExecuteReader()) |
|
284 |
dt.Load(dr); |
|
285 |
} |
|
286 |
|
|
287 |
} |
|
288 |
connection.Close(); |
|
289 |
} |
|
290 |
} |
|
291 |
else if (projectInformation.DBType.Equals(DBType.MSSQL)) |
|
292 |
{ |
|
293 |
throw new Exception("mssql"); |
|
294 |
} |
|
295 |
} |
|
296 |
catch (Exception ex) |
|
297 |
{ |
|
298 |
MessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
299 |
} |
|
300 |
return dt; |
|
301 |
} |
|
302 |
|
|
303 |
public static string GetAttributeValue(string componentUID, string attrName) |
|
304 |
{ |
|
305 |
string result = string.Empty; |
|
306 |
|
|
307 |
ProjectInformation projectInformation = ProjectInformation.GetInstance(); |
|
308 |
try |
|
309 |
{ |
|
310 |
if (projectInformation.DBType.Equals(DBType.SQLite)) |
|
311 |
{ |
|
312 |
using (SQLiteConnection connection = new SQLiteConnection(projectInformation.ConnString, true)) |
|
313 |
{ |
|
314 |
connection.Open(); |
|
315 |
if (connection.State.Equals(ConnectionState.Open)) |
|
316 |
{ |
|
317 |
using (SQLiteCommand cmd = connection.CreateCommand()) |
|
318 |
{ |
|
319 |
DataTable dt = new DataTable(); |
|
320 |
cmd.CommandText = string.Format(@" |
|
321 |
SELECT c.UID, c.SYMBOL_UID, a.[VALUE], sa.ATTRIBUTE |
|
322 |
FROM COMPONENTS c, Attributes a, SymbolAttribute sa |
|
323 |
WHERE c.UID = a.COMPONENTS_UID AND a.SymbolAttribute_UID = sa.UID AND sa.Attribute = '{0}' AND c.UID = '{1}'", attrName, componentUID); |
|
324 |
using (SQLiteDataReader dr = cmd.ExecuteReader()) |
|
325 |
dt.Load(dr); |
|
326 |
|
|
327 |
if (dt.Rows.Count.Equals(1)) |
|
328 |
result = dt.Rows[0]["VALUE"].ToString(); |
|
329 |
} |
|
330 |
|
|
331 |
} |
|
332 |
connection.Close(); |
|
333 |
} |
|
334 |
} |
|
335 |
else if (projectInformation.DBType.Equals(DBType.MSSQL)) |
|
336 |
{ |
|
337 |
throw new Exception("mssql"); |
|
338 |
} |
|
339 |
} |
|
340 |
catch (Exception ex) |
|
341 |
{ |
|
342 |
MessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
343 |
} |
|
344 |
|
|
345 |
return result; |
|
346 |
} |
|
347 |
|
|
348 |
|
|
349 |
} |
|
350 |
} |
DTI_PID/POSCO_Report/MainForm.Designer.cs | ||
---|---|---|
1 |
namespace POSCO_Report |
|
2 |
{ |
|
3 |
partial class MainForm |
|
4 |
{ |
|
5 |
/// <summary> |
|
6 |
/// 필수 디자이너 변수입니다. |
|
7 |
/// </summary> |
|
8 |
private System.ComponentModel.IContainer components = null; |
|
9 |
|
|
10 |
/// <summary> |
|
11 |
/// 사용 중인 모든 리소스를 정리합니다. |
|
12 |
/// </summary> |
|
13 |
/// <param name="disposing">관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다.</param> |
|
14 |
protected override void Dispose(bool disposing) |
|
15 |
{ |
|
16 |
if (disposing && (components != null)) |
|
17 |
{ |
|
18 |
components.Dispose(); |
|
19 |
} |
|
20 |
base.Dispose(disposing); |
|
21 |
} |
|
22 |
|
|
23 |
#region Windows Form 디자이너에서 생성한 코드 |
|
24 |
|
|
25 |
/// <summary> |
|
26 |
/// 디자이너 지원에 필요한 메서드입니다. |
|
27 |
/// 이 메서드의 내용을 코드 편집기로 수정하지 마세요. |
|
28 |
/// </summary> |
|
29 |
private void InitializeComponent() |
|
30 |
{ |
|
31 |
this.components = new System.ComponentModel.Container(); |
|
32 |
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); |
|
33 |
this.ribbonControl = new DevExpress.XtraBars.Ribbon.RibbonControl(); |
|
34 |
this.defaultLookAndFeel = new DevExpress.LookAndFeel.DefaultLookAndFeel(this.components); |
|
35 |
this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); |
|
36 |
this.spinEditColumn = new DevExpress.XtraEditors.SpinEdit(); |
|
37 |
this.spinEditRow = new DevExpress.XtraEditors.SpinEdit(); |
|
38 |
this.btnGroup = new DevExpress.XtraEditors.SimpleButton(); |
|
39 |
this.gridLookUpEditItemAttribute = new DevExpress.XtraEditors.GridLookUpEdit(); |
|
40 |
this.gridLookUpEdit1View = new DevExpress.XtraGrid.Views.Grid.GridView(); |
|
41 |
this.btnSymbolSetting = new DevExpress.XtraEditors.SimpleButton(); |
|
42 |
this.btnExportExcel = new DevExpress.XtraEditors.SimpleButton(); |
|
43 |
this.spreadsheetControl = new DevExpress.XtraSpreadsheet.SpreadsheetControl(); |
|
44 |
this.btnLoadData = new DevExpress.XtraEditors.SimpleButton(); |
|
45 |
this.gridLookUpEditStreamNo = new DevExpress.XtraEditors.GridLookUpEdit(); |
|
46 |
this.gridLookUpEdit2View = new DevExpress.XtraGrid.Views.Grid.GridView(); |
|
47 |
this.Root = new DevExpress.XtraLayout.LayoutControlGroup(); |
|
48 |
this.layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem(); |
|
49 |
this.emptySpaceItem2 = new DevExpress.XtraLayout.EmptySpaceItem(); |
|
50 |
this.layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem(); |
|
51 |
this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem(); |
|
52 |
this.layoutControlItem8 = new DevExpress.XtraLayout.LayoutControlItem(); |
|
53 |
this.layoutControlItem10 = new DevExpress.XtraLayout.LayoutControlItem(); |
|
54 |
this.layoutControlGroup2 = new DevExpress.XtraLayout.LayoutControlGroup(); |
|
55 |
this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem(); |
|
56 |
this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); |
|
57 |
this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem(); |
|
58 |
this.layoutControlItem9 = new DevExpress.XtraLayout.LayoutControlItem(); |
|
59 |
this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem(); |
|
60 |
((System.ComponentModel.ISupportInitialize)(this.ribbonControl)).BeginInit(); |
|
61 |
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit(); |
|
62 |
this.layoutControl1.SuspendLayout(); |
|
63 |
((System.ComponentModel.ISupportInitialize)(this.spinEditColumn.Properties)).BeginInit(); |
|
64 |
((System.ComponentModel.ISupportInitialize)(this.spinEditRow.Properties)).BeginInit(); |
|
65 |
((System.ComponentModel.ISupportInitialize)(this.gridLookUpEditItemAttribute.Properties)).BeginInit(); |
|
66 |
((System.ComponentModel.ISupportInitialize)(this.gridLookUpEdit1View)).BeginInit(); |
|
67 |
((System.ComponentModel.ISupportInitialize)(this.gridLookUpEditStreamNo.Properties)).BeginInit(); |
|
68 |
((System.ComponentModel.ISupportInitialize)(this.gridLookUpEdit2View)).BeginInit(); |
|
69 |
((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit(); |
|
70 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).BeginInit(); |
|
71 |
((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).BeginInit(); |
|
72 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).BeginInit(); |
|
73 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit(); |
|
74 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).BeginInit(); |
|
75 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).BeginInit(); |
|
76 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup2)).BeginInit(); |
|
77 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit(); |
|
78 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit(); |
|
79 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit(); |
|
80 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).BeginInit(); |
|
81 |
((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit(); |
|
82 |
this.SuspendLayout(); |
|
83 |
// |
|
84 |
// ribbonControl |
|
85 |
// |
|
86 |
this.ribbonControl.ExpandCollapseItem.Id = 0; |
|
87 |
this.ribbonControl.Items.AddRange(new DevExpress.XtraBars.BarItem[] { |
|
88 |
this.ribbonControl.ExpandCollapseItem}); |
|
89 |
this.ribbonControl.Location = new System.Drawing.Point(0, 0); |
|
90 |
this.ribbonControl.MaxItemId = 1; |
|
91 |
this.ribbonControl.Name = "ribbonControl"; |
|
92 |
this.ribbonControl.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.False; |
|
93 |
this.ribbonControl.ShowDisplayOptionsMenuButton = DevExpress.Utils.DefaultBoolean.False; |
|
94 |
this.ribbonControl.ShowPageHeadersMode = DevExpress.XtraBars.Ribbon.ShowPageHeadersMode.ShowOnMultiplePages; |
|
95 |
this.ribbonControl.ShowToolbarCustomizeItem = false; |
|
96 |
this.ribbonControl.Size = new System.Drawing.Size(1471, 32); |
|
97 |
this.ribbonControl.Toolbar.ShowCustomizeItem = false; |
|
98 |
// |
|
99 |
// defaultLookAndFeel |
|
100 |
// |
|
101 |
this.defaultLookAndFeel.LookAndFeel.SkinName = "Office 2016 Colorful"; |
|
102 |
// |
|
103 |
// layoutControl1 |
|
104 |
// |
|
105 |
this.layoutControl1.Controls.Add(this.spinEditColumn); |
|
106 |
this.layoutControl1.Controls.Add(this.spinEditRow); |
|
107 |
this.layoutControl1.Controls.Add(this.btnGroup); |
|
108 |
this.layoutControl1.Controls.Add(this.gridLookUpEditItemAttribute); |
|
109 |
this.layoutControl1.Controls.Add(this.btnSymbolSetting); |
|
110 |
this.layoutControl1.Controls.Add(this.btnExportExcel); |
|
111 |
this.layoutControl1.Controls.Add(this.spreadsheetControl); |
|
112 |
this.layoutControl1.Controls.Add(this.btnLoadData); |
|
113 |
this.layoutControl1.Controls.Add(this.gridLookUpEditStreamNo); |
|
114 |
this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill; |
|
115 |
this.layoutControl1.Location = new System.Drawing.Point(0, 32); |
|
116 |
this.layoutControl1.Name = "layoutControl1"; |
|
117 |
this.layoutControl1.Root = this.Root; |
|
118 |
this.layoutControl1.Size = new System.Drawing.Size(1471, 808); |
|
119 |
this.layoutControl1.TabIndex = 1; |
|
120 |
this.layoutControl1.Text = "layoutControl1"; |
|
121 |
// |
|
122 |
// spinEditColumn |
|
123 |
// |
|
124 |
this.spinEditColumn.EditValue = new decimal(new int[] { |
|
125 |
1, |
|
126 |
0, |
|
127 |
0, |
|
128 |
0}); |
|
129 |
this.spinEditColumn.Location = new System.Drawing.Point(113, 195); |
|
130 |
this.spinEditColumn.MenuManager = this.ribbonControl; |
|
131 |
this.spinEditColumn.Name = "spinEditColumn"; |
|
132 |
this.spinEditColumn.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { |
|
133 |
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); |
|
134 |
this.spinEditColumn.Properties.Mask.EditMask = "f0"; |
|
135 |
this.spinEditColumn.Properties.MaxValue = new decimal(new int[] { |
|
136 |
100, |
|
137 |
0, |
|
138 |
0, |
|
139 |
0}); |
|
140 |
this.spinEditColumn.Properties.MinValue = new decimal(new int[] { |
|
141 |
1, |
|
142 |
0, |
|
143 |
0, |
|
144 |
0}); |
|
145 |
this.spinEditColumn.Size = new System.Drawing.Size(147, 20); |
|
146 |
this.spinEditColumn.StyleController = this.layoutControl1; |
|
147 |
this.spinEditColumn.TabIndex = 19; |
|
148 |
// |
|
149 |
// spinEditRow |
|
150 |
// |
|
151 |
this.spinEditRow.EditValue = new decimal(new int[] { |
|
152 |
1, |
|
153 |
0, |
|
154 |
0, |
|
155 |
0}); |
|
156 |
this.spinEditRow.Location = new System.Drawing.Point(113, 171); |
|
157 |
this.spinEditRow.MenuManager = this.ribbonControl; |
|
158 |
this.spinEditRow.Name = "spinEditRow"; |
|
159 |
this.spinEditRow.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { |
|
160 |
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); |
|
161 |
this.spinEditRow.Properties.Mask.EditMask = "f0"; |
|
162 |
this.spinEditRow.Properties.MaxValue = new decimal(new int[] { |
|
163 |
100, |
|
164 |
0, |
|
165 |
0, |
|
166 |
0}); |
|
167 |
this.spinEditRow.Properties.MinValue = new decimal(new int[] { |
|
168 |
1, |
|
169 |
0, |
|
170 |
0, |
|
171 |
0}); |
|
172 |
this.spinEditRow.Size = new System.Drawing.Size(147, 20); |
|
173 |
this.spinEditRow.StyleController = this.layoutControl1; |
|
174 |
this.spinEditRow.TabIndex = 17; |
|
175 |
// |
|
176 |
// btnGroup |
|
177 |
// |
|
178 |
this.btnGroup.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("btnGroup.ImageOptions.Image"))); |
|
179 |
this.btnGroup.Location = new System.Drawing.Point(12, 52); |
|
180 |
this.btnGroup.Name = "btnGroup"; |
|
181 |
this.btnGroup.Size = new System.Drawing.Size(260, 36); |
|
182 |
this.btnGroup.StyleController = this.layoutControl1; |
|
183 |
this.btnGroup.TabIndex = 16; |
|
184 |
this.btnGroup.Text = "Template Setting"; |
|
185 |
this.btnGroup.Click += new System.EventHandler(this.btnGroup_Click); |
|
186 |
// |
|
187 |
// gridLookUpEditItemAttribute |
|
188 |
// |
|
189 |
this.gridLookUpEditItemAttribute.Location = new System.Drawing.Point(113, 147); |
|
190 |
this.gridLookUpEditItemAttribute.MenuManager = this.ribbonControl; |
|
191 |
this.gridLookUpEditItemAttribute.Name = "gridLookUpEditItemAttribute"; |
|
192 |
this.gridLookUpEditItemAttribute.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { |
|
193 |
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); |
|
194 |
this.gridLookUpEditItemAttribute.Properties.PopupView = this.gridLookUpEdit1View; |
|
195 |
this.gridLookUpEditItemAttribute.Size = new System.Drawing.Size(147, 20); |
|
196 |
this.gridLookUpEditItemAttribute.StyleController = this.layoutControl1; |
|
197 |
this.gridLookUpEditItemAttribute.TabIndex = 12; |
|
198 |
// |
|
199 |
// gridLookUpEdit1View |
|
200 |
// |
|
201 |
this.gridLookUpEdit1View.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus; |
|
202 |
this.gridLookUpEdit1View.Name = "gridLookUpEdit1View"; |
|
203 |
this.gridLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false; |
|
204 |
this.gridLookUpEdit1View.OptionsView.ShowGroupPanel = false; |
|
205 |
// |
|
206 |
// btnSymbolSetting |
|
207 |
// |
|
208 |
this.btnSymbolSetting.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("btnSymbolSetting.ImageOptions.Image"))); |
|
209 |
this.btnSymbolSetting.Location = new System.Drawing.Point(12, 12); |
|
210 |
this.btnSymbolSetting.Name = "btnSymbolSetting"; |
|
211 |
this.btnSymbolSetting.Size = new System.Drawing.Size(260, 36); |
|
212 |
this.btnSymbolSetting.StyleController = this.layoutControl1; |
|
213 |
this.btnSymbolSetting.TabIndex = 11; |
|
214 |
this.btnSymbolSetting.Text = "Symbol Setting"; |
|
215 |
this.btnSymbolSetting.Click += new System.EventHandler(this.btnSymbolSetting_Click); |
|
216 |
// |
|
217 |
// btnExportExcel |
|
218 |
// |
|
219 |
this.btnExportExcel.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("btnExportExcel.ImageOptions.Image"))); |
|
220 |
this.btnExportExcel.Location = new System.Drawing.Point(1374, 760); |
|
221 |
this.btnExportExcel.Name = "btnExportExcel"; |
|
222 |
this.btnExportExcel.Size = new System.Drawing.Size(85, 36); |
|
223 |
this.btnExportExcel.StyleController = this.layoutControl1; |
|
224 |
this.btnExportExcel.TabIndex = 10; |
|
225 |
this.btnExportExcel.Text = "Export"; |
|
226 |
this.btnExportExcel.Click += new System.EventHandler(this.btnExportExcel_Click); |
|
227 |
// |
|
228 |
// spreadsheetControl |
|
229 |
// |
|
230 |
this.spreadsheetControl.Location = new System.Drawing.Point(276, 12); |
|
231 |
this.spreadsheetControl.MenuManager = this.ribbonControl; |
|
232 |
this.spreadsheetControl.Name = "spreadsheetControl"; |
|
233 |
this.spreadsheetControl.Options.Import.Csv.Encoding = ((System.Text.Encoding)(resources.GetObject("spreadsheetControl.Options.Import.Csv.Encoding"))); |
|
234 |
this.spreadsheetControl.Options.Import.Txt.Encoding = ((System.Text.Encoding)(resources.GetObject("spreadsheetControl.Options.Import.Txt.Encoding"))); |
|
235 |
this.spreadsheetControl.Size = new System.Drawing.Size(1183, 744); |
|
236 |
this.spreadsheetControl.TabIndex = 9; |
|
237 |
this.spreadsheetControl.Text = "spreadsheetControl1"; |
|
238 |
// |
|
239 |
// btnLoadData |
|
240 |
// |
|
241 |
this.btnLoadData.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("btnLoadData.ImageOptions.Image"))); |
|
242 |
this.btnLoadData.Location = new System.Drawing.Point(12, 231); |
|
243 |
this.btnLoadData.Name = "btnLoadData"; |
|
244 |
this.btnLoadData.Size = new System.Drawing.Size(260, 36); |
|
245 |
this.btnLoadData.StyleController = this.layoutControl1; |
|
246 |
this.btnLoadData.TabIndex = 8; |
|
247 |
this.btnLoadData.Text = "Load Data"; |
|
248 |
this.btnLoadData.Click += new System.EventHandler(this.btnLoadData_Click); |
|
249 |
// |
|
250 |
// gridLookUpEditStreamNo |
|
251 |
// |
|
252 |
this.gridLookUpEditStreamNo.Location = new System.Drawing.Point(113, 123); |
|
253 |
this.gridLookUpEditStreamNo.MenuManager = this.ribbonControl; |
|
254 |
this.gridLookUpEditStreamNo.Name = "gridLookUpEditStreamNo"; |
|
255 |
this.gridLookUpEditStreamNo.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { |
|
256 |
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); |
|
257 |
this.gridLookUpEditStreamNo.Properties.PopupView = this.gridLookUpEdit2View; |
|
258 |
this.gridLookUpEditStreamNo.Size = new System.Drawing.Size(147, 20); |
|
259 |
this.gridLookUpEditStreamNo.StyleController = this.layoutControl1; |
|
260 |
this.gridLookUpEditStreamNo.TabIndex = 5; |
|
261 |
// |
|
262 |
// gridLookUpEdit2View |
|
263 |
// |
|
264 |
this.gridLookUpEdit2View.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus; |
|
265 |
this.gridLookUpEdit2View.Name = "gridLookUpEdit2View"; |
|
266 |
this.gridLookUpEdit2View.OptionsSelection.EnableAppearanceFocusedCell = false; |
|
267 |
this.gridLookUpEdit2View.OptionsView.ShowGroupPanel = false; |
|
268 |
// |
|
269 |
// Root |
|
270 |
// |
|
271 |
this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; |
|
272 |
this.Root.GroupBordersVisible = false; |
|
273 |
this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { |
|
274 |
this.layoutControlItem6, |
|
275 |
this.emptySpaceItem2, |
|
276 |
this.layoutControlItem7, |
|
277 |
this.layoutControlItem5, |
|
278 |
this.layoutControlItem8, |
|
279 |
this.layoutControlItem10, |
|
280 |
this.layoutControlGroup2, |
|
281 |
this.emptySpaceItem1}); |
|
282 |
this.Root.Name = "Root"; |
|
283 |
this.Root.Size = new System.Drawing.Size(1471, 808); |
|
284 |
this.Root.TextVisible = false; |
|
285 |
// |
|
286 |
// layoutControlItem6 |
|
287 |
// |
|
288 |
this.layoutControlItem6.Control = this.spreadsheetControl; |
|
289 |
this.layoutControlItem6.Location = new System.Drawing.Point(264, 0); |
|
290 |
this.layoutControlItem6.Name = "layoutControlItem6"; |
|
291 |
this.layoutControlItem6.Size = new System.Drawing.Size(1187, 748); |
|
292 |
this.layoutControlItem6.TextSize = new System.Drawing.Size(0, 0); |
|
293 |
this.layoutControlItem6.TextVisible = false; |
|
294 |
// |
|
295 |
// emptySpaceItem2 |
|
296 |
// |
|
297 |
this.emptySpaceItem2.AllowHotTrack = false; |
|
298 |
this.emptySpaceItem2.Location = new System.Drawing.Point(0, 748); |
|
299 |
this.emptySpaceItem2.Name = "emptySpaceItem2"; |
|
300 |
this.emptySpaceItem2.Size = new System.Drawing.Size(1362, 40); |
|
301 |
this.emptySpaceItem2.TextSize = new System.Drawing.Size(0, 0); |
|
302 |
// |
|
303 |
// layoutControlItem7 |
|
304 |
// |
|
305 |
this.layoutControlItem7.Control = this.btnExportExcel; |
|
306 |
this.layoutControlItem7.Location = new System.Drawing.Point(1362, 748); |
|
307 |
this.layoutControlItem7.Name = "layoutControlItem7"; |
|
308 |
this.layoutControlItem7.Size = new System.Drawing.Size(89, 40); |
|
309 |
this.layoutControlItem7.TextSize = new System.Drawing.Size(0, 0); |
|
310 |
this.layoutControlItem7.TextVisible = false; |
|
311 |
// |
|
312 |
// layoutControlItem5 |
|
313 |
// |
|
314 |
this.layoutControlItem5.Control = this.btnLoadData; |
|
315 |
this.layoutControlItem5.Location = new System.Drawing.Point(0, 219); |
|
316 |
this.layoutControlItem5.Name = "layoutControlItem5"; |
|
317 |
this.layoutControlItem5.Size = new System.Drawing.Size(264, 40); |
|
318 |
this.layoutControlItem5.TextSize = new System.Drawing.Size(0, 0); |
|
319 |
this.layoutControlItem5.TextVisible = false; |
|
320 |
// |
|
321 |
// layoutControlItem8 |
|
322 |
// |
|
323 |
this.layoutControlItem8.Control = this.btnSymbolSetting; |
|
324 |
this.layoutControlItem8.Location = new System.Drawing.Point(0, 0); |
|
325 |
this.layoutControlItem8.Name = "layoutControlItem8"; |
|
326 |
this.layoutControlItem8.Size = new System.Drawing.Size(264, 40); |
|
327 |
this.layoutControlItem8.TextSize = new System.Drawing.Size(0, 0); |
|
328 |
this.layoutControlItem8.TextVisible = false; |
|
329 |
// |
|
330 |
// layoutControlItem10 |
|
331 |
// |
|
332 |
this.layoutControlItem10.Control = this.btnGroup; |
|
333 |
this.layoutControlItem10.Location = new System.Drawing.Point(0, 40); |
|
334 |
this.layoutControlItem10.Name = "layoutControlItem10"; |
|
335 |
this.layoutControlItem10.Size = new System.Drawing.Size(264, 40); |
|
336 |
this.layoutControlItem10.TextSize = new System.Drawing.Size(0, 0); |
|
337 |
this.layoutControlItem10.TextVisible = false; |
|
338 |
// |
|
339 |
// layoutControlGroup2 |
|
340 |
// |
|
341 |
this.layoutControlGroup2.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { |
|
342 |
this.layoutControlItem2, |
|
343 |
this.layoutControlItem1, |
|
344 |
this.layoutControlItem3, |
|
345 |
this.layoutControlItem9}); |
|
346 |
this.layoutControlGroup2.Location = new System.Drawing.Point(0, 80); |
|
347 |
this.layoutControlGroup2.Name = "layoutControlGroup2"; |
|
348 |
this.layoutControlGroup2.Size = new System.Drawing.Size(264, 139); |
|
349 |
this.layoutControlGroup2.Text = "Attribute Mapping"; |
|
350 |
// |
|
351 |
// layoutControlItem2 |
|
352 |
// |
|
353 |
this.layoutControlItem2.Control = this.gridLookUpEditStreamNo; |
|
354 |
this.layoutControlItem2.Location = new System.Drawing.Point(0, 0); |
|
355 |
this.layoutControlItem2.Name = "layoutControlItem2"; |
|
356 |
this.layoutControlItem2.Size = new System.Drawing.Size(240, 24); |
|
357 |
this.layoutControlItem2.Text = "Stream Number"; |
|
358 |
this.layoutControlItem2.TextSize = new System.Drawing.Size(86, 14); |
|
359 |
// |
|
360 |
// layoutControlItem1 |
|
361 |
// |
|
362 |
this.layoutControlItem1.Control = this.gridLookUpEditItemAttribute; |
|
363 |
this.layoutControlItem1.Location = new System.Drawing.Point(0, 24); |
|
364 |
this.layoutControlItem1.Name = "layoutControlItem1"; |
|
365 |
this.layoutControlItem1.Size = new System.Drawing.Size(240, 24); |
|
366 |
this.layoutControlItem1.Text = "Attribute"; |
|
367 |
this.layoutControlItem1.TextSize = new System.Drawing.Size(86, 14); |
|
368 |
// |
|
369 |
// layoutControlItem3 |
|
370 |
// |
|
371 |
this.layoutControlItem3.Control = this.spinEditRow; |
|
372 |
this.layoutControlItem3.Location = new System.Drawing.Point(0, 48); |
|
373 |
this.layoutControlItem3.Name = "layoutControlItem3"; |
|
374 |
this.layoutControlItem3.Size = new System.Drawing.Size(240, 24); |
|
375 |
this.layoutControlItem3.Text = "Start Row"; |
|
376 |
this.layoutControlItem3.TextSize = new System.Drawing.Size(86, 14); |
|
377 |
// |
|
378 |
// layoutControlItem9 |
|
379 |
// |
|
380 |
this.layoutControlItem9.Control = this.spinEditColumn; |
|
381 |
this.layoutControlItem9.Location = new System.Drawing.Point(0, 72); |
|
382 |
this.layoutControlItem9.Name = "layoutControlItem9"; |
|
383 |
this.layoutControlItem9.Size = new System.Drawing.Size(240, 24); |
|
384 |
this.layoutControlItem9.Text = "Start Column"; |
|
385 |
this.layoutControlItem9.TextSize = new System.Drawing.Size(86, 14); |
|
386 |
// |
|
387 |
// emptySpaceItem1 |
|
388 |
// |
|
389 |
this.emptySpaceItem1.AllowHotTrack = false; |
|
390 |
this.emptySpaceItem1.Location = new System.Drawing.Point(0, 259); |
|
391 |
this.emptySpaceItem1.Name = "emptySpaceItem1"; |
|
392 |
this.emptySpaceItem1.Size = new System.Drawing.Size(264, 489); |
|
393 |
this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0); |
|
394 |
// |
|
395 |
// MainForm |
|
396 |
// |
|
397 |
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); |
|
398 |
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
|
399 |
this.ClientSize = new System.Drawing.Size(1471, 840); |
|
400 |
this.Controls.Add(this.layoutControl1); |
|
401 |
this.Controls.Add(this.ribbonControl); |
|
402 |
this.Name = "MainForm"; |
|
403 |
this.Ribbon = this.ribbonControl; |
|
404 |
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; |
|
405 |
this.Text = "Report"; |
|
406 |
this.Load += new System.EventHandler(this.Report_Load); |
|
407 |
((System.ComponentModel.ISupportInitialize)(this.ribbonControl)).EndInit(); |
|
408 |
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit(); |
|
409 |
this.layoutControl1.ResumeLayout(false); |
|
410 |
((System.ComponentModel.ISupportInitialize)(this.spinEditColumn.Properties)).EndInit(); |
|
411 |
((System.ComponentModel.ISupportInitialize)(this.spinEditRow.Properties)).EndInit(); |
|
412 |
((System.ComponentModel.ISupportInitialize)(this.gridLookUpEditItemAttribute.Properties)).EndInit(); |
|
413 |
((System.ComponentModel.ISupportInitialize)(this.gridLookUpEdit1View)).EndInit(); |
|
414 |
((System.ComponentModel.ISupportInitialize)(this.gridLookUpEditStreamNo.Properties)).EndInit(); |
|
415 |
((System.ComponentModel.ISupportInitialize)(this.gridLookUpEdit2View)).EndInit(); |
|
416 |
((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit(); |
|
417 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).EndInit(); |
|
418 |
((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).EndInit(); |
|
419 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).EndInit(); |
|
420 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit(); |
|
421 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).EndInit(); |
|
422 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).EndInit(); |
|
423 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup2)).EndInit(); |
|
424 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit(); |
|
425 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit(); |
|
426 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit(); |
|
427 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).EndInit(); |
|
428 |
((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit(); |
|
429 |
this.ResumeLayout(false); |
|
430 |
this.PerformLayout(); |
|
431 |
|
|
432 |
} |
|
433 |
|
|
434 |
#endregion |
|
435 |
|
|
436 |
private DevExpress.XtraBars.Ribbon.RibbonControl ribbonControl; |
|
437 |
private DevExpress.LookAndFeel.DefaultLookAndFeel defaultLookAndFeel; |
|
438 |
private DevExpress.XtraLayout.LayoutControl layoutControl1; |
|
439 |
private DevExpress.XtraLayout.LayoutControlGroup Root; |
|
440 |
private DevExpress.XtraSpreadsheet.SpreadsheetControl spreadsheetControl; |
|
441 |
private DevExpress.XtraEditors.SimpleButton btnLoadData; |
|
442 |
private DevExpress.XtraEditors.GridLookUpEdit gridLookUpEditStreamNo; |
|
443 |
private DevExpress.XtraGrid.Views.Grid.GridView gridLookUpEdit2View; |
|
444 |
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2; |
|
445 |
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5; |
|
446 |
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem6; |
|
447 |
private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem2; |
|
448 |
private DevExpress.XtraEditors.SimpleButton btnExportExcel; |
|
449 |
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem7; |
|
450 |
private DevExpress.XtraEditors.SimpleButton btnSymbolSetting; |
|
451 |
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem8; |
|
452 |
private DevExpress.XtraEditors.GridLookUpEdit gridLookUpEditItemAttribute; |
|
453 |
private DevExpress.XtraGrid.Views.Grid.GridView gridLookUpEdit1View; |
|
454 |
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1; |
|
455 |
private DevExpress.XtraEditors.SimpleButton btnGroup; |
|
456 |
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem10; |
|
457 |
private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup2; |
|
458 |
private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1; |
|
459 |
private DevExpress.XtraEditors.SpinEdit spinEditColumn; |
|
460 |
private DevExpress.XtraEditors.SpinEdit spinEditRow; |
|
461 |
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3; |
|
462 |
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem9; |
|
463 |
} |
|
464 |
} |
|
465 |
|
DTI_PID/POSCO_Report/MainForm.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.ComponentModel; |
|
4 |
using System.Data; |
|
5 |
using System.Drawing; |
|
6 |
using System.Linq; |
|
7 |
using System.Text; |
|
8 |
using System.Threading.Tasks; |
|
9 |
using System.Windows.Forms; |
|
10 |
using DevExpress.Spreadsheet; |
|
11 |
using DevExpress.XtraEditors; |
|
12 |
using Newtonsoft.Json; |
|
13 |
using POSCO_Report.Properties; |
|
14 |
|
|
15 |
namespace POSCO_Report |
|
16 |
{ |
|
17 |
public partial class MainForm : DevExpress.XtraBars.Ribbon.RibbonForm |
|
18 |
{ |
|
19 |
ProjectInformation projectInformation = ProjectInformation.GetInstance(); |
|
20 |
|
|
21 |
public MainForm() |
|
22 |
{ |
|
23 |
InitializeComponent(); |
|
24 |
} |
|
25 |
|
|
26 |
private void Report_Load(object sender, EventArgs e) |
|
27 |
{ |
|
28 |
string[] strArg = Environment.GetCommandLineArgs(); |
|
29 |
|
|
30 |
strArg = new string[] { "SQLite", @"Data Source = C:\Users\gaqhf\Desktop\macro\POSCO_S" }; |
|
31 |
bool bContinue = false; |
|
32 |
|
|
33 |
if (strArg.Length.Equals(2)) |
|
34 |
{ |
|
35 |
string dbType = strArg[0]; |
|
36 |
projectInformation.ProjectDirectory = strArg[1]; |
|
37 |
|
|
38 |
DBType type = DBType.None; |
|
39 |
if (Enum.TryParse(dbType, out type)) |
|
40 |
{ |
|
41 |
projectInformation.DBType = type; |
|
42 |
if (DB.CheckConnection()) |
|
43 |
bContinue = true; |
|
44 |
} |
|
45 |
} |
|
46 |
|
|
47 |
if (!bContinue) |
|
48 |
{ |
|
49 |
MessageBox.Show("Check ID2 DB information!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
50 |
Close(); |
|
51 |
} |
|
52 |
else |
|
53 |
{ |
|
54 |
InitLookUpEdit(); |
|
55 |
|
|
56 |
} |
|
57 |
} |
|
58 |
|
|
59 |
private void InitLookUpEdit() |
|
60 |
{ |
|
61 |
DataTable dt = DB.GetSymbolAttributeTable(); |
|
62 |
|
|
63 |
SetLookUpEditProperties(gridLookUpEditStreamNo, dt); |
|
64 |
SetLookUpEditProperties(gridLookUpEditItemAttribute, dt); |
|
65 |
|
|
66 |
#region Set Mapping Data |
|
67 |
string streamAttr = Settings.Default.STREAMNOATTR; |
|
68 |
string itemAttr = Settings.Default.ITEMATTR; |
|
69 |
|
|
70 |
if (!string.IsNullOrEmpty(streamAttr)) |
|
71 |
for (int i = 0; i < dt.Rows.Count; i++) |
|
72 |
{ |
|
73 |
DataRow row = dt.Rows[i]; |
|
74 |
if (row["Attribute"].ToString().Equals(streamAttr)) |
|
75 |
{ |
|
76 |
DataRowView view = dt.DefaultView[i]; |
|
77 |
gridLookUpEditStreamNo.EditValue = view; |
|
78 |
break; |
|
79 |
} |
|
80 |
} |
|
81 |
if (!string.IsNullOrEmpty(itemAttr)) |
|
82 |
for (int i = 0; i < dt.Rows.Count; i++) |
|
83 |
{ |
|
84 |
DataRow row = dt.Rows[i]; |
|
85 |
if (row["Attribute"].ToString().Equals(itemAttr)) |
|
86 |
{ |
|
87 |
DataRowView view = dt.DefaultView[i]; |
|
88 |
gridLookUpEditItemAttribute.EditValue = view; |
|
89 |
break; |
|
90 |
} |
|
91 |
} |
|
92 |
#endregion |
|
93 |
|
|
94 |
gridLookUpEditStreamNo.EditValueChanged += LookUpEdit_EditValueChanged; |
|
95 |
gridLookUpEditItemAttribute.EditValueChanged += LookUpEdit_EditValueChanged; |
|
96 |
} |
|
97 |
|
|
98 |
private void btnSymbolSetting_Click(object sender, EventArgs e) |
|
99 |
{ |
|
100 |
SymbolForm symbolForm = new SymbolForm(); |
|
101 |
symbolForm.ShowDialog(); |
|
102 |
} |
|
103 |
|
|
104 |
private void SetLookUpEditProperties(GridLookUpEdit lookUpEdit, DataTable dt) |
|
105 |
{ |
|
106 |
lookUpEdit.KeyUp += lookUpEdit_KeyUp; |
|
107 |
lookUpEdit.Properties.DataSource = dt; |
|
108 |
lookUpEdit.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard; |
|
109 |
lookUpEdit.Properties.DisplayMember = "Attribute"; |
|
110 |
lookUpEdit.Properties.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup; |
|
111 |
lookUpEdit.Properties.NullText = ""; |
|
112 |
lookUpEdit.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.True; |
|
113 |
} |
|
114 |
|
|
115 |
private void LookUpEdit_EditValueChanged(object sender, EventArgs e) |
|
116 |
{ |
|
117 |
LookUpEditBase lookupEditor = sender as LookUpEditBase; |
|
118 |
if (lookupEditor == null || lookupEditor.EditValue == null) return; |
|
119 |
|
|
120 |
DataRowView streamNoRow = gridLookUpEditStreamNo.EditValue as DataRowView; |
|
121 |
string streamNoAttr = streamNoRow != null ? streamNoRow["Attribute"].ToString() : string.Empty; |
|
122 |
|
|
123 |
DataRowView itemRow = gridLookUpEditItemAttribute.EditValue as DataRowView; |
|
124 |
string itemAttr = itemRow != null ? itemRow["Attribute"].ToString() : string.Empty; |
|
125 |
|
|
126 |
Settings.Default.STREAMNOATTR = streamNoAttr; |
|
127 |
Settings.Default.ITEMATTR = itemAttr; |
|
128 |
|
|
129 |
Settings.Default.Save(); |
|
130 |
} |
|
131 |
|
|
132 |
private void lookUpEdit_KeyUp(object sender, KeyEventArgs e) |
|
133 |
{ |
|
134 |
GridLookUpEdit edit = sender as GridLookUpEdit; |
|
135 |
if (e.KeyCode == Keys.Delete) |
|
136 |
{ |
|
137 |
edit.ClosePopup(); |
|
138 |
edit.EditValue = null; |
|
139 |
} |
|
140 |
else if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Escape) |
|
141 |
{ |
|
142 |
if (edit.IsPopupOpen) |
|
143 |
edit.ClosePopup(); |
|
144 |
} |
|
145 |
else if (!edit.IsPopupOpen) |
|
146 |
edit.ShowPopup(); |
|
147 |
|
|
148 |
e.Handled = true; |
|
149 |
} |
|
150 |
|
|
151 |
private void btnLoadData_Click(object sender, EventArgs e) |
|
152 |
{ |
|
153 |
|
|
154 |
if (spreadsheetControl.CreateNewDocument()) |
|
155 |
{ |
|
156 |
spreadsheetControl.BeginUpdate(); |
|
157 |
|
|
158 |
IWorkbook workbook = spreadsheetControl.Document; |
|
159 |
|
|
160 |
List<TemplateItem> templateItems = JsonConvert.DeserializeObject<List<TemplateItem>>(Settings.Default.TEMPLATESETTING); |
|
161 |
DataTable HMBDataTable = DB.GetHMBCaseDataTable(); |
|
162 |
List<string> symbolLists = new List<string>(); |
|
163 |
string streamNoAttrName = Settings.Default.STREAMNOATTR; |
|
164 |
string templateItemAttribute = Settings.Default.ITEMATTR; |
|
165 |
|
|
166 |
string symbolSettingValue = Settings.Default.SYMBOLSETTING; |
|
167 |
if (!string.IsNullOrEmpty(symbolSettingValue)) |
|
168 |
{ |
|
169 |
string[] split = symbolSettingValue.Split(new string[] { "*|*" }, StringSplitOptions.None); |
|
170 |
symbolLists = split.ToList(); |
|
171 |
} |
|
172 |
|
|
173 |
DataTable symbolStreamTable = DB.GetSymbolStreamData(streamNoAttrName); |
|
174 |
DataTable symbolItemTable = DB.GetSymbolItemData(templateItemAttribute); |
|
175 |
|
|
176 |
foreach (TemplateItem template in templateItems) |
|
177 |
{ |
|
178 |
string templateName = template.Name; |
|
179 |
List<string> itemAttr = template.ItemList; |
|
180 |
|
|
181 |
List<DataRow> itemRows = new List<DataRow>(); |
|
182 |
foreach (var attrName in itemAttr) |
|
183 |
itemRows.AddRange(symbolItemTable.Select(string.Format("VALUE = '{0}'", attrName))); |
|
184 |
|
|
185 |
List<DataRow> streamRows = new List<DataRow>(); |
|
186 |
foreach (var row in itemRows) |
|
187 |
if (row["SYMBOL_UID"] != null && row["SYMBOL_UID"] != DBNull.Value && symbolLists.Contains(row["SYMBOL_UID"].ToString())) |
|
188 |
streamRows.AddRange(symbolStreamTable.Select(string.Format("UID = '{0}'", row["UID"]))); |
|
189 |
|
|
190 |
List<DataRow> endRows = new List<DataRow>(); |
|
191 |
foreach (var row in streamRows) |
|
192 |
{ |
|
193 |
if (row["VALUE"] != null && row["VALUE"] != DBNull.Value && !string.IsNullOrEmpty(row["VALUE"].ToString())) |
|
194 |
{ |
|
195 |
string streamNo = row["VALUE"].ToString(); |
|
196 |
if (HMBDataTable.Select(string.Format("STREAM_NO = '{0}'", streamNo)).Length > 0) |
|
197 |
endRows.Add(row); |
|
198 |
} |
|
199 |
} |
|
200 |
if (endRows.Count > 0) |
|
201 |
{ |
|
202 |
Worksheet worksheet = workbook.Worksheets.Add(template.Name); |
|
203 |
|
|
204 |
bool bFirst = true; |
|
205 |
int startRowIndex = Convert.ToInt32(spinEditRow.EditValue) - 1; |
|
206 |
int startColIndex = Convert.ToInt32(spinEditColumn.EditValue) - 1; |
|
207 |
int dataRowIndex = startRowIndex + 3; |
|
208 |
int colIndex = 0; |
|
209 |
foreach (var row in endRows) |
|
210 |
{ |
|
211 |
string streamNo = row["VALUE"].ToString(); |
|
212 |
DataRow[] streamDataRows = HMBDataTable.Select(string.Format("STREAM_NO = '{0}'", streamNo)); |
|
213 |
if (bFirst) |
|
214 |
{ |
|
215 |
Range range = worksheet.Range.FromLTRB(startColIndex, startRowIndex, startColIndex, startRowIndex + 2); |
|
216 |
range.Borders.SetAllBorders(Color.Black, BorderLineStyle.Thin); |
|
217 |
range.SetValue("NO."); |
|
218 |
range.Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center; |
|
219 |
range.Alignment.Vertical = SpreadsheetVerticalAlignment.Center; |
|
220 |
} |
|
221 |
worksheet[dataRowIndex, startColIndex].SetValue((endRows.IndexOf(row) + 1).ToString()); |
|
222 |
worksheet[dataRowIndex, startColIndex].Borders.SetAllBorders(Color.Black, BorderLineStyle.Thin); |
|
223 |
colIndex = startColIndex + 1; |
|
224 |
// 추가 Attribute Before |
|
225 |
foreach (var attrName in template.CustomAttributeBefore) |
|
226 |
{ |
|
227 |
string sCustomAttr = DB.GetAttributeValue(row["UID"].ToString(), attrName); |
|
228 |
worksheet[dataRowIndex, colIndex].SetValue(sCustomAttr); |
|
229 |
worksheet[dataRowIndex, colIndex].Borders.SetAllBorders(Color.Black, BorderLineStyle.Thin); |
|
230 |
|
|
231 |
if (bFirst) |
|
232 |
{ |
|
233 |
Range range = worksheet.Range.FromLTRB(colIndex, startRowIndex, colIndex, startRowIndex + 2); |
|
234 |
range.SetValue(attrName); |
|
235 |
range.Borders.SetAllBorders(Color.Black, BorderLineStyle.Thin); |
|
236 |
range.Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center; |
|
237 |
range.Alignment.Vertical = SpreadsheetVerticalAlignment.Center; |
|
238 |
} |
|
239 |
colIndex++; |
|
240 |
} |
|
241 |
|
|
242 |
for (int i = 0; i < streamDataRows.Length; i++) |
|
243 |
{ |
|
244 |
DataRow dataRow = streamDataRows[i]; |
|
245 |
if (!template.Case.Contains(dataRow["HMB_LIST_UID"].ToString())) |
|
246 |
continue; |
|
247 |
|
|
248 |
if (bFirst) |
|
249 |
{ |
|
250 |
string sCase = dataRow["CASE"].ToString(); |
|
251 |
string sType = dataRow["TYPE"].ToString(); |
|
252 |
string sName = dataRow["NAME"].ToString(); |
|
253 |
|
|
254 |
worksheet[startRowIndex, colIndex].SetValue(sCase); |
|
255 |
worksheet[startRowIndex + 1, colIndex].SetValue(!string.IsNullOrEmpty(sType) ? sType : sName); |
|
256 |
worksheet[startRowIndex + 2, colIndex].SetValue(sName); |
|
257 |
|
|
258 |
worksheet[startRowIndex, colIndex].Borders.SetAllBorders(Color.Black, BorderLineStyle.Thin); |
|
259 |
worksheet[startRowIndex + 1, colIndex].Borders.SetAllBorders(Color.Black, BorderLineStyle.Thin); |
|
260 |
worksheet[startRowIndex + 2, colIndex].Borders.SetAllBorders(Color.Black, BorderLineStyle.Thin); |
|
261 |
|
|
262 |
worksheet[startRowIndex, colIndex].Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center; |
|
263 |
worksheet[startRowIndex + 1, colIndex].Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center; |
|
264 |
worksheet[startRowIndex + 2, colIndex].Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center; |
|
265 |
|
|
266 |
worksheet[startRowIndex, colIndex].Alignment.Vertical = SpreadsheetVerticalAlignment.Center; |
|
267 |
worksheet[startRowIndex + 1, colIndex].Alignment.Vertical = SpreadsheetVerticalAlignment.Center; |
|
268 |
worksheet[startRowIndex + 2, colIndex].Alignment.Vertical = SpreadsheetVerticalAlignment.Center; |
|
269 |
} |
|
270 |
|
|
271 |
string sValue = dataRow["VALUE"].ToString(); |
|
272 |
string sUnit = dataRow["UNIT"].ToString(); |
|
273 |
|
|
274 |
if (!string.IsNullOrEmpty(sValue)) |
|
275 |
{ |
|
276 |
if (sUnit.Equals("-")) |
|
277 |
worksheet[dataRowIndex, colIndex].SetValue(sValue); |
|
278 |
else |
|
279 |
worksheet[dataRowIndex, colIndex].SetValue(sValue + " " + sUnit); |
|
280 |
} |
|
281 |
worksheet[dataRowIndex, colIndex].Borders.SetAllBorders(Color.Black, BorderLineStyle.Thin); |
|
282 |
colIndex++; |
|
283 |
} |
|
284 |
|
|
285 |
// 추가 Attribute after |
|
286 |
foreach (var attrName in template.CustomAttributeAfter) |
|
287 |
{ |
|
288 |
string sCustomAttr = DB.GetAttributeValue(row["UID"].ToString(), attrName); |
|
289 |
worksheet[dataRowIndex, colIndex].SetValue(sCustomAttr); |
|
290 |
worksheet[dataRowIndex, colIndex].Borders.SetAllBorders(Color.Black, BorderLineStyle.Thin); |
|
291 |
|
|
292 |
if (bFirst) |
|
293 |
{ |
|
294 |
Range range = worksheet.Range.FromLTRB(colIndex, startRowIndex, colIndex, startRowIndex + 2); |
|
295 |
range.SetValue(attrName); |
|
296 |
range.Borders.SetAllBorders(Color.Black, BorderLineStyle.Thin); |
|
297 |
range.Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center; |
|
298 |
range.Alignment.Vertical = SpreadsheetVerticalAlignment.Center; |
|
299 |
} |
|
300 |
colIndex++; |
|
301 |
} |
|
302 |
|
|
303 |
bFirst = false; |
|
304 |
dataRowIndex++; |
|
305 |
|
|
306 |
} |
|
307 |
#region 정리 |
|
308 |
// 세로 |
|
309 |
for (int i = startColIndex; i < int.MaxValue; i++) |
|
310 |
{ |
|
311 |
Cell cell1 = worksheet[startRowIndex, i]; |
|
312 |
Cell cell2 = worksheet[startRowIndex + 1, i]; |
|
313 |
Cell cell3 = worksheet[startRowIndex + 2, i]; |
|
314 |
|
|
315 |
CellValue value1 = worksheet[startRowIndex, i].Value; |
|
316 |
CellValue value2 = worksheet[startRowIndex + 1, i].Value; |
|
317 |
CellValue value3 = worksheet[startRowIndex + 2, i].Value; |
|
318 |
if (string.IsNullOrEmpty(value1.TextValue)) |
|
319 |
break; |
|
320 |
|
|
321 |
if (value1.TextValue.Equals(value2.TextValue) && value2.TextValue.Equals(value3.TextValue)) |
|
322 |
{ |
|
323 |
Range range = worksheet.Range.FromLTRB(i, startRowIndex, i, startRowIndex + 2); |
|
324 |
worksheet.MergeCells(range); |
|
325 |
} |
|
326 |
else if (value2.TextValue.Equals(value3.TextValue)) |
|
327 |
{ |
|
328 |
Range range = worksheet.Range.FromLTRB(i, startRowIndex + 1, i, startRowIndex + 2); |
|
329 |
worksheet.MergeCells(range); |
|
330 |
} |
|
331 |
|
|
332 |
cell1.FillColor = Color.LightGray; |
|
333 |
cell2.FillColor = Color.LightGray; |
|
334 |
cell3.FillColor = Color.LightGray; |
|
335 |
} |
|
336 |
|
|
337 |
// 가로 행 1 |
|
338 |
for (int i = startColIndex; i < int.MaxValue; i++) |
|
339 |
{ |
|
340 |
Cell cell = worksheet[startRowIndex, i]; |
|
341 |
Cell nextCell = worksheet[startRowIndex, i + 1]; |
|
342 |
if (nextCell.IsMerged) |
|
343 |
continue; |
|
344 |
if (nextCell.Value == null || string.IsNullOrEmpty(nextCell.Value.TextValue)) |
|
345 |
break; |
|
346 |
|
|
347 |
string value = string.Empty; |
|
348 |
string nextValue = nextCell.Value.TextValue; |
|
349 |
Range range = null; |
|
350 |
if (cell.IsMerged) |
|
351 |
{ |
|
352 |
range = cell.GetMergedRanges().ToList().First(); |
|
353 |
if (range.LeftColumnIndex.Equals(range.RightColumnIndex)) |
|
354 |
continue; |
|
355 |
value = range.Value.TextValue; |
|
356 |
} |
|
357 |
else |
|
358 |
value = cell.Value.TextValue; |
|
359 |
|
|
360 |
if (value.Equals(nextValue)) |
|
361 |
{ |
|
362 |
int leftCol = 0; |
|
363 |
int rightCol = i + 1; |
|
364 |
if (range == null) |
|
365 |
leftCol = i; |
|
366 |
else |
|
367 |
{ |
|
368 |
leftCol = range.LeftColumnIndex; |
|
369 |
range.UnMerge(); |
|
370 |
} |
|
371 |
Range newRange = worksheet.Range.FromLTRB(leftCol, startRowIndex, rightCol, startRowIndex); |
|
372 |
newRange.Merge(); |
|
373 |
} |
|
374 |
} |
|
375 |
|
|
376 |
// 가로 행 2 |
|
377 |
for (int i = startColIndex; i < int.MaxValue; i++) |
|
378 |
{ |
|
379 |
Cell cell = worksheet[startRowIndex + 1, i]; |
|
380 |
Cell nextCell = worksheet[startRowIndex + 1, i + 1]; |
|
381 |
if (nextCell.IsMerged) |
|
382 |
continue; |
|
383 |
if (nextCell.Value == null || string.IsNullOrEmpty(nextCell.Value.TextValue)) |
|
384 |
break; |
|
385 |
|
|
386 |
string value = string.Empty; |
|
387 |
string nextValue = nextCell.Value.TextValue; |
|
388 |
Range range = null; |
|
389 |
if (cell.IsMerged) |
|
390 |
{ |
|
391 |
range = cell.GetMergedRanges().ToList().First(); |
|
392 |
if (range.LeftColumnIndex.Equals(range.RightColumnIndex)) |
|
393 |
continue; |
|
394 |
value = range.Value.TextValue; |
|
395 |
} |
|
396 |
else |
|
397 |
value = cell.Value.TextValue; |
|
398 |
|
|
399 |
if (value.Equals(nextValue)) |
|
400 |
{ |
|
401 |
int leftCol = 0; |
|
402 |
int rightCol = i + 1; |
|
403 |
if (range == null) |
|
404 |
leftCol = i; |
|
405 |
else |
|
406 |
{ |
|
407 |
leftCol = range.LeftColumnIndex; |
|
408 |
range.UnMerge(); |
|
409 |
} |
|
410 |
Range newRange = worksheet.Range.FromLTRB(leftCol, startRowIndex + 1, rightCol, startRowIndex + 1); |
|
411 |
newRange.Merge(); |
|
412 |
} |
|
413 |
} |
|
414 |
#endregion |
|
415 |
|
|
416 |
worksheet.Columns.AutoFit(startColIndex, colIndex - 1); |
|
417 |
} |
|
418 |
} |
|
419 |
spreadsheetControl.Document.Worksheets.Remove(spreadsheetControl.Document.Worksheets[0]); |
|
420 |
spreadsheetControl.EndUpdate(); |
|
421 |
} |
|
422 |
} |
|
423 |
|
|
424 |
private void btnGroup_Click(object sender, EventArgs e) |
|
425 |
{ |
|
426 |
TemplateForm groupForm = new TemplateForm(); |
|
427 |
groupForm.ShowDialog(); |
|
428 |
} |
|
429 |
|
|
430 |
private void btnExportExcel_Click(object sender, EventArgs e) |
|
431 |
{ |
|
432 |
SaveFileDialog dialog = new SaveFileDialog(); |
|
433 |
dialog.Filter = "Excel File(*.xlsx)|*.xlsx"; |
|
434 |
if (dialog.ShowDialog() == DialogResult.OK) |
|
435 |
spreadsheetControl.Document.SaveDocument(dialog.FileName, DocumentFormat.Xlsx); |
|
436 |
} |
|
437 |
} |
|
438 |
} |
DTI_PID/POSCO_Report/MainForm.resx | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<root> |
|
3 |
<!-- |
|
4 |
Microsoft ResX Schema |
|
5 |
|
|
6 |
Version 2.0 |
|
7 |
|
|
8 |
The primary goals of this format is to allow a simple XML format |
|
9 |
that is mostly human readable. The generation and parsing of the |
|
10 |
various data types are done through the TypeConverter classes |
|
11 |
associated with the data types. |
|
12 |
|
|
13 |
Example: |
|
14 |
|
|
15 |
... ado.net/XML headers & schema ... |
|
16 |
<resheader name="resmimetype">text/microsoft-resx</resheader> |
|
17 |
<resheader name="version">2.0</resheader> |
|
18 |
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
|
19 |
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
|
20 |
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
|
21 |
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
|
22 |
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
|
23 |
<value>[base64 mime encoded serialized .NET Framework object]</value> |
|
24 |
</data> |
|
25 |
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
|
26 |
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
|
27 |
<comment>This is a comment</comment> |
|
28 |
</data> |
|
29 |
|
|
30 |
There are any number of "resheader" rows that contain simple |
|
31 |
name/value pairs. |
|
32 |
|
|
33 |
Each data row contains a name, and value. The row also contains a |
|
34 |
type or mimetype. Type corresponds to a .NET class that support |
|
35 |
text/value conversion through the TypeConverter architecture. |
|
36 |
Classes that don't support this are serialized and stored with the |
|
37 |
mimetype set. |
|
38 |
|
|
39 |
The mimetype is used for serialized objects, and tells the |
|
40 |
ResXResourceReader how to depersist the object. This is currently not |
|
41 |
extensible. For a given mimetype the value must be set accordingly: |
|
42 |
|
|
43 |
Note - application/x-microsoft.net.object.binary.base64 is the format |
|
44 |
that the ResXResourceWriter will generate, however the reader can |
|
45 |
read any of the formats listed below. |
|
46 |
|
|
47 |
mimetype: application/x-microsoft.net.object.binary.base64 |
|
48 |
value : The object must be serialized with |
|
49 |
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
|
50 |
: and then encoded with base64 encoding. |
|
51 |
|
|
52 |
mimetype: application/x-microsoft.net.object.soap.base64 |
|
53 |
value : The object must be serialized with |
|
54 |
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
|
55 |
: and then encoded with base64 encoding. |
|
56 |
|
|
57 |
mimetype: application/x-microsoft.net.object.bytearray.base64 |
|
58 |
value : The object must be serialized into a byte array |
|
59 |
: using a System.ComponentModel.TypeConverter |
|
60 |
: and then encoded with base64 encoding. |
|
61 |
--> |
|
62 |
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
|
63 |
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
|
64 |
<xsd:element name="root" msdata:IsDataSet="true"> |
|
65 |
<xsd:complexType> |
|
66 |
<xsd:choice maxOccurs="unbounded"> |
|
67 |
<xsd:element name="metadata"> |
|
68 |
<xsd:complexType> |
|
69 |
<xsd:sequence> |
|
70 |
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
|
71 |
</xsd:sequence> |
|
72 |
<xsd:attribute name="name" use="required" type="xsd:string" /> |
|
73 |
<xsd:attribute name="type" type="xsd:string" /> |
|
74 |
<xsd:attribute name="mimetype" type="xsd:string" /> |
|
75 |
<xsd:attribute ref="xml:space" /> |
|
76 |
</xsd:complexType> |
|
77 |
</xsd:element> |
|
78 |
<xsd:element name="assembly"> |
|
79 |
<xsd:complexType> |
|
80 |
<xsd:attribute name="alias" type="xsd:string" /> |
|
81 |
<xsd:attribute name="name" type="xsd:string" /> |
|
82 |
</xsd:complexType> |
|
83 |
</xsd:element> |
|
84 |
<xsd:element name="data"> |
|
85 |
<xsd:complexType> |
|
86 |
<xsd:sequence> |
|
87 |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
88 |
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
|
89 |
</xsd:sequence> |
|
90 |
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
|
91 |
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
|
92 |
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
|
93 |
<xsd:attribute ref="xml:space" /> |
|
94 |
</xsd:complexType> |
|
95 |
</xsd:element> |
|
96 |
<xsd:element name="resheader"> |
|
97 |
<xsd:complexType> |
|
98 |
<xsd:sequence> |
|
99 |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
100 |
</xsd:sequence> |
|
101 |
<xsd:attribute name="name" type="xsd:string" use="required" /> |
|
102 |
</xsd:complexType> |
|
103 |
</xsd:element> |
|
104 |
</xsd:choice> |
|
105 |
</xsd:complexType> |
|
106 |
</xsd:element> |
|
107 |
</xsd:schema> |
|
108 |
<resheader name="resmimetype"> |
|
109 |
<value>text/microsoft-resx</value> |
|
110 |
</resheader> |
|
111 |
<resheader name="version"> |
|
112 |
<value>2.0</value> |
|
113 |
</resheader> |
|
114 |
<resheader name="reader"> |
|
115 |
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
116 |
</resheader> |
|
117 |
<resheader name="writer"> |
|
118 |
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
119 |
</resheader> |
|
120 |
<metadata name="defaultLookAndFeel.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
|
121 |
<value>17, 17</value> |
|
122 |
</metadata> |
|
123 |
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> |
|
124 |
<data name="btnGroup.ImageOptions.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
|
125 |
<value> |
|
126 |
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAACt0RVh0VGl0 |
|
127 |
bGUAU2V0dXA7Q3VzdG9taXo7RGVzaWduO1NldHRpbmc7UHJvcGVydDgftSEAAApzSURBVFhHnVdnVFVX |
|
128 |
Fr7WkGKmJJkxa7ISgyODiUQdUSMKFkSUGAU1gqBA4mCJDQyg+FAJxRIBUVZQo6CoCKigFJH+6B0UEKQL |
|
129 |
0rsIdlx7vn3ee6iz5sdM9lof5917zznf7ucg/Q4ZBowARgNqSrwFjASGA/+/HDgW/N/hw7gkeQDuRy/x |
|
130 |
VEFuv+/4DDevi+TqdZ5cPc+Ti2cgLV258Wt8YyWG7Tt8Vtp7CDgYIDkf9JdkHmekPR6nBZzcf5N2u52S |
|
131 |
drue5P0UwmQvBl++AQiTCbz2ji0cJTtw2is1q4SePR8USMm8TassbI/iG3uD5wytVT6Ld719j6TevgGp |
|
132 |
+8GA5ODih1dKeV0BiGoRu5kt4lG1CT+/s/ewf1ljSxf1PnxM7d0Pqba+hVavsy/HtzEAh4bnMV4P0yhg |
|
133 |
eBfIu3r7pZ/2+uJRKe4+QW+QG3675l2XI+eigXg7mbcO3ok4r7NxmLDb1c/D0+8yPX32QpA3t/cSLKPN |
|
134 |
tu60xMTmkLGpzUTMZUXGWG3cvXCn87EkO5nPzfEaWh/iHSs0vLOnX7KVHcNPpbh5Xxxy8SKQu3kHxpRV |
|
135 |
1lNFzX06GRhJzh6nb+xxOxV22DdkMDo+m1rauql/4Kkgb2ztofsAzz8VcJXcPAMHbZ28o2z3+CR7nwyl |
|
136 |
wuIqyi4oJzvZ0YRx47/4CBysxLAdu72ZTyE/e13gga0fse+wf3RZZYOwsP/RU3r85DkVl9VSTmE5DYjn |
내보내기 Unified diff