Я пытаюсь распечатать файл .rpt
на своем принтере. Я установил Crystal Report Engine и добавил CrystalDecisions.ReportAppServer.CommLayer.dll
в свой проект.
string rptFileName = @"C:\Users\User99\Desktop\Kommissionierliste.rpt";
string PrinterName = "Canon MX490 series Printer";
ReportDocument reportDocument = new ReportDocument();
reportDocument.Load(rptFileName);
PrinterSettings printerSettings = new PrinterSettings();
printerSettings.PrinterName = PrinterName;
reportDocument.PrintToPrinter(printerSettings, new PageSettings(), false);
Когда я запускаю код, я получаю сообщение об ошибке, сообщающее, что не может найти файл. Я думаю, что он все еще ищет неправильную версию (он ищет 13.0.2000.0, но у меня уже есть 13.0.3500.0).
App.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedruntime version="v4.0" sku=".netframework,version=v4.0"/>
</startup>
<runtime>
<assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentassembly>
<assemblyidentity name="crystaldecisions.crystalreports.engine" publickeytoken="692fbea5521e1304" culture="neutral"/>
<bindingredirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentassembly>
<dependentassembly>
<assemblyidentity name="crystaldecisions.reportsource" publickeytoken="692fbea5521e1304" culture="neutral"/>
<bindingredirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentassembly>
<dependentassembly>
<assemblyidentity name="crystaldecisions.shared" publickeytoken="692fbea5521e1304" culture="neutral"/>
<bindingredirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentassembly>
<dependentassembly>
<assemblyidentity name="crystaldecisions.web" publickeytoken="692fbea5521e1304" culture="neutral"/>
<bindingredirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentassembly>
<dependentassembly>
<assemblyidentity name="crystaldecisions.windows.forms" publickeytoken="692fbea5521e1304" culture="neutral"/>
<bindingredirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentassembly>
<dependentassembly>
<assemblyidentity name="crystaldecisions.reportappserver.clientdoc" publickeytoken="692fbea5521e1304" culture="neutral"/>
<bindingredirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentassembly>
<dependentassembly>
<assemblyidentity name="crystaldecisions.reportappserver.commoncontrols" publickeytoken="692fbea5521e1304" culture="neutral"/>
<bindingredirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentassembly>
<dependentassembly>
<assemblyidentity name="crystaldecisions.reportappserver.commonobjectmodel" publickeytoken="692fbea5521e1304" culture="neutral"/>
<bindingredirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentassembly>
<dependentassembly>
<assemblyidentity name="crystaldecisions.reportappserver.controllers" publickeytoken="692fbea5521e1304" culture="neutral"/>
<bindingredirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentassembly>
<dependentassembly>
<assemblyidentity name="crystaldecisions.reportappserver.cubedefmodel" publickeytoken="692fbea5521e1304" culture="neutral"/>
<bindingredirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentassembly>
<dependentassembly>
<assemblyidentity name="crystaldecisions.reportappserver.datadefmodel" publickeytoken="692fbea5521e1304" culture="neutral"/>
<bindingredirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentassembly>
<dependentassembly>
<assemblyidentity name="crystaldecisions.reportappserver.datasetconversion" publickeytoken="692fbea5521e1304" culture="neutral"/>
<bindingredirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentassembly>
<dependentassembly>
<assemblyidentity name="crystaldecisions.reportappserver.objectfactory" publickeytoken="692fbea5521e1304" culture="neutral"/>
<bindingredirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentassembly>
<dependentassembly>
<assemblyidentity name="crystaldecisions.reportappserver.prompting" publickeytoken="692fbea5521e1304" culture="neutral"/>
<bindingredirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentassembly>
<dependentassembly>
<assemblyidentity name="crystaldecisions.reportappserver.reportdefmodel" publickeytoken="692fbea5521e1304" culture="neutral"/>
<bindingredirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentassembly>
<dependentassembly>
<assemblyidentity name="crystaldecisions.reportappserver.xmlserialize" publickeytoken="692fbea5521e1304" culture="neutral"/>
<bindingredirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentassembly>
</assemblybinding>
</runtime>
</configuration>