JAYESH A J

JAYESH A J

  • NA
  • 60
  • 8.7k

Downloading excel with notification

Jan 23 2019 4:51 AM
var excelname = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss");
StreamWriter wr = new StreamWriter(@"D:\\BidderReport" + excelname + ".xls");
try
{
for (int i = 0; i < filterdt.Columns.Count; i++)
{
wr.Write(filterdt.Columns[i].ToString().ToUpper() + "\t");
}
wr.WriteLine();
//write rows to excel file
for (int i = 0; i < (filterdt.Rows.Count); i++)
{
for (int j = 0; j < filterdt.Columns.Count; j++)
{
if (filterdt.Rows[i][j] != null)
{
wr.Write(Convert.ToString(filterdt.Rows[i][j]) + "\t");
}
else
{
wr.Write("\t");
}
}
//go to next line
wr.WriteLine();
}
//close file
wr.Close();
 
I want the notification along with file save.
 
The notification push notification that occurs while downloading any object in Chrome or Mozilla browser at the bottom in Downloads. I want this also to happen which is not happening currently. The save though is working.
 
If there is a better way to do this do specify that also. 

Answers (1)