using Infragistics.Reports.Server;
using Infragistics.Reports;
using (IServerExporter exporter = ServerExporterFactory.CreateExporter(reportUri))
{
using (FileStream fileStream = new FileStream(@"C:\Test\testReport.pdf", FileMode.Create))
exporter.Export(fileStream, "PDF");
}
In my references folder I have every 'InfragisticsWPF4.' library from the NetAdvantage/Reporting/Bin directory imported.
When I write the code, no errors are displayed and ServerExporterFactory and its members are visible and recognized as a Class correctly. However, when I attempt to build the solution, I get the error "Error 35 The name 'ServerExporterFactory' does not exist in the current context" and the references in the code stop being recognized and red error indicators appear underneath them in Visual Studio.
I'm must be missing some references somewhere. What else should I add? All I'm trying to do is generate a report and save it to file. The application has no UI or user input/output.
Hello Tyler,
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
Could you please try to modify the sample I sent you in order to reproduce this and send it back to me for further investigation? Also it will be helpful if you give us the full version names of the Visual Studio, .Net Framework and NetAdvantage the you use.
Looking forward for your reply.
Ok,I got updated and now I can compile the application without my previous error, so I am getter farther now. However when I attempt to export the report I get this exception:
{"The Xml namespace 'http://schemas.infragistics.com/xaml/reports' could not be loaded. See inner exception for details."}
And the Inner exception is:
{"Could not load file or assembly 'Microsoft.Windows.Design.Extensibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.":"Microsoft.Windows.Design.Extensibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"}
This occurs on this line:
exporter.Export(fileStream,"PDF");
I am looking forward to hear from you.
I haven't made any further progress yet. I'm waiting to discuss upgrading to VS2012 with my team lead.