It did come up when I pasted it into the browser. It
brought up notepad with the file contents displayed.
Now what?
jv
-----Original Message-----
I've only briefly examined the code, i'll do so indepth
later once i shake
the boss off my back.
Can you load the file into a browser only using sFileBase
string. print the
string out first then take that string and past it into a
webbrowser. It
should open up, otherwise you have a problem there. I'll
look more later if
you can get passed this.
--
-----------
Got TidBits?
Get it here:
www.networkip.net/tidbits
message
Thanks for your help.
I am having no luck at all. I am sure it something
little
and stupid but I just can't see it.
I know my aspx page is seeing the spreadsheet because
after I create my file in the apsx.cs and the page is
loaded I alter the caption on my spreadsheet and it
displays correctly.
Also I know the file is getting created because I see it
and can load it into Excel.
The file just wont load into the component.
ASPX.CS
This function is called in Page_Load ad sets the
sFileBase
protected string for the page:
public void CreateBaseCSV()
{
string sDir = "_data";
ArrayList dList = new ArrayList();
dList = epmData.BaseData;
IEnumerator dataEnumerator =
dList.GetEnumerator();
fso = new
Scripting.FileSystemObject();
string
xlFileName=System.DateTime.Now.Ticks.ToString()
+"_base.txt";
sFileBase = sDir+"/"+xlFileName;
ts = fso.CreateTextFile
(Server.MapPath(sFileBase), true, true);
Session.Add("BaseFile", sFileBase);
string sLine = "Val1, Val2, Val3 ,
Val4,Val5";
ts.WriteLine(sLine);
while ( dataEnumerator.MoveNext() )
{
sLine = "";
// get the object from the
arraylist
ProjData data = (ProjData)
dataEnumerator.Current;
sLine = String.Format("{0},
{1},{2},{3},{4}",
data.val1,
data.val2,data.val3,
data.val4,data.val5);
ts.WriteLine(sLine);
}
ts.Close();
}
ASPX
<form name="thisForm" method="post">
<OBJECT id=SSBase classid=clsid:0002E510-
0000-
0000-C000-000000000046
VIEWASTEXT>
<PARAM NAME="HTMLURL" VALUE="">
<PARAM NAME="HTMLData" VALUE="<html
xmlns:x="urn:schemas-microsoft-
com
ffice:excel"
xmlns="
http://www.w3.o
rg/TR/REC-
html40">
<head>
<style
type="text/css">
<!--tr
{mso-height-source:auto;}
td
{white-
space:nowrap;}
.wcCEE3F3
{white-
space:nowrap;
font-
family:Arial;
mso-number-
format:General;
font-
size:auto;
font-
weight:auto;
font-
style:auto;
text-
decoration:auto;
mso-background-
source:auto;
mso-
pattern:auto;
mso-color-
source:auto;
text-
align:general;
vertical-
align:bottom;
border-
top:none;
border-
left:none;
border-
right:none;
border-
bottom:none;
mso-protection:locked;}
--
</style>
</head>
<bo
dy>
<!--[if gte mso 9]><xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:OWCVersion>9.0.0.3821</x:OWCVersion>
<x:Label Style='border-top:solid .5pt silver;border-
left:solid .5pt silver;
border-
right:solid .5pt silver;border-bottom:solid .5pt
silver'>
<x:Caption>Microsoft Office
Spreadsheet</x:Caption>
</x:Label>
<x:Name>Sheet1</x:Name>
<x:WorksheetOptions>
<x:Selected/>
<x:Height>7620</x:Height>
<x:Width>15240</x:Width>
<x:TopRowVisible>0</x:TopRowVisible>
<x:LeftColumnVisible>0</x:LeftColumnVisible>
<x
rotectContents>False</x
rotectContents>
<x
efaultRowHeight>252</x
efaultRowHeight>
<x:StandardWidth>2275</x:StandardWidth>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
<x:MaxHeight>80%
</x:MaxHeight>
<x:MaxWidth>80%
</x:MaxWidth>
</x:ExcelWorkbook>
</xml><![endif]--
<table class=wcCEE3F3
x:str>
<col class=wcCEE3F3
width="64">
<tr
height="17">
<td
class=wcCEE3F3></td>
</tr>
</table>
</body>
;
</html>
">
<PARAM NAME="DataType" VALUE="HTMLDATA">
<PARAM NAME="AutoFit" VALUE="0">
<PARAM NAME="DisplayColHeaders" VALUE="-1">
<PARAM NAME="DisplayGridlines" VALUE="-1">
<PARAM NAME="DisplayHorizontalScrollBar" VALUE="-
1">
<PARAM NAME="DisplayRowHeaders" VALUE="-1">
<PARAM NAME="DisplayTitleBar" VALUE="-1">
<PARAM NAME="DisplayToolbar" VALUE="-1">
<PARAM NAME="DisplayVerticalScrollBar" VALUE="-1">
<PARAM NAME="EnableAutoCalculate" VALUE="-1">
<PARAM NAME="EnableEvents" VALUE="-1">
<PARAM NAME="MoveAfterReturn" VALUE="-1">
<PARAM NAME="MoveAfterReturnDirection" VALUE="0">
<PARAM NAME="RightToLeft" VALUE="0">
<PARAM NAME="ViewableRange" VALUE="1:15">
</OBJECT>
<SCRIPT LANGUAGE="VBScript" >
thisForm.SSBase.TitleBar.Caption = "My
Base Data - " + "<%= sFileBase %>"
SSBase.ActiveSheet.UsedRange.Clear
thisForm.SSBase.CSVURL = "<%= sFileBase %
"
'thisForm.SSBase.LoadText "<%= sFileBase %
", ",", False, """"
thisForm.SSBase.Refresh
</SCRIPT>
</FORM>
-----Original Message-----
you are still able to enter the exact same thing in
asp.net
just enter the CLSID (long object tag), then it should
pop up in design
mode. You use the same line of code to load the
spreadsheet. let me know if
this doesn't work.
--
-----------
Got TidBits?
Get it here:
www.networkip.net/tidbits
message
I am not able to solve my problem.
In ASP I was able to add a Spreadsheet object
directly
to
the page, create a CSV file with data from the
database,
then in VBScript set the CSVURL to be this filename
stored
in TextBox1...
strcsv = right (document.thisForm.TextBox1.value, len
(document.thisForm.TextBox1.value) -1)
thisForm.SSBase.CSVURL = strcsv
... and this populated the spreadsheet directly on my
ASP
page.
Now I am trying to do the same thing in ASP.NET. But
am
having no luck. I can get the control on the page
and I
can create the file in the aspx.cs code BUT I can not
get
the file correctly associated with the spreadsheet
object
on my page so it loads and displays.
I do not want to open up another page with content
type
excel. I want the spreadsheet object to exist
directly
on
the aspx with other controls.
DO I need to do something special that I am not?
Thanks,
jv
-----Original Message-----
Depending on your visual studio setting it may not
appear
in the webcontrols
control list. Search the other lists to make sure it
isn't in there
somewhere. Mine shows up in the Control list fo
example.
--
-----------
Got TidBits?
Get it here:
www.networkip.net/tidbits
message
I want to load the OWC spreadsheet control in my
apsx.cs
file using a CSV file I created with data from my
database. How can I do this?
I can drag the control from the toolbox but it
does
not
show up on the aspx.cs control list. Therefore I
can't
get
at the CSVURL of the control.
Thanks,
jv
.
.
.