Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/302.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 将Crystal报表导出到Word时出现reportDocument.ExportToDisk错误_C#_Visual Studio_Crystal Reports - Fatal编程技术网

C# 将Crystal报表导出到Word时出现reportDocument.ExportToDisk错误

C# 将Crystal报表导出到Word时出现reportDocument.ExportToDisk错误,c#,visual-studio,crystal-reports,C#,Visual Studio,Crystal Reports,当我尝试使用reportDocument.ExportToDisk将Crystal报表导出到Word时,我的C代码出错 它在这条线上崩溃: reportDocument.ExportToDisk(ExportFormatType.WordForWindows, WordPath); 完整的错误消息如下: 登录失败。 详细信息:IM002:[Microsoft][ODBC驱动程序管理器]未找到数据源名称,也未指定默认驱动程序 文件C:\Users\disia\AppData\Local\Temp

当我尝试使用
reportDocument.ExportToDisk
将Crystal报表导出到Word时,我的C代码出错

它在这条线上崩溃:

reportDocument.ExportToDisk(ExportFormatType.WordForWindows, WordPath);
完整的错误消息如下:

登录失败。 详细信息:IM002:[Microsoft][ODBC驱动程序管理器]未找到数据源名称,也未指定默认驱动程序 文件C:\Users\disia\AppData\Local\Temp\DisplayLabel{47AE6D67-D16D-4FB9-BE38-7F7B300D83C0}中出错。rpt: 无法连接:登录参数不正确

WordPath=
“C:\\Inetpub\\wwwroot\\ShoeReport\\admin\\DOC\\1\u displaytickers.DOC”
用于我的本地计算机


此代码在我们的生产服务器上运行正常,但在我们的开发服务器或我的本地开发计算机上崩溃。

您的连接在开发服务器和开发计算机上设置不正确。如果您使用ODBC,请检查DSN

当我单击“主报告预览”选项卡时,我可以查看包含正确数据的报告。这不意味着DSN设置正确吗?我发现了问题。IIS具有未检查的“写入”设置。