【问题标题】:Export file as CSV in Crystal Report 11在 Crystal Report 11 中将文件导出为 CSV
【发布时间】:2010-03-11 16:26:07
【问题描述】:

您好,我正在尝试从 Crystal Reports 11 将报表导出为 CSV 格式,但问题是每个字符串值都包含在引号内,这是我不想要的。我试图将分隔符设置为空格,但它不起作用。有人可以帮我解决这个问题吗?

这是我的代码:

elseif ExportFormat = "CSV" then
ExportType = "5"
ExportFileName = TimeStamp&"_"&Session.SessionID&ReportDN&".CSV" 
crystalExportOptions.DiskFileName = ExportDirectory & ExportFileName
crystalExportOptions.FormatType = CInt(ExportType)
crystalExportOptions.CharStringDelimiter =" "
'crystalExportOptions.FormatType = ExportFormat
crystalExportOptions.DestinationType = CInt(1)
Session("oRpt").Export False  
 Response.ContentType = "text/x-csv"
Response.Redirect "RDCrptserver10.asp?cmd=export&export_fmt=crxf_csv:0" 

【问题讨论】:

    标签: crystal-reports formatting csv export


    【解决方案1】:

    经过一夜的破解,我发现以下更改可以解决问题:

    ExportType = "7" crystalExportOptions.CharFieldDelimiter = ","

    7 表示 charSeparatedValues 和我们将 fieldDelimiter 设置为 "," 的唯一选项,因此现在字符串不包含在引号内......

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多