How can I generate Excel spreadsheets on the server? - c#

I got the requirement to output some reports as Excel 2002 spreadsheets.
Normally a job for reporting services - however - that's "not great IMO" and I hate it so for this project I used ExtJs - which doesn't do any excel output - not really - but does do the UI really, really well.
The reports will need to have outlining, grouping summaries and all sorts of formatting not available if I use the plain XML formatting. This is the one thing Reporting services does do really well. Gutted.
So... Does anyone have any suggestions for alternatives to reporting services and definitely not installing Office on the server? Crystal reports are just as "not great IMO" as RS so not that either :)
I have looked at aspose et al but they're a bit expensive and I'd like to find something open-source, if possible - such as perhaps using open office -, if I can find a way of using OOo on the server without actually installing it.
Any ideas?

If your reports are not very large perhaps you can get away using the free version of Gembox Spreadsheed?

The Perl module Spreadsheet::WriteExcel works very well at generating reports in Excel format.

SpreadsheetGear for .NET can do it and requires only ASP.NET 2.0 on the server (no reliance on Excel or any other libraries).
You can see live ASP.NET (VB and C#) Excel Reporting samples here.
If performance is important at all, I would suggest running your own performance tests with your actual data and formatting as you compare your options.
Disclaimer: I own SpreadsheetGear LLC

I ended up going the OpenXml SDK route - which is a bit of a PITA in some situs but good in others - once you get the hang of it...

The answer to this depends on budget, time and whether r not you're allowed to install coms on the server -
for us all of the above were negative,
we needed the follwing:
export of generic data
grouping of certain columns
sumarisation of certain columns
template based output
sql server reporting services offered all of this if - and only if you adhered to their rules.
what we have now is near as damn it ad-hoc reporting - using extjs for the ui, nhib for the domain castle windsor for the binding, and ooxml sdk 2.0 for the export.
if you need the code for the ulti level grouping excel output give me a shout :)
w://

I am working on (right now) a windows service that does Excel and PDF generation and merging on the server, unattended, using the SyncFusion XlsIO components.
So far this has been effective. The only limitation I have run into is the ability to read some 'legacy' html/xml based Excel formats.
Not Open Source, or free unfortunately but it is a workable option.

Related

microsoft.office.interop.word deploy on server

I would like to convert Word Document to PDF on my local intranet Server for my company. It Is a good idea to use microsoft.office.interop.word on my project instead of buying very expensive tools that don't support Arabic at all.
I will be happy to hear an expert opinion about this case :)
it depends on your need, Third party libraries would give lots of out of the box features whereas you would need to write a lot of code to achieve the same with PIA. But if you need simple word doc to pdf conversion then PIA should do it for you.
But i would strongly recommend you to go for a wrapper assembly which would help to over come the disadvantages of using PIAs such as,
They are limited to a version, i.e. they only work with one or
certain versions of Office
They cause problems while transferring or installation on other
systems
They offer no protection mechanism in the management of COM proxies
in a nutshell, if you are a using PIA your code might not work for different version of office whereas these wrapper assemblies manage multiple office versions using Late Binding.
You can use NetOffice which I have been using in projects for some time. some of the features of NetOffice are,
Office integration without version limitations
All features of the Office versions 2000, 2002, 2003, 2007, 2010,
2013 are included
Syntactically and semantically identical to the Microsoft Interop
Assemblies
I would not go as far to say that I am an expert here, but I can at least share my journey in hopes that it would save you time and energy.
This can work fairly reliably in limited scenarios, but Microsoft will tell you up front that:
[InterOp on a Server] is not supported and will not scale well
I agree, but for simple stuff... meh.
Your first hurdle is having the correct rights to run interop. Where
to run interop is a challenge for some companies. IMHO, I would not
run it on my intranet server unless I could contain the process with
limited rights (and yes that's doable).
Your next challenge will be with virus's and the vulnerabilities of
MS Word. MS Word must be kept up to date, customers must be able to
deal with documents not getting converted (due to potential virus or
bad macros in the file).
The approach that I use is to run MS Word interop in a service or as a workflow. You need to expect to queue these requests and write your app as such. The service would work in the background and have limited rights other than to run MS Word, open a file and "Save As" PDF format (plus what ever other business logic you require). You would scale by adding more services/workflows on new servers (one interop service per machine)
When run in this manner, I have rarely had issues. I hope this helps.

Using C#/Java/Visual Basic to populate a Word 2007 template

I've recently been given a task to populate a Word 2007 file with information retrieved from Rhapsody using the Rhapsody API. I'm not super familiar with Rhapsody, but I'll learn. I'm having difficulty tracking down a good way to write a program that can write to a formatted (read: tables) word document. I'm best at java, but I'm capable of using C#, C++, or VB. The problem seems to be that all options for java require the use of 3rd party libraries, and I'm not sure if I'm comfortable using them. All of the languages available in the Microsoft Visual Studio seem to have options for writing out to a Word Document, but I can't seem to figure them out. What would be my simplest option in attempting to tackle this task?
Aspose words does a really good job integrating C# with MS word.
http://www.aspose.com/categories/.net-components/aspose.words-for-.net/default.aspx
I am not sure if you already tried all features of Rhapsody Reporter Plus (in built) and Rational Publishing Engine (additional licenses might be required). With them you can produce html, pdf, word documents...
If this is not your use case and you need your own plug ins in java, we have good experiences with Apache POI, which I could recommend.
I don't understand why you might have issues using 3rd party libraries, when you write everything by yourself you might end doing such a similar library, expending of course "some" time and "some" headaches until having it ready...

RDLC vs Crystal Reports vs Anything Else Free: I'm running Informix and using C# 4.0

I'm not sure which is the way to go for choosing a report type with my current setup. In the past I was using MS Server 2008 R2, MS SQL Server, MS.NET C# 3.5. Now I'm using something similar except my Database is IBM Informix and I'm using MS.NET C# 4.0.
I'd prefer to use RDLCs since I'm used to them, but I didn't wanna jump down that alley and debugging hell if they don't play well with Informix. In fact, I don't even wanna be limited to Crystal Reports vs RDLCs. I'm just curious what the best report type is to use my current setup. Oh, a free type if an alternative is suggested. Anyone else using Informix and reporting?
Advance warning: I don't have any experience of reporting from Informix.
Given that you are using C#, RDLCs would be the obvious route to take. Alternatively, if you are concerned about compatibility issues and your business can afford to spend on a commercial solution, then the IBM Cognos BI suite would definitely be worth a look.
On the free reporting solutions side, the three best-known open source reporting systems are probably BIRT, Jaspersoft and Pentaho - there is a comparison of them here: http://www.innoventsolutions.com/open-source-reporting-comparison.html
i-net Clear Reports
can read Crystal Reports templates
powerful and simple API
much more cost-efficient than Crystal Reports, and costs less than open source solutions if you count in support costs (which you should).
platform-independent because written in Java.
can export to HTML or also a nice Java applet with zoom, search, and highlighting capabilities...
if it has to be free, we also offer a completely free and fully functional report designer - you'd only have to pay if you need a running server.
full disclosure: I work for i-net software, so it's far to say this is a bit biased...but it is my opinion! :)

Open Source .Net Object Database or Document Database for use in Hosted environment

I am looking at creating a web site and I want to try and learn either a Object Database or a Document Database. I am going to be using a hosting provider so I won't be able to install any software. I am unable to purchase any licensing so I need to be able use either a free or open source Object/Document Database. Are there any free Object/Document Databases that don't require installation of some sort?
This might be a bit late but I am using RavenDB (more here) which works like a charm! It works very well with the RavenDB.Client only and a file based document store for simple scenarios.
Have you looked at http://eloquera.com/?
It is free and is a client/server object database.
It is easy to use and fast.
I found it late last year and think it is a great step forward.
Give it a go ,and I don't work for them I just love what their doing.
Try db4o. Haven't tried it myself but its an embedded OODB. It has a dual GPL/Commercial license.
You can also check STSdb - its an free open-source embedded object database system (NoSQL key/value pair storage engine) designed for mission critical and real-time applications.

Does anyone have a good example of controlling multiple Excel instances from a .Net app?

We have an Excel 2002/XP based application that interacts with SQL 2000/5 to process fairly complex actuarial calculations. The application performs its function well, but it's difficult to manage.
We're trying to create a "controller" application or service that can manage and monitor these various instances of Excel (start/stop/process commands etc) but it's a bit of an InterOp nightmare unfortunately.
Does anyone have a good (i.e. working) example of doing something like this in VB.Net or C#?
Don't do it!
We tried for weeks to get something like that to work and it simply does not behave as advertised. Don't even start - give up immediately!
The only options that you really have is a heavy server-side MOSS based implementation - Excel (Web) services (they call it something like that). Windows based COM Excel interop is pretty much dead and will be replaced by MOSS.
The other option is to use SpreadsheetGear. It is actually a fantastic product
It is lightlingly fast
The engine is separate from the UI so you can use it to do Excel stuff server side (with no office installed)
Fairly cheap
Has an API similar to the existing Excel COM api so moving code across is relatively easy
It all depends on the formulas that you need in your spreadsheet. Have a look at the formula list for Spreadsheet Gear and if there is a match go for it.
Interop works fine except that you always end up with references to Excel objects that aren't released, so Excel instances won't close. The following KB article explains why:
http://support.microsoft.com/default.aspx/kb/317109/EN-US/
You can avoid the problem if you have very carefully written code for a limited set of Interop scenarios. But in the general case it's very difficult to get it working reliably.
You might want to take a look at this product: http://www.spreadsheetgear.com/products/spreadsheetgear.net.aspx
It's all managed code and direct .NET libraries. No InterOp headaches. I haven't used it myself, but I've heard very good things from people in the finance world.
We have written a service that controls a single instance of Excel 2003. We never managed to get Excel instances to close cleanly, so we start one instance when the service is first accessed and use only that, serializing client requests.

Categories

Resources