回答編集履歴

1

内容を移動しました

2020/11/19 03:26

投稿

byori
byori

スコア72

test CHANGED
@@ -1,295 +1 @@
1
- コードをここ載せました
2
-
3
-
4
-
5
- ```C#
6
-
7
- public DataTable MakeItak()
8
-
9
- {
10
-
11
- DataTable table;
12
-
13
- string doc = (string)Session["ItakDocMei"]; // 名前が入る
14
-
15
- string doc2 = doc.Replace(" ", "");
16
-
17
- doc2 = doc2.Replace(" ", "");
18
-
19
-
20
-
21
- if (doc2 == "全員")
22
-
23
- table = MakeItakByoriIList();
24
-
25
- else
26
-
27
- table = MakeItakByoriI();
28
-
29
-
30
-
31
- return table;
32
-
33
- }
34
-
35
-
36
-
37
- public DataTable MakeItakByoriIList(/*IEnumerable<AllocationTable> alloc*/)
38
-
39
- {
40
-
41
- // 売上一覧は、指定月から1年間表示する
42
-
43
- int pos = 1; // Array.IndexOf(tsuki, tsu);
44
-
45
- //string[] tsuki = { "", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14" };
46
-
47
- string[] lists = { " 名前 ", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", " 合 計" };
48
-
49
- string[] header = { "user", "day11", "day12",
50
-
51
- "day13", "day14", "day15", "day16", "day17", "day18", "day19", "day20", "day21", "day22", "day23", "day24", "day25",
52
-
53
- "day26", "day27", "day28", "day29", "day30", "day31", "day01", "day02", "day03", "day04", "day05", "day06", "day07", "day08", "day09", "day10", "day32" };
54
-
55
-
56
-
57
- DataRow row;
58
-
59
- int[] ryokin = new int[header.Length];
60
-
61
- int sNen = DateTime.Now.Year;
62
-
63
- DataTable table = new DataTable();
64
-
65
-
66
-
67
- for (int i = 0; i < lists.Length; i++)
68
-
69
- {
70
-
71
- DataColumn col = new DataColumn();
72
-
73
-
74
-
75
- col.DataType = Type.GetType("System.String");
76
-
77
- col.ColumnName = header[i];
78
-
79
- col.Caption = lists[i];
80
-
81
-
82
-
83
- table.Columns.Add(col);
84
-
85
- }
86
-
87
-
88
-
89
- string date = (string)Session["Itak"];   // 日付 202011 を取得
90
-
91
- var alloc = GetByoriIData(date); // 上記日付のデータ取得
92
-
93
- ShukeiAll(alloc);               // 上記で取得した日付を表示用に集計
94
-
95
- // GetByoriIData() と ShukeiAll() は問題ないので割愛します。データはDBより取得
96
-
97
- // details は、上記での集計結果が入っています。
98
-
99
- foreach (var dat in details)
100
-
101
- {
102
-
103
- row = table.NewRow();
104
-
105
-
106
-
107
- HyperLink lnk = new HyperLink();
108
-
109
- // 自分自身
110
-
111
- string txt = (string)Session["myAdress"] + "/ByoriIItakuForm.aspx";
112
-
113
- lnk.NavigateUrl = txt;
114
-
115
- lnk.Text = dat.Value.DrMei;
116
-
117
- //LinkButton lnk = new LinkButton();
118
-
119
- //lnk.PostBackUrl = txt;
120
-
121
- //lnk.Text = dat.Value.DrMei;
122
-
123
-
124
-
125
- row[0] = HttpUtility.HtmlEncode("<a href = 'ByoriIitakForm.aspx'>")+ dat.Value.DrMei + HttpUtility.HtmlEncode("</a>");
126
-
127
- //row[0] = lnk; //dat.Value.DrMei;
128
-
129
- row[1] = dat.Value.day11;
130
-
131
- row[2] = dat.Value.day12;
132
-
133
- row[3] = dat.Value.day13;
134
-
135
- row[4] = dat.Value.day14;
136
-
137
- row[5] = dat.Value.day15;
138
-
139
- row[6] = dat.Value.day16;
140
-
141
- row[7] = dat.Value.day17;
142
-
143
- row[8] = dat.Value.day18;
144
-
145
- row[9] = dat.Value.day19;
146
-
147
- row[10] = dat.Value.day20;
148
-
149
- row[11] = dat.Value.day21;
150
-
151
- row[12] = dat.Value.day22;
152
-
153
- row[13] = dat.Value.day23;
154
-
155
- row[14] = dat.Value.day24;
156
-
157
- row[15] = dat.Value.day25;
158
-
159
- row[16] = dat.Value.day26;
160
-
161
- row[17] = dat.Value.day27;
162
-
163
- row[18] = dat.Value.day28;
164
-
165
- row[19] = dat.Value.day29;
166
-
167
- row[20] = dat.Value.day30;
168
-
169
- row[21] = dat.Value.day31;
170
-
171
- row[22] = dat.Value.day01;
172
-
173
- row[23] = dat.Value.day02;
174
-
175
- row[24] = dat.Value.day03;
176
-
177
- row[25] = dat.Value.day04;
178
-
179
- row[26] = dat.Value.day05;
180
-
181
- row[27] = dat.Value.day06;
182
-
183
- row[28] = dat.Value.day07;
184
-
185
- row[29] = dat.Value.day08;
186
-
187
- row[30] = dat.Value.day09;
188
-
189
- row[31] = dat.Value.day10;
190
-
191
- row[32] = Gokei(dat.Value) + "(" + Gokei2(dat.Value) + ")";
192
-
193
-
194
-
195
- table.Rows.Add(row);
196
-
197
- }
198
-
199
-
200
-
201
- int nn = table.Rows.Count;
202
-
203
-
204
-
205
- return table;
206
-
207
- }
208
-
209
- ```
210
-
211
- ```ここに言語を入力
212
-
213
- <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ByoriIItakuForm.aspx.cs" Inherits="WebHoken.ByoriIItakuForm" %>
214
-
215
-
216
-
217
- <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
218
-
219
-
220
-
221
- <!DOCTYPE html>
222
-
223
-
224
-
225
- <html xmlns="http://www.w3.org/1999/xhtml">
226
-
227
- <head runat="server">
228
-
229
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
230
-
231
- <title></title>
232
-
233
- </head>
234
-
235
- <body>
236
-
237
- <form id="form1" runat="server">
238
-
239
- <asp:ScriptManager ID="ScriptManager1" runat="server">
240
-
241
- </asp:ScriptManager>
242
-
243
- <div class="row">
244
-
245
-
246
-
247
- <div>
248
-
249
- <p>
250
-
251
- <asp:TextBox ID="TextBox1" Font-Size="Medium" Width="350" runat="server" Text=""></asp:TextBox>
252
-
253
- </p>
254
-
255
- <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" WaitMessageFont-Names="Verdana"
256
-
257
- WaitMessageFont-Size="14pt" Width="1920px" Height="700px">
258
-
259
- <localreport reportpath="ReportItakuDoctor2.rdlc">
260
-
261
- <DataSources>
262
-
263
- <rsweb:ReportDataSource DataSourceId="ObjectDataSource2" Name="DataSet1" />
264
-
265
- </DataSources>
266
-
267
- </localreport>
268
-
269
- </rsweb:ReportViewer>
270
-
271
-
272
-
273
- <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="MakeItak" TypeName="WebHoken.ByoriIItakuForm" OldValuesParameterFormatString="original_{0}"></asp:ObjectDataSource>
274
-
275
- </div>
276
-
277
- </div>
278
-
279
- </form>
280
-
281
- </body>
282
-
283
- </html>
284
-
285
- ```
286
-
287
- ReportItakuDoctor2.rdlc も載せようとしましたが、コードが長くアップロードの失敗しました。
288
-
289
- 見たい個所があれば教えてください。
290
-
291
-
292
-
293
- また、ASP.NET のバージョンはどこを見ればわかるでしょうか?
294
-
295
- 教えてください。
1
+ 質問欄移動しました