Windows服务无法打开连接

时间:2016-09-09 11:22:57

标签: c# .net crystal-reports odbc

我的C#Windows服务自动发送电子邮件。在发送之前,我需要将我的报告转换并附加为PDF。当我尝试导出PDF时,我在下面的行中遇到异常:

function smoothScroll(duration) {
 $('a[href^="#"]').on('click', function (event) {
  var target = $($(this).attr('href'));
   if (target.length) {
     event.preventDefault();
     $('html, body').animate({
      scrollTop: target.offset().top
     }, duration);
   }
  });
 }
  

无法打开连接(ODBC)

相同的代码在Windows窗体应用程序中正常运行。我该如何解决这个问题?

cr.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, savePath);

1 个答案:

答案 0 :(得分:0)

如何在OBDC中设置连接。

  1. 您是否尝试在ODBC上建立连接时测试连接?
  2. 您是如何在报告向导中使用连接的?使用OBDC创建? 如果您创建了错误连接,则应该在CR向导上连接 -
相关问题