NetTalk Central

Author Topic: Generating Excel sheet  (Read 5835 times)

Majodi

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • Email
Generating Excel sheet
« on: June 24, 2008, 11:33:16 PM »
Currently I'm looking into the PDF reporting which is nice. But I already know that I'll need to be able to create Excel sheets. Any idea how this can be done?

Thanks,

Majodi

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Generating Excel sheet
« Reply #1 on: June 24, 2008, 11:53:57 PM »
Hi Majodi,

You can create the Excel spreadsheet, on the server, using whatever normal approach you use for Excel.

This might be creating a XLS file with something like Office Inside, or it might be as simple as a simple CSV file.

Once you've created the file on the server, you need to tell the browser that it "belongs" to Excel, and hence that excel must open (at the client) when the file arrives.

The way you do this depends on how the browser _asked_ for the file.
a) if the URL which "asked" for the file contains the .XLS or .CSV extension then the "content type" is automatically set for you. So there's nothing to do. However

b) If the URL was "generic" and the _server_ is deciding to send back a file that should be opened in Excel, then the server needs to set the "Content Type" to 'application/vnd.ms-excel'

How exactly all this happens does depend a lot on how you are generating the Excel file. Are you generating it on the fly, or are you going to use the output of a report, converted to Excel?

cheers
Bruce


CyberFerret

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • Email
Re: Generating Excel sheet
« Reply #2 on: June 25, 2008, 03:07:21 AM »
We are looking to develop a web service that will allow the user to generate and download an Excel file too.  Thinking of using Office Inside to do the job.

My question is - what is the minimum components of Office that we have to install on the machine where the NetTalk server is running?  Can we get away with just Excel 2003?  Is it possible to strip it right back to just some key DLL's or ActiveX controls?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Generating Excel sheet
« Reply #3 on: June 25, 2008, 03:22:40 AM »
Hi Cyber,

I'm not sure.
I suppose during the Office install you might start by just limiting it to Excel. And of course there are lots of different Excel options you can probably exclude.

If Excel needs some functionality it will prompt you and install that "on the fly". So if your app is completely consistent, then all you need to install is the minimal excel install, then generate some spreadsheets until the Office no longer pops up the "insert CD" message.

Personally though, I'd go the other way. Because this is a server you never know when some unexpected thing will occur that might need the Office CD. Maybe a client embeds a new graphic image type, or uses Korean or something like that. For this reason I'd install _everything_ to do with Excel. I don't want it to "install on demand" I want it to install _everything_ just once.
Disk space is really really cheap, and this seems to me to be the least likely approach to cause problems later (especially when the CD has been filed away somewhere.)

Cheers
Bruce



Majodi

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • Email
Re: Generating Excel sheet
« Reply #4 on: June 25, 2008, 07:56:36 AM »
We and our customers are used to Crystal where you just export your report to Excel for playing around.

But maybe we could generate a CSV. I will dig in later.

Gr,

Majodi

How exactly all this happens does depend a lot on how you are generating the Excel file. Are you generating it on the fly, or are you going to use the output of a report, converted to Excel?

cheers
Bruce



Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Generating Excel sheet
« Reply #5 on: June 26, 2008, 10:46:05 PM »
Hi Majodi,

If you are using OfficeInside then you can convert your report output to Excel in the same way you can convert a report to PDF. I'll see if I can put together an example of this at some point soon.

Cheers
Bruce