public static void ReplaceResponseWithXLS(DataSet d, HttpResponse response, List <string> summary, string fileName)
 {
     response.ClearContent();
     response.ContentType = "application/ms-excel";
     response.AppendHeader("Content-disposition", "Attachment; filename=" + fileName + ".xml");
     ExcelEngine.Convert(d, response.OutputStream, 2, 2, summary);
     response.End();
 }
示例#2
0
        private void ParSearchToXLS()
        {
            var dtst    = GetDtst();
            var summary = new List <string> {
                ""
            };

            Response.ContentType = "application/ms-excel";
            Response.ClearContent();
            Response.AppendHeader("Content-disposition", "Attachment; filename=MultipleFilingSearchResult.xml");
            ExcelEngine.Convert(dtst, Response.OutputStream, 0, 0, summary);
            Response.End();
        }
示例#3
0
        void AddExcelAttachment(DataTable table)
        {
            var dtst = new DataSet();

            dtst.Tables.Add(table);
            table.TableName = "Search_Results";
            Response.ClearContent();
            Response.ContentType = "application/ms-excel";
            Response.AppendHeader("Content-disposition", "Attachment; filename=SECfilingsSearchResult.xml");
            //attachments
            var summary = new List <string>
            {
                "Exported data from timeline Chart"
            };

            ExcelEngine.Convert(dtst, Response.OutputStream, 2, 2, summary);
            Response.End();
        }
示例#4
0
        private void PublishDatasetToExcel(DataSet dtst)
        {
            var fileName2 = Path.Combine(this.textFolder.Text, "FileList" + DateTime.Now.ToString("yyyyMMddHHmm") + ".xls");
            var fileS     = File.OpenWrite(fileName2);

            ExcelEngine.Convert(dtst, fileS, 2, 2, _summary);
            fileS.Close();
            this.textOutPut.AppendText("Your file list has been saved to: " + fileName2 + "\r\n");
            var notePad = new Process {
                StartInfo = { FileName = fileName2 }
            };

            try
            {
                notePad.Start();
            }catch//(Exception ex)
            {
                this.textOutPut.AppendText("Unable to launch Excel Doc\r\n");
            }
        }