TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Đạt Lữ
NA
8
584
[what's my wrong? and why my file excel don't create file?]
Sep 21 2017 9:58 PM
private
void
btnExportExcel_Click(
object
sender, EventArgs e)
{
string
filePath = GetFileNameToSave();
if
(
string
.IsNullOrEmpty(filePath))
{
return
;
}
pivotGrid.ExportToXlsx(filePath);
ActionNotifier.Information(
"Exported file Excel."
);
System.Diagnostics.Process.Start(filePath);
}
static
string
GetFileNameToSave()
{
string
fNameDefault = String.Format(
"{0}.{1}.xlsx"
,
"Export"
, DateTime.Now.ToString(
"yy.MM.dd_hh.mm"
));
using
(SaveFileDialog dlgSave =
new
SaveFileDialog { Title =
"Export Excel"
, Filter =
"Excel file |*.xlsx "
, FileName = fNameDefault })
{
dlgSave.OverwritePrompt =
true
;
dlgSave.RestoreDirectory =
true
;
if
(dlgSave.ShowDialog() != DialogResult.OK || !dlgSave.CheckPathExists)
return
null
;
dlgSave.AddExtension =
true
;
string
fileName = dlgSave.FileName.Trim();
if
(!fileName.EndsWith(
".xlsx"
))
fileName +=
".xlsx"
;
return
fileName;
}
}
Reply
Answers (
1
)
How to track action of user on asp.net application !!
xamarin using Android application hide soft keyborad