If MS would pay you for each question you answered, I'd
make you rich quick!
I don't understand option #2. Perhaps I should provide a
few more details: My endusers will be pulling up this
Excel object (OWC or otherwise) - with no real data in it;
it's just a template. So it's got headers and some
formatting in it. But as far as numbers go - none. So
determining what data has changed will be a *non*-issue:
any info in almost all of the cells will be guaranteed to
be changed/new.
So...
Could you please explain what exactly is going on
in "option #2"? You are declaring an array and populating
it with *what* exactly?... How does that overcome the
problem of having the client object communicate with the
server object? Should I have a spreadsheet object on my
designer?
Kindly explain - the more the better
Eliezer
-----Original Message-----
You aren't bothering. For every question I answer
microsoft pays me a
healthy fee.
There are a couple ways around it
Either post the data to server.
Or unload the data into a server control.
Here is option two.
//clientside script - usually in the page_unload function
TextBox1.Text = sp.CSVDATA;
//in your code behind
string EachRowVal[] = TexBox1.Text.Spli
(Environment.Newline);
string EachColVal[] = TexBox1.Text.Split(',');
You can then loop thru the rows and columns to get your
values
The issue here is that you have no way of knowing which
values were changed,
but that's a story for another day.
the opening line was a joke by the way. ms does not pay
its mvp's. i
bothered a lot of people to know this stuff so fire away.
i'll do my
penance.
--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
message
Alvin,
I'm sorry to bother you again - but, as we both realize,
there aren't too many places to turn on this subject for
some (very strange) reason...
This is what I've got working (or not working)
currently:
Using VS.NET, I dragged a "Microsoft Office Spreadsheet
9.0" onto the designer. Modeling after the code you
shared with me (below), I populated a few cells in that
object using VBScript embedded in my HTML page. All
that
I've used the designer for is to drag my object onto it.
Nothing more.
Bearing in mind that which you wrote in your last post,
that one is a server-side control and one is a client-
side
control... Here's my question: Is there anyway at all
to
communicate between my HTML page and my code-behind
page?
In other words, once the user enters the number "7",
let's
say, in cell "A3", can I grab that value in the code-
behind and process it in VB.NET?
If yes, how?
If it is NOT possible to communicate between my HTML
page
and my code-behind page, so then am I merely writing a
pure HTML page (with some VBScript embedded within it)
using VS.NET as a fancy text-editor? Can I really not
write any genuine VB.NET code for use with this Office
Spreadsheet object?
If it is truly the case that they CANNOT communicate,
then
this is an awful way to implement my solution. I want
to
write my solution in VB.NET, not HTML/VBScript... What,
then, is a "normal" way to create this intranet
solution?
Must I simply go and ignore OWC and just create my own
GUI
using DataGrids, etc.?
Thank you once again VERY, VERY much!
Eliezer
-----Original Message-----
You can't. The owc is a client side activeX control. It
does not live on the
server so there is no way to access it on the server.
The code you have shown below is for the in-memory
spreadsheet object. It is
not related to the client-side activeX control object.
sorta like apples and
grapes. One can't talk to the other. If you want
codebehind functionality,
you need to stick with the in-memory object. If you want
client side
functionality, you stick with the object you dragged
onto
the spreadsheet.
make sense?
--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
message
Alvin,
I have successfully added OWC 9.0 as a reference into
my
ASP.NET project. I have the following code:
Private Sub Page_Load(ByVal sender As
System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim ow As New OWC.SpreadsheetClass
ow.Range("A1", "A2").Select()
ow.Selection.Value = "22"
End Sub
Intelisense works(!) for the OWC 9.0 spreadsheet and I
am
able to drag a Spreadsheet object onto the design
surface. That's all very good.
The problem is that I can't seem to figure out how to
name
the objects so that the designer connects to my
codebehind. In other words, I can drag a spreadsheet
onto
the designer surface - set its ID and NAME to "ow" (I
don't know which is the proper attribute to be using -
"name" or "id") - and then in the code I refer to an
object as "ow" - yet my "ow" code doesn't at all
effect
my "ow" designer object.
PLEASE HELP: How can I get my code in the codebehind
to
manipulate/effect the object in the designer?
Thanks so much!
Eliezer
-----Original Message-----
granted, documentation is a bit *sparse. The idea is
to
use the owc10
documentation to figure out owc11 since the
architecture
is *the same.
Really, you should settle on either owc10 or owc11.
Owc9
should be last
resort. Owc10 requires office xp for interactive use.
Runtime static use is
always free. owc11 requires office 2003 for
interactivity. Runtime static
use is always free. Both owc10 and owc11 are available
as
separate downloads
or available on the office install cd.
--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
in
message
Alvin,
This is ridiculous - I can't find any information
about
anything on this topic...
OK, let's say I can go with Office 2003 for my
users.
Where do I get OWC 11.0 and where can I learn how to
use
it with VS.NET?
Thanks!
Eliezer
-----Original Message-----
yup.
if your users can go for 2003, then you are better
off
using owc11 since it
is the latest and greatest.
Still owc10 will suffice nicely as well.
--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Eliezer" <
[email protected]>
wrote
in
message
Alvin, you're terrific!
If I'm able to move my users over to Office 2003,
will
OWC
10.0 do what I need it to do with VS.NET,
codebehind,
Intelisense, etc?
Thanks again!!!
Eliezer
-----Original Message-----
hmmm,
owc9 is radically different from owc10 so the
owc10
helpfiles will not help
you much. The owc9 comes with its own help file so
you
should search your
drive for it. It should be available on the
install
cd.
there is no download
currently on the web for the owc9.
I haven't played with owc9 in a few years so i'm
not
really hot on the code
but the idea should be the same. you load the
spreadsheet
like so from the
clientside (not codebehind) assuming your
spreadsheet
name is sp
sp.CSVDATA = "1,2,3,4,5";
to color the cells, format numbers etc you will
need
the
help file for that.
I'm giving you some owc10 code, some of it should
work.
it should give you
an idea on how to proceed. This is all client side
vbscript by the way.
'Delete locked rows from spreadsheet
Sub DeleteRow()
set shtCurrent = document.all.sp.ActiveSheet
saveProtection = shtCurrent.Protection.Enabled
shtCurrent.Protection.Enabled = false
document.all.sp.ActiveCell.EntireRow.Delete
shtCurrent.Protection.Enabled = saveProtection
End Sub
'height and width adjustments
document.all.sp.style.HEIGHT= 272
document.all.sp.style.WIDTH = 930
'sheet protection and button customization
document.all.sp.Columns(1).Hidden = true
Set ptProtSheet =
document.all.sp.Worksheets
(document.all.sp.ActiveSheet.Name).Protection
ptProtSheet.AllowFiltering = true
ptProtSheet.AllowSorting = false
document.all.sp.ActiveSheet.EnableAutoFilter=
true
document.all.sp.ActiveWindow.EnableResize = false
'hide columns
document.all.sp.Columns(2).Hidden = true
document.all.sp.Columns(3).Hidden = true
document.all.sp.Columns(5).Hidden = true
'lock columns
document.all.sp.Columns(2).Locked = true
'color range
document.all.sp.Range
("$A$1:$Z$2000").Interior.Color
= "DarkGray"
Intelisense does not work on the spreadsheet
object
in
asp.net. If you drop
the spreadsheet on a windows forms, you will have
intellisense, or you can
use the object browser to figure some of it out.
Your company's logo customization is not
supported.
Objects drawn around the
spreadsheet or embedded in the spreadsheet is not
supported. Remember it is
a scaled down version of excel. You should buy
david
stearn's book. It's
possibly the only book out there dedicated to
owc9.
There
are some excel and
access books which have a page or two devoted to
the
owc9. If you have a
barnes and noble bookstore near you, go browse it
(Access
and Ecel section)
there are a few code snippets here and there. I
hate
to
tell you this but
you are really on your own to figure this out.
There
is
slightly more than
zero documentation out there on the OWC
components.
That's changing for the
better very slowly.
--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Eliezer" <
[email protected]>
wrote
in
message
Thank you, Alvin - it's now on the toolbox. I
used
9.0
as
myself and my users all have Office 2000.
But...
1) Does VS.NET Intelisense work with the MSEXcel
Spreadsheet 9.0 object?
2) I can't figure out how to do *anything* with
that
pretty spreadsheet on my design surface... I
looked
at
those help files you (correctly) gave me the
path
for -
but they aren't so helpful for how do get
started
in .NET/VS.NET... Any other tutorials or
examples
how
to
do *anything* with this object in VS.NET? Some
sample
VB.NET syntax, perhaps?
3) Let me rephrase a question which I wasn't
clear
on
previously: How do I get this spreadsheet
looking
the
same as the *specific* Excel object which I am
trying
to
mimic? i.e. my company's logo on the sheet, the
right
colors for various rows, and shapes drawn around
parts
of
the spreadsheet for "pretty formatting"?
Thank you very much,
Eliezer
-----Original Message-----
1) I downloaded the "Office XP Tool: Web
Components"
but
cannot find any help files installed with it.
Where
are
they?
the default installation path for owc10 is
c:\programfiles\common files\microsoft
shared\web
components\10\1033
or search your hard drive for owc*.chm
2) I have Office 2000, not XP - is that a
problem?
probably. what will your users be using? There
are
three
versions of owc.
owc9 requires office
2000 to be installed period. owc10 requires
office
xp
to
be installed for
interactive use like what you are trying to do
otherwise
you will not be
able to enter data into the spreadsheet. owc11
requires
office 2003 for
interactivity for the most part. This is
explained
in
detail in the
helpfiles. Have a look at this link, it explains
interactivity and
licensing. You need to be aware of those before
you
dive
in:
http://support.microsoft.com/default.aspx?
scid=kb;en-
us;555075
3) I added a reference to my ASP.NET project,
but
don't
see any OWC on my VS.NET toolbar. How do I
import
them
so
they're usable from VS.NET?
they don't show up by default, you would need to
add
them
to the toolbox
from the menu. from the studio tools menu,
choose
add/remove toolbox
components. It brings up a dialog box for .net
and
com
components. You
choose to browse, find the owc dll on disk and
click
ok.
Depending on which
pane is opened in the toolbox in studio, the
controls
appear there. If you
don't see them, search all the panes. if this
fails,
paste this into your
html/aspx page inside the form tag
<object id=Spreadsheet1 classid=CLSID:0002E551-
0000-
0000-
C000-000000000046
style="width:49%;height:350"></object>
4) How do I get it looking the same as the
Excel
spreadsheet format (with logo, colors, etc) as
everyone's
used to already - do I just play with that
object
in
the
VS.NET designer until it looks the same or is
there
some
shorter way to do it?
You don't need to do anything. The component
looks
exactly like excel. right
down to the spinning logo.
--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Eliezer"