crystal 报告中未显示世界地图

World map not dispalyed in crystal reports

我正在使用 crystal 报告生成 pdf 报告,我想使用 Data Map Tool

在 c# 代码中,我有一个包含地理字段和一些要在地图中显示的值的数据集。

    public class CrystalReportViewerPlugIn : ICrystalReportViewer
    {
      private ReportDocument _reportDocument;
      private CrystalReportViewer _crystalReportViewer;

      public void Init(string fileName, DataSet dataSet)
      {
        _reportDocument = new ReportDocument();
        _reportDocument.Load(fileName);
        _reportDocument.SetDataSource(dataSet);
        _crystalReportViewer = new CrystalReportViewer();
        _crystalReportViewer.DisplayToolbar = false;
        _crystalReportViewer.DisplayGroupTree = false;
        _crystalReportViewer.PageToTreeRatio = 4;
        _crystalReportViewer.RefreshReport();
        _crystalReportViewer.ReportSource = _reportDocument;
      }
    }

然后我将结果导出到一个strem:

public MemoryStream GetCrystalReportResults(string rptFileName, DataSet ds)
{
  var crystalReportViewer = new CrystalReportViewerPlugIn();
  crystalReportViewer.PlugIn.Init(rptFileName, ds);
  crystalReportViewer.PlugIn.Control.Visible = true;
  var oStream = crystalReportViewer.PlugIn.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
  var byteArray = new byte[oStream.Length];
  oStream.Read(byteArray, 0, Convert.ToInt32(oStream.Length - 1));
  return new MemoryStream(byteArray);
}

流导出为 pdf:

protected virtual IHttpActionResult FinalizeExport(MemoryStream data, string name)
{
  string contentType = "application/octet-stream";
  name = name.GetCleanFileName();

  var response = Request.CreateResponse(HttpStatusCode.OK);
  response.Content = new StreamContent(data);
  response.Content.Headers.Remove("content-type");
  response.Content.Headers.Add("content-type", contentType);
  response.Content.Headers.Remove("x-filename");
  response.Content.Headers.Add("x-filename", name);
  response.Content.Headers.Add("Content-Disposition", "inline; filename=\"" + name + "\"");
  response.Content.Headers.Add("Content-Length", data.Length.ToString());

  return ResponseMessage(response);
}

世界地图不显示,请问有什么问题吗?

Crystal 报告的地图仅适用于 32 位环境。