Last post Feb 25, 2016 09:55 PM by omsoft
Feb 25, 2016 08:04 PM|omsoft|LINK
I am using .nt 4 and C# on Windows 7.
I have a template Excel worksheet with two images and I need to fill in appropriate data and create an individual Excel file and then save it as pdf.
I am able to create both xlsx and pdf files on the server correctly in debug mode. But when a client tries to do it gets stuck. An Excel instance starts up but nothing further happens. I am using Interop functions. Client browser gets hung. The client
will create only one file at a time.
After googlibng some, I discovered that this may have to do with permissions. But I do not see Excel in DCOM config so not sure how to set the permission.
On the other hand, I do not mind using OpenXML to create the file. But not sure how to do that. Given the formatting and images in the worksheet, I do not believe I can use the data table approach described elsewhere.
Also, not allowed to use external libraries.
Any help / guidance will be greatly appreciated. Thanks much in advance.
Getting stressed working with a deadline.
UPDATE: - I did finally manage to get Excel into DCOM Config by running mmc comexp.msc /32 from CMD. And the file was created on the server, but I got a different error as below:
COM object that has been separated from its underlying RCW cannot be used.
So it seems to be a thread safety issue making it unreliable to use.
Please help. SOS
Feb 25, 2016 09:35 PM|egor598|LINK
You could use EPPlus library for generation of Excel spreadsheets: http://epplus.codeplex.com/
It's easy to work with, and it's in pure C#, so should be no problems to run on the server.
Feb 25, 2016 09:55 PM|omsoft|LINK
Not allowed to use external libarries.