SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Aug 2007
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Populate and save an excel worksheet server side

    Hello. I've been searching for various posts on Excel and ASP.Net, and wanted to try and figure out if what I'm attempting has any chance of working.

    I have a special Excel workbook with a worksheet that has a bunch of calculations and such for various fields that creates an order for his crew. My client uses this Excel worksheet for everything.

    He's asking me to be able to see online orders (which I have), click a link and have the worksheet be passed down to the client all populated and formatted exactly as is (just adding/editing data).

    Is this even possible? I'd have to load this specific .xls file, then open it on the server, save data to various cells, and then do a Save As and then binarystream it down to the client.

    I'm quite certain there is no version of Excel loaded on the server. So I'm perplexed as to how to accomplish this.

    Has anyone encountered this situation before and been able to accomplish what's being asked?

    Thanks for any insight.

  2. #2
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,629
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Excel should never be installed much less run on a server. You'll need some very expensive libraries if you need to be Excel 2003 (.xls) compatible or to do a bit of leg work if you can use excel 2007+ (.xslx).

    If the excel is truly the complex side of the equation, I would build something in excel to load the data from a web service. Actually alot easier than generating complex excel on the server and lets you play to excel's stronger suits.

  3. #3
    SitePoint Member
    Join Date
    Aug 2007
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nod. Sounds reasonable. Guess I'll go brush up on my Excel...

    Thanks.

  4. #4
    SitePoint Enthusiast
    Join Date
    Feb 2006
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can write SpreadsheetXML files. To make a template and see how it works, load up a blank sheet in Excel, populate some fields, add some formatting, formulas, etc and save as SpreadsheetXML (it may be called XML Spreadsheet 2003 in Excel2007), load it up in a text editor, VS works well, and figure out how it works. Then take one of your existing spreadsheets and save it in this format and decipher how it saves your data. Strip the data out of it and then you can use that XML file as a template - read in the template and manupulate the XML with the new data and output it to the browser.

    You can write your own quite-capable spreadsheets with formatting, formulas, frozen panes, and proper types (i.e numbers as numbers, text as text, etc). No charts, and other features, however.

    I've used this format for both importing existing sheets (in well-defined formats with strict data-checking!) and for exporting "reports".

  5. #5
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,629
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    ^^^That is exactly what the carlosag library does.

  6. #6
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use the library Interop.OWC.dll.

    As my site. still use this library <snip/>
    Last edited by Mittineague; Mar 30, 2011 at 23:03. Reason: Please wait until you get your signature for your links.

  7. #7
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,629
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    That requires an office license and should be downloaded from microsoft, not your warez site.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •