日期:2014-05-17 浏览次数:21122 次
Thread th = new Thread(new ThreadStart(ExportCost));
th.SetApartmentState(ApartmentState.STA);
th.Start();
private void ExportCost()
{
SetExportBusinessNum();
if (!string.IsNullOrEmpty(ExportBusinessNum))
{
Query_Customs_CustomsDeclaration query_Customs_CustomsDeclaration = GetQuery_Customs_CustomsDeclaration();
query_Customs_CustomsDeclaration.BusinessNum = ExportBusinessNum;
DataTable dt = Customs_CustomsDeclarationManager.QDZYExportCostExcel(query_Customs_CustomsDeclaration);
if (dt != null && dt.Rows.Count > 0)
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "excel文件(*.xls)
------解决方案--------------------
*.xls";
sfd.FileName = "财务数据";
DataTable dtCopy = dt.Copy();
if (dt.Columns.Contains("是否审核")) dt.Columns.Remove("是否审核");
if (dt.Columns.Contains("是否导出")) dt.Columns.Remove("是否导出");
if (dt.Columns.Contains("Id")) dt.Columns.Remove("Id");