Question

Ok, I know there are multiple questions like that, but I have a bit of a weird case here. The question is a bit broad, but I can't be specific since this problem is specific to our production server and doesn't repeat on any of the multiple test servers or locally.

So we are trying to generate a report, that we provide in 2 extension options: PDF or XLS. The front-end server calls WCF service on another server, that has Excel installed on it, and hence the COM libraries (Assembly Microsoft.Office.Interop.Excel.dll, v12.0.0.0). That server then generates a file and saves it either in XLS or PDF. Then it returns path to the saved file, so that Front-end server can pick it up...

And here's the funny part: while generating XLS produces no errors, PDF generation does die with "Value does not fall within the expected range" exception. Both use the same generation mechanism, both use the same data as input, and only happens in production.

Could anyone hint me towards a possible cause?

EDIT: Ok, so I got closer to the source. I get the error specifically on tryin to export the file into PDF as following:

workbook.ExportAsFixedFormat(XlFixedFormatType.xlTypePDF, resultPath, XlFixedFormatQuality.xlQualityStandard, true, true, Nil, Nil, false, Nil);

Now I've googled that and got a bunch of questions of the same sort and no answers to it. Even on Microsoft forums. So as I've said - a slightest hint would be welcome.

Était-ce utile?

La solution

My specific problem has been answered here:

http://social.msdn.microsoft.com/Forums/en-US/cc380742-dd71-4818-9125-0e1c77717ada/saving-excel-workbook-as-pdf-exportasfixedformat-throws-value-does-not-fall-within-the-expected?forum=officegeneral&prof=required

That though had lead to another problem that I am now trying to fix:

Exception type: FaultException`1

Exception message: Exception from HRESULT: 0x800A03EC

Couldn't fix that.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top