本文整理汇总了C#中DiskFileDestinationOptions类的典型用法代码示例。如果您正苦于以下问题:C# DiskFileDestinationOptions类的具体用法?C# DiskFileDestinationOptions怎么用?C# DiskFileDestinationOptions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DiskFileDestinationOptions类属于命名空间,在下文中一共展示了DiskFileDestinationOptions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Export_pdf
private void Export_pdf(DataTable dt_export, string branch_code, string type, string folderOut)
{
try
{
if (dt_export.Rows.Count > 0)
{
string file_path = folderOut.Trim() + branch_code.Trim() + "_" + type + "_" + dpFromDate.Text.Trim().Replace("/", "") + "_"
+ dpToDate.Text.Trim().Replace("/", "") + ".pdf";
PHT06 cry = new PHT06();
cry.SetDataSource(dt_export);
string title = "DANH SÁCH THẺ ĐÃ PHÁT HÀNH, IN PIN";
cry.SetParameterValue("Title", title);
cry.SetParameterValue("Fromdate", dpFromDate.Text.Trim());
cry.SetParameterValue("Todate", dpToDate.Text.Trim());
ExportOptions CrExportOptions;
DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions();
CrDiskFileDestinationOptions.DiskFileName = file_path;// tbFilePath.Text.Trim() + "\\" + card_number.Trim() + ".pdf";//"c:\\csharp.net-informations.pdf";
CrExportOptions = cry.ExportOptions;
{
CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
//CrExportOptions.ExportFormatType = ExportFormatType.WordForWindows;
CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
CrExportOptions.FormatOptions = CrFormatTypeOptions;
}
cry.Export();
//--Fix for Load Report failse
if (cry != null)
{
cry.Close();
cry.Dispose();
}
}
}
catch (Exception ex)
{
//MessageBox.Show("Err Export_pdf: \n Branch: "+ branch_code +"\n" + ex.ToString());
string[] row = { branch_code, ex.ToString() };
dgv_err.Rows.Add(row);
}
}
示例2: GeneratePDF
private void GeneratePDF()
{
ReportDocument rpt = new ReportDocument();
rpt.Load(Server.MapPath(Constants.ROOT_DIRECTORY + "/Reports/ChartOfAccountsSummary.rpt"));
ExportOptions exportop = new ExportOptions();
DiskFileDestinationOptions dest = new DiskFileDestinationOptions();
string strPath = Server.MapPath(@"\RetailPlus\temp\");
string strFileName = "po_" + Session["UserName"].ToString() + "_" + DateTime.Now.ToString("yyyyMMddhhmmssff") + ".pdf";
if (System.IO.File.Exists(strPath + strFileName))
System.IO.File.Delete(strPath + strFileName);
dest.DiskFileName = strPath + strFileName;
exportop = rpt.ExportOptions;
SetDataSource(rpt);
exportop.DestinationOptions = dest;
exportop.ExportDestinationType = ExportDestinationType.DiskFile;
exportop.ExportFormatType = ExportFormatType.PortableDocFormat;
rpt.Export(); rpt.Close(); rpt.Dispose();
fraViewer.Attributes.Add("src","/RetailPlus/temp/" + strFileName);
}
示例3: GenerateWord
private void GenerateWord()
{
ReportDocument rpt = new ReportDocument();
rpt.Load(Server.MapPath(Constants.ROOT_DIRECTORY + "/Reports/GeneralLedger.rpt"));
ExportOptions exportop = new ExportOptions();
DiskFileDestinationOptions dest = new DiskFileDestinationOptions();
string strPath = Server.MapPath(@"\retailplus\temp\");
string strFileName = "generalledger_" + Session["UserName"].ToString() + "_" + DateTime.Now.ToString("yyyyMMddhhmmssff") + ".doc";
if (System.IO.File.Exists(strPath + strFileName))
System.IO.File.Delete(strPath + strFileName);
dest.DiskFileName = strPath + strFileName;
exportop = rpt.ExportOptions;
SetDataSource(rpt);
exportop.DestinationOptions = dest;
exportop.ExportDestinationType = ExportDestinationType.DiskFile;
exportop.ExportFormatType = ExportFormatType.WordForWindows;
rpt.Export(); rpt.Close(); rpt.Dispose();
fraViewer.Attributes.Add("src","/retailplus/temp/" + strFileName);
}
示例4: ExportarEXCEL
private void ExportarEXCEL(ReportDocument rep)
{
String ruta_exportacion;
ruta_exportacion = Server.MapPath(System.Configuration.ConfigurationSettings.AppSettings["ruta_exportacion_pdf"]);
//ruta_exportacion = System.Configuration.ConfigurationSettings.AppSettings["ruta_exportacion_pdf"];
ExportOptions exportOpts = new ExportOptions();
DiskFileDestinationOptions diskOpts = new DiskFileDestinationOptions();
exportOpts = rep.ExportOptions;
exportOpts.ExportFormatType = ExportFormatType.Excel;
exportOpts.ExportDestinationType = ExportDestinationType.DiskFile;
diskOpts.DiskFileName = ruta_exportacion + Session.SessionID.ToString() + ".xls";
exportOpts.DestinationOptions = diskOpts;
rep.Export();
Response.ClearContent();
Response.ClearHeaders();
Response.AddHeader ("Content-Disposition", "attachment;filename=Morosidad.xls");
Response.ContentType = "application/vnd.ms-excel";
Response.WriteFile(diskOpts.DiskFileName.ToString());
Response.Flush();
Response.Close();
System.IO.File.Delete(diskOpts.DiskFileName.ToString());
}
示例5: ExportarPDF
private void ExportarPDF(ReportDocument rep)
{
String ruta_exportacion;
ruta_exportacion = Server.MapPath(System.Configuration.ConfigurationSettings.AppSettings["ruta_exportacion_pdf"]);
//ruta_exportacion = System.Configuration.ConfigurationSettings.AppSettings["ruta_exportacion_pdf"];
ExportOptions exportOpts = new ExportOptions();
DiskFileDestinationOptions diskOpts = new DiskFileDestinationOptions();
exportOpts = rep.ExportOptions;
exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat;
exportOpts.ExportDestinationType = ExportDestinationType.DiskFile;
diskOpts.DiskFileName = ruta_exportacion + Session.SessionID.ToString() + ".pdf";
exportOpts.DestinationOptions = diskOpts;
rep.Export();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
Response.WriteFile(diskOpts.DiskFileName.ToString());
Response.Flush();
Response.Close();
System.IO.File.Delete(diskOpts.DiskFileName.ToString());
}
示例6: VistaPrevia
public void VistaPrevia(string key)
{
try
{
ReportDocument objRpt = new ReportDocument();
DataSet ds = (DataSet)this.GetDataReport(key);
//string reportPath = Application.StartupPath + "\\Reporte\\co_ordenCompra_rpt.rpt";
string reportPath = "C:\\Reportes\\CR_Cliente_rpt01.rpt";
objRpt.Load(reportPath);
DiskFileDestinationOptions crDiskFileDestinationOption = new DiskFileDestinationOptions();
PdfRtfWordFormatOptions crFormatTypeOption = new PdfRtfWordFormatOptions();
ExportOptions crExportOptions = new ExportOptions();
objRpt.SetDataSource(ds.Tables[0]);
string strfolder = "C:\\Reporte\\";
crDiskFileDestinationOption.DiskFileName = strfolder + "Cliente.pdf";
crExportOptions = objRpt.ExportOptions;
crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
crExportOptions.ExportDestinationOptions = crDiskFileDestinationOption;
crExportOptions.ExportFormatOptions = crFormatTypeOption;
crystalReportViewer1.ReportSource = objRpt;
//objRpt.Export();
}
catch (Exception ex)
{
ex.ToString();
}
}
示例7: Export
public virtual void Export(string aFileName)
{
ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
DiskFileDestinationOptions lDestOpt = new DiskFileDestinationOptions();
lDestOpt.DiskFileName = aFileName;
ExportOptions.DestinationOptions = lDestOpt;
if (Source.Opened)
Source.Document.Export(ExportOptions);
}
示例8: GenerateReport
public static void GenerateReport(string FileName, ReportDocument rpt, System.Web.UI.Control ClientScriptBlockControl, ExportFormatType pvtExportFormatType)
{
try
{
ExportOptions exportop = new ExportOptions();
DiskFileDestinationOptions dest = new DiskFileDestinationOptions();
string strFileExtensionName = ".pdf";
switch (pvtExportFormatType)
{
case ExportFormatType.PortableDocFormat: strFileExtensionName = ".pdf"; exportop.ExportFormatType = ExportFormatType.PortableDocFormat; break;
case ExportFormatType.WordForWindows: strFileExtensionName = ".doc"; exportop.ExportFormatType = ExportFormatType.WordForWindows; break;
case ExportFormatType.Excel: strFileExtensionName = ".xls"; exportop.ExportFormatType = ExportFormatType.Excel; break;
}
string strPath = System.Web.HttpContext.Current.Server.MapPath(@"\retailplus\temp\");
string strFileName = FileName + "_" + DateTime.Now.ToString("yyyyMMddhhmmssff") + strFileExtensionName;
if (System.IO.File.Exists(strPath + strFileName))
System.IO.File.Delete(strPath + strFileName);
dest.DiskFileName = strPath + strFileName;
exportop.DestinationOptions = dest;
exportop.ExportDestinationType = ExportDestinationType.DiskFile;
rpt.Export(exportop); //rpt.Close(); rpt.Dispose();
// remove the error
if (pvtExportFormatType == ExportFormatType.WordForWindows || pvtExportFormatType == ExportFormatType.Excel || pvtExportFormatType == ExportFormatType.PortableDocFormat)
{
// the maximum report processing jobs limit configured by your system administrator has been reached.
rpt.Close(); rpt.Dispose();
}
if (pvtExportFormatType == ExportFormatType.PortableDocFormat)
{
string newWindowUrl = Constants.ROOT_DIRECTORY + "/temp/" + strFileName;
string javaScript = "window.open('" + newWindowUrl + "');";
System.Web.UI.ScriptManager.RegisterClientScriptBlock(ClientScriptBlockControl, ClientScriptBlockControl.GetType(), "openwindow", javaScript, true);
}
else
{
string newWindowUrl = Constants.ROOT_DIRECTORY + "/temp/" + strFileName;
string javaScript = "window.open('" + newWindowUrl + "','_self');";
System.Web.UI.ScriptManager.RegisterClientScriptBlock(ClientScriptBlockControl, ClientScriptBlockControl.GetType(), "openwindow", javaScript, true);
//System.Diagnostics.Process p = new System.Diagnostics.Process();
//p.StartInfo.FileName = System.Web.HttpContext.Current.Server.MapPath(Constants.ROOT_DIRECTORY + "/temp/" + strFileName);
//p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
//p.Start();
}
}
catch (Exception ex) { throw ex; }
}
示例9: PrintReport
public void PrintReport(string key)
{
try
{
ReportDocument objRpt = new ReportDocument();
DataSet ds = (DataSet)this.GetDataReport(key);
string reportPath = "C:\\Reportes\\CRIngreso_etiqueta02.rpt";
objRpt.Load(reportPath);
DiskFileDestinationOptions crDiskFileDestinationOption = new DiskFileDestinationOptions();
PdfRtfWordFormatOptions crFormatTypeOption = new PdfRtfWordFormatOptions();
ExportOptions crExportOptions = new ExportOptions();
objRpt.SetDataSource(ds.Tables[0]);
string strfolder = "C:\\Reporte\\";
crDiskFileDestinationOption.DiskFileName = strfolder + "Etiqueta.pdf";
crExportOptions = objRpt.ExportOptions;
crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
crExportOptions.ExportDestinationOptions = crDiskFileDestinationOption;
crExportOptions.ExportFormatOptions = crFormatTypeOption;
objRpt.Export();
this.printDialog1.Document = this.printDocument1;
DialogResult dr = this.printDialog1.ShowDialog();
if (dr == DialogResult.OK)
{
PageMargins margins;
margins = objRpt.PrintOptions.PageMargins;
margins.bottomMargin = 250;
margins.leftMargin = 250;
margins.rightMargin = 250;
margins.topMargin = 250;
objRpt.PrintOptions.ApplyPageMargins(margins);
string PrinterName = this.printDocument1.PrinterSettings.PrinterName;
objRpt.PrintOptions.PrinterName = PrinterName;
objRpt.PrintToPrinter(1, false, 0, 0);
}
}
catch (Exception ex)
{
ex.ToString();
}
}
示例10: GeneratePDF
public void GeneratePDF(string poId)
{
ReportDocument rptDoc = new ReportDocument();
dsPSMS ds = new dsPSMS();
DataTable dt = new DataTable();
dt.TableName = "PO";
dt = getAllPOs();
ds.Tables["dtPO"].Merge(dt);
//subreport data table
dt = new DataTable();
dt.TableName = "Terms";
dt = getAllTerms();
ds.Tables["dtTerms"].Merge(dt);
rptDoc.Load(Server.MapPath("~/Reports/crPO.rpt"));
rptDoc.SetDataSource(ds);
string fileName = "PO" + poId + "_.pdf";
String targetFolder = Server.MapPath(POAttachmentfolderPath);
ExportOptions CrExportOptions;
DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions();
CrDiskFileDestinationOptions.DiskFileName = targetFolder + "\\" + fileName;
CrExportOptions = rptDoc.ExportOptions;
{
CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
CrExportOptions.FormatOptions = CrFormatTypeOptions;
}
rptDoc.Export();
string strFields = "";
string[] strValues = new string[3];
strFields = "[POID],[FilePath],[Note]";
string filePath = POAttachmentfolderPath + "/" + fileName;
string sqlStr = "select [FilePath] from [dbo].[POAttach] where [FilePath][email protected]";
DataTable hasData = am.DataAccess.RecordSet(sqlStr, new string[] { filePath });
if (hasData.Rows.Count == 0)
{
strValues = new string[] { poId.ToString() , filePath , txtAttachmentNote.Text.Trim() };
am.DataAccess.BatchQuery.Insert("[dbo].[POAttach]", strFields, strValues);
am.DataAccess.BatchQuery.Execute();
}
}
示例11: btnExport_Click
/// <summary>
/// Sự kiện xuất Format options
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnExport_Click(object sender, EventArgs e)
{
string fileName = "E:\\ReportSource\\Report_Test\\Report_Test\\bin\\Export.xls";
SaveFileDialog save = new SaveFileDialog();
save.Filter = "Crystal report |(*.rpt)| Portable Document Format |(*.pdf)| MS Excel 97-2003 |(*.xls)| MS Excel 97-2003 (Data Only)|(*.xls)| MS Word |(*.doc)|";
ExportOptions _exportOpts = new ExportOptions();
DiskFileDestinationOptions _diskDesOpts = new DiskFileDestinationOptions();
_exportOpts = report.ExportOptions;
if (save.FileName != "")
{
switch (save.FilterIndex)
{
case 1:
_exportOpts.ExportFormatType = ExportFormatType.CrystalReport;
break;
case 2:
_exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat;
Export_Opts _frmExpOpts = new Export_Opts();
_frmExpOpts.ShowDialog();
break;
case 3:
_exportOpts.ExportFormatType = ExportFormatType.Excel;
ExcelFormatOption _frmExFormatOpts = new ExcelFormatOption();
_frmExFormatOpts.ShowDialog();
break;
case 4:
_exportOpts.ExportFormatType = ExportFormatType.ExcelRecord;
_frmExFormatOpts = new ExcelFormatOption();
_frmExFormatOpts.ShowDialog();
break;
case 5:
_exportOpts.ExportFormatType = ExportFormatType.WordForWindows;
_frmExpOpts = new Export_Opts();
_frmExpOpts.ShowDialog();
break;
}
}
//Ổ đĩa lưu giữ file
_exportOpts.ExportDestinationType = ExportDestinationType.DiskFile;
_diskDesOpts.DiskFileName = fileName;
_exportOpts.DestinationOptions = _diskDesOpts;
}
示例12: loadReport
private void loadReport()
{
DataTable lData = ((DataTable)Session["WRK_TABLE"]);
ParameterFields paramFields = new ParameterFields();
ParameterField paramField = new ParameterField();
ParameterDiscreteValue dctField = new ParameterDiscreteValue();
if (Session["WRK_TABLE"] != null)
{
if (lData.Rows.Count > 0)
{
CrystalDecisions.CrystalReports.Engine.ReportDocument myReportDocument;
myReportDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
myReportDocument.Load(Server.MapPath(hidReportName.Value + ".rpt"));
myReportDocument.SetDataSource(lData);
ExportOptions relExportOptions;
DiskFileDestinationOptions relDiskFileDestinationOptions;
string strPDFTemp = Server.MapPath(@"~\Aut\Reports\Files\" + hidReportName.Value + ".pdf");
relDiskFileDestinationOptions = new DiskFileDestinationOptions();
relDiskFileDestinationOptions.DiskFileName = strPDFTemp;
relExportOptions = myReportDocument.ExportOptions;
relExportOptions.ExportDestinationOptions = relDiskFileDestinationOptions;
relExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
relExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
myReportDocument.Export();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "inline; filename=ReportName.pdf");
Response.WriteFile(strPDFTemp);
Response.Flush();
Response.Close();
System.IO.File.Delete(strPDFTemp);
}
}
}
示例13: Export
private void Export(ExportFormatType pvtExportFormatType)
{
ReportDocument rpt = new ReportDocument();
rpt.Load(Server.MapPath(Constants.ROOT_DIRECTORY + "/Reports/_StockTransactionReport.rpt"));
SetDataSource(rpt);
ExportOptions exportop = new ExportOptions();
DiskFileDestinationOptions dest = new DiskFileDestinationOptions();
string strPath = Server.MapPath(@"\retailplus\temp\");
string strFileExtensionName = ".pdf";
switch (pvtExportFormatType)
{
case ExportFormatType.PortableDocFormat: strFileExtensionName = ".pdf"; exportop.ExportFormatType = ExportFormatType.PortableDocFormat; break;
case ExportFormatType.WordForWindows: strFileExtensionName = ".doc"; exportop.ExportFormatType = ExportFormatType.WordForWindows; break;
case ExportFormatType.Excel: strFileExtensionName = ".xls"; exportop.ExportFormatType = ExportFormatType.Excel; break;
}
string strFileName = "tranreport_" + Session["UserName"].ToString() + "_" + DateTime.Now.ToString("yyyyMMddhhmmssff") + strFileExtensionName;
if (System.IO.File.Exists(strPath + strFileName))
System.IO.File.Delete(strPath + strFileName);
dest.DiskFileName = strPath + strFileName;
exportop.DestinationOptions = dest;
exportop.ExportDestinationType = ExportDestinationType.DiskFile;
rpt.Export(exportop); //rpt.Close(); rpt.Dispose();
if (pvtExportFormatType == ExportFormatType.PortableDocFormat)
{
rpt.Close(); rpt.Dispose();
Response.Redirect(Constants.ROOT_DIRECTORY + "/temp/" + strFileName, false);
}
else
{
CRViewer.ReportSource = rpt;
Session["ReportDocument"] = rpt;
CRSHelper.OpenExportedReport(strFileName); // OpenExportedReport(strFileName);
}
}
示例14: Export_pdf
private void Export_pdf(string branch_code,DataTable dt)
{
try
{
if (dt.Rows.Count > 0)
{
string file_path = tbFilePath.Text.Trim() + "\\" + branch_code.Trim() + "_"
+ dp_from_date.Text.Trim().Replace("/", ".") + "_"
+ dp_to_date.Text.Trim().Replace("/", ".") + ".pdf";
//string file_path = tbFilePath.Text.Trim() + "\\" + branch_code.Trim() + ".pdf";
//export PDF
Rpt_PHT18 cry = new Rpt_PHT18();
cry.SetDataSource(dt);
string title = "", Fromdate = "", Todate = "";
string title2 = "";
title = "DANH SÁCH CÁC THẺ CẦN GIA HẠN ";
Fromdate = dp_from_date.Text.Trim();
Todate = dp_to_date.Text.Trim();
//title2 = "(Từ ngày " + dp_from_date.Text.Trim() + " đến ngày " + dp_to_date.Text.Trim() + " )";
cry.SetParameterValue("title", title);
cry.SetParameterValue("Fromdate", Fromdate);
cry.SetParameterValue("Todate", Todate);
//cry.SetParameterValue("title2", title2);
ExportOptions CrExportOptions;
DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions();
CrDiskFileDestinationOptions.DiskFileName = file_path;// tbFilePath.Text.Trim() + "\\" + card_number.Trim() + ".pdf";//"c:\\csharp.net-informations.pdf";
CrExportOptions = cry.ExportOptions;
{
CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
CrExportOptions.FormatOptions = CrFormatTypeOptions;
}
cry.Export();
//--Fix for Load Report failse
if (cry != null)
{
cry.Close();
cry.Dispose();
}
}
}
catch (Exception ex)
{
//MessageBox.Show("Err Export_pdf: \n Branch: "+ branch_code +"\n" + ex.ToString());
string[] row = { branch_code, ex.ToString() };
dgv_err.Rows.Add(row);
}
}
示例15: Import
private void Import()
{
string strId = Request.QueryString["id"].ToString().Trim();
rpDocDB.UpdatePrintFlag(strId);
ReportDocument EoRpt = (ReportDocument)Session["REPORT"];
ExportOptions crExportOptions = new ExportOptions();
DiskFileDestinationOptions crDiskFileDestinationOptions = new DiskFileDestinationOptions();
string strExportedFile = this.MapPath(".") + "\\ExportedReports\\ExceptionNotices";
if (!System.IO.Directory.Exists(strExportedFile))
{
System.IO.Directory.CreateDirectory(strExportedFile);
}
strExportedFile += "\\" + strId + ".pdf";
crDiskFileDestinationOptions.DiskFileName = strExportedFile;
crExportOptions = EoRpt.ExportOptions;
EoRpt.ExportOptions.DestinationOptions = crDiskFileDestinationOptions;
EoRpt.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
EoRpt.ExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
EoRpt.Export();
EoRpt.Close();
//读取报表导出的内容并传到客户端?继续加入以下代码
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
Response.WriteFile(strExportedFile);
Response.Flush();
Response.Close();
}