Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DataCenter_Core2.1_20190520
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bltdc
DataCenter_Core2.1_20190520
Commits
f2ab9559
Commit
f2ab9559
authored
Jul 09, 2021
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决导出显示的列头不对的问题
parent
4e584ac9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
PlatformOrderController.cs
...reas/DataWareHouse/Controllers/PlatformOrderController.cs
+8
-6
OrderBillings.cshtml
...as/DataWareHouse/Views/PlatformOrder/OrderBillings.cshtml
+1
-1
No files found.
Bailun.DC.Web/Areas/DataWareHouse/Controllers/PlatformOrderController.cs
View file @
f2ab9559
...
...
@@ -130,10 +130,12 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
DataTable
dataTable
=
new
DataTable
();
//实例化
var
objFirst
=
obj
.
FirstOrDefault
();
var
jsonData
=
Newtonsoft
.
Json
.
JsonConvert
.
DeserializeObject
<
Dictionary
<
string
,
string
>>(
objFirst
.
jsondata
);
var
colnames
=
new
List
<
string
>();
foreach
(
var
item
in
jsonData
)
{
dataTable
.
Columns
.
Add
(
item
.
Key
,
typeof
(
string
));
colnames
.
Add
(
item
.
Key
);
}
foreach
(
var
item
in
obj
)
...
...
@@ -151,11 +153,11 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
dataTable
.
Rows
.
Add
(
dataRow
);
}
var
colnames
=
new
List
<
string
>();
for
(
var
i
=
0
;
i
<
dataTable
.
Columns
.
Count
;
i
++)
{
colnames
.
Add
(
dataTable
.
Columns
[
i
].
ColumnName
);
}
//
for (var i = 0; i < dataTable.Columns.Count; i++)
//
{
//
colnames.Add(dataTable.Columns[i].ColumnName);
//
}
var
listVal
=
new
List
<
string
>();
for
(
int
j
=
0
;
j
<
dataTable
.
Rows
.
Count
;
j
++)
...
...
@@ -175,7 +177,7 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
var
guid
=
Guid
.
NewGuid
().
ToString
();
var
filename
=
platform
+
" "
+
month
+
"的账单流水"
;
var
filepath
=
_hostingEnvironment
.
WebRootPath
+
"\\Files\\Report\\"
+
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
)
+
"\\"
;
ToCSV
(
listVal
,
listVal
,
guid
,
filepath
);
ToCSV
(
listVal
,
colnames
,
guid
,
filepath
);
var
ms
=
new
System
.
IO
.
MemoryStream
();
using
(
var
f
=
new
System
.
IO
.
FileStream
(
filepath
+
guid
+
".csv"
,
System
.
IO
.
FileMode
.
Open
))
...
...
Bailun.DC.Web/Areas/DataWareHouse/Views/PlatformOrder/OrderBillings.cshtml
View file @
f2ab9559
...
...
@@ -280,7 +280,7 @@
}
function ExportCSV() {
var website = $('#website').val();
//
var website = $('#website').val();
var month = $('#month').val();
if (website == '') {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment