ASP.NET and VSTO

Last post 05-16-2008 9:13 AM by emanstl. 2 replies.

Sort Posts:

  • ASP.NET and VSTO

    05-14-2008, 5:03 PM
    • Loading...
    • emanstl
    • Joined on 07-24-2006, 9:31 AM
    • Posts 6

    Ok, I'm writing this because I'm unconditionally stuck. Been a developer for 15+ years, doing c#/vb in .net for the last 3 with a couple years of java previously to that. Not an expert but not a newbie either. Please bare with m, and excuse me if I'm in the wrong forum. Checked them all and this seemed like the best since my questions originates in ASP.NET.

     My goal is to be able to create dynamic excel spreadsheets over the web and be able to display whether the user has XL 2003 or 2007 installed on their machine. To be able to dynamically merge cells, rotate columns, create formulas where I need them, etc., etc.

    Sorry this is long but I need to give history so my responses will be closer to what I'm asking - hopefully.

     Been writing out excel files for years through the web, that's easy. Just set the content-type on the page and delimit the records. But you can't customize cells as mentioned above. That has taken me on a journey of research. I was able to take some open source code called Excel Package, modify it to my needs, add some new methods and use it as a referenced assembly by using templates. That works great. Streamlined it to handle large files, works great. The reason why it's not adequate is because most people still have Office 2003, and this only creates 2007 spreadsheets, which as you know is much different and runs off the officeOpenXML standards.

     I heard about VSTO and how there are new VS2005 Office kits for it. Unfortunately I had VS2005 standard and couldn't download and install it. So now I'm using VS 2008 PRO. I see there are new office projects on there(will use Excel as example), Add-ins, Workbooks and Templates. I'm thinking, "fantastic, just what I was looking for". Unfortunately I can't find ANY good examples or references that seem useful to what I need. And my needs seem pretty basic. Are there ANY examples out there showing a basic setup of calling up and displaying a spreadhseet from an asp.net page using these new "projects/add-ins, workbooks"?

     Do I create a 2007 Excel add-in Project, build it as an dll/exe, reference it in my asp.net app?

     or do I just create a template or workbook within my asp.net website and build my spreadsheets from there?

     I have found an example that deals with a workbook tying to a web service, but that doesn't help. That's to basic. Not going to be dumping into ListObjects, etc, I need full control over every cell. Plus it gives no assistance on how in the world you pop that from an active asp.net page. Unless I'm not understanding something.

     Can anyone throw me a bone?

     Just some simpleton working example of creating an xl spreadsheet using these tools?

     Remember, can't use interop on a web server. Many asp.net websites will be using this same Workbook template/add-in or whatever..

    Any help would be greatly appreciated.

     Eric

     

  • Re: ASP.NET and VSTO

    05-14-2008, 6:07 PM
    Answer
    • Loading...
    • booler
    • Joined on 08-15-2005, 2:22 PM
    • Brighton, England
    • Posts 896

    Hi,

    Unfortunately, the Excel and other Office Add-Ins are simply managed wrappers around the respective COM interop assemblies, so if you don't want to use interop, these won't be of much use. In any case, the Office Add-Ins (from my limited experiments with them) seem more intended for extending the functionality of the various Office applications- not providing a new API for working with them externally.

    If you were not required to support versions of Excel older than 2007, you could use the new openXML object model to generate the spreadsheet.

    However, generating legacy format Excel spreadsheets is, as you no doubt know, a nuisance. There is a wide range of commercial tools available to generate spreadsheets without any COM interop- and in all honesty using a third-party utility is by far the quickest way to go.

    That said, I do happen to know of a good one (written by a Microsoft employee), which has the added bonus of being absolutely free. You can find out more, and download it here


     

  • Re: ASP.NET and VSTO

    05-16-2008, 9:13 AM
    • Loading...
    • emanstl
    • Joined on 07-24-2006, 9:31 AM
    • Posts 6

     Thanks booler, just what the doctor ordered. That did everything I needed it to do.

    Yes, I'm very familiar with openX ML, I've got an app that produces those docs no problem. Only problem is not many people use it yet. I know 1 client doesn't want to install that utility to open and use xl 2007 docs on their 2003 install. For now I'll just produce 2003 until 2007 gets propagated.

     Thanks for the link, had never run into the Carlos app. It's very slick.

     e

     

Page 1 of 1 (3 items)