Errors exporting reports to Excel (or other Apache POI-provided formats, such as Excel CSV) may occur when using Sage CRM behind a reverse proxy or router. This issue can occur when the port being used to access CRM externally does not match the HTTP port being used on the CRM web server.


This error only occurs in the specific specific circumstances where a customer has a router or reverse proxy that forwards HTTP requests to a CRM server. The CRM web server would have a binding on port 80, while the router would listen for requests from users on any ports other than 80 or 443.

In the example examined, customers accessed CRM on an FQDN similar to, while the CRM server had a binding on port 80.

On attempting to export a file to Excel, the following error message is displayed in CRM:

123 Companies processed

Error creating text file for export
System error: -2147012891

The following error is displayed in the eWare system log:

Sep 3 2015 10:05:09.222 14092 2272 5 START - doEndpointPost URL:
Sep 3 2015 10:05:09.274 14092 2272 1 ERROR generating excel file. Message - System error: -2147012891 .

Note the malformed URL in the above log entry.


The error is caused by an issue generating a local request responsible for creating the export file.


The issue can be worked around by ensuring that the CRM server has a HTTP binding on the same port as is used by users to access CRM via the reverse proxy or router.


This has been escalated as a bug to the development team, and will be fixed in a future patch for Sage CRM.