简体   繁体   中英

reportDocument.ExportToDisk error when exporting Crystal Report to Word

I am getting an error from my C# code when I try to export a Crystal Report to Word using reportDocument.ExportToDisk .

It crashes on this line:

reportDocument.ExportToDisk(ExportFormatType.WordForWindows, WordPath);

The complete error message is this:

Logon failed. Details: IM002:[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified Error in File C:\\Users\\disaia\\AppData\\Local\\Temp\\DisplayLabel {47AE6D67-D16D-4FB9-BE38-7F7B300D83C0}.rpt: Unable to connect: incorrect log on parameters.

WordPath = "C:\\\\Inetpub\\\\wwwroot\\\\ShoeReport\\\\admin\\\\DOC\\\\1_DisplayStickers.doc" for my local machine.

This code runs just fine on our production server, but it crashes on our development server or my local development machine.

Your connection is not set correctly on the development server and the development machine . If you are using ODBC check the DSN

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM