Embed an Excel Sheet within an asp.net WebForm

M

Megha

Hi,
I am trying to develop an asp.net page with Excel sheet embedded in
it...I have tried setting the
ContentType="application/vnd.ms-excel"... but this displays an Excel
sheet which spans the whole page.. what I would like to be able to do
is...

1. Limit the Excel sheet to only a part of the page (like set its
height and width)
2. Retrieve the data from the Excel sheet and populate it into
Sqlserver.I need to do this only when the user clicks the Submit
Button.

So all I need on the page is an Excel Sheet and a Submit Button.

Another approach i tried was to refer the MS Excel Component from the
VS.NET IDE.I added the Spreadsheet component to the ToolBox and
dragged and dropped an Excel Object into it.. which solved my first
req.. I couldlimit its height and width.. but I am not sure How to
access the data from the webform .. there is no reference to this
object in the codebehind.. and so I cant get access to that object..
Any help is greatly appreciated!! Thankyou,
Megha


Is this the correct way of doing it?? If not what would be a better
approach.. Any help is greatly appreciated! Thanks a lot!!

Megha
 
D

Dan RIcker

The OWC SpreadSheet control will do what you want for the
client, but you won't have "code behind" access to the
client control.

The OWC controls (like any ActiveX controls) are not "Web
Controls" as defined by ASP.NET/VS.NET. "Web Controls"
basically exist in two places, on the Client and on the
Server. ActiveX controls exist only one place.

Client event for an ActiveX Control must be handled on
the Client. Object Model manipulation for Client ActiveX
controls must be done on the Client.

Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top