Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OWC Spreadsheet in ASP

Status
Not open for further replies.

Clarkie001

IS-IT--Management
Aug 26, 2003
59
0
0
GB
Hi,

I am using the below code to create a OWC spreadsheet on my page:

<object classid="clsid:0002E551-0000-0000-C000-000000000046" id="profiledata">
<param name="XMLURL" value = "</object>

The code for XMLSS.asp is:

<% Language=VBScript %>

<%
Response.Buffer = True
Response.ContentType = "text/xml"

Dim NumOrders, NumProds, r
NumOrders = 121
NumProds = 10

Dim oSS
Dim oProfileSheet
Dim oRange
Dim c

Set oSS = CreateObject("OWC10.Spreadsheet")
Set c = oSS.Constants


Set oProfileSheet = oSS.Worksheets(1)
oProfileSheet.Name = "ProfileData"
oSS.Worksheets(3).Delete

'=== Build the First Worksheet ==============================================

Set oRange = oProfileSheet.Range("A1:C1")
oRange.Value = Array("Age", "Male", "Female")
oRange.Font.Bold = True
oRange.Font.Color= "White"
oRange.Interior.Color = RGB(3,136,157)
oRange.Borders(c.xlEdgeBottom).Weight = c.xlThin
oRange.HorizontalAlignment = c.xlHAlignCenter

'Apply formatting to the columns
oProfileSheet.Range("A:A").ColumnWidth = 10
oProfileSheet.Range("B:C").ColumnWidth = 10
oProfileSheet.Range("A2:C" & NumOrders + 1 _
).HorizontalAlignment = c.xlHAlignCenter
oProfileSheet.Range("B2:C" & NumOrders + 1).NumberFormat = "0.000 % "

'Obtain the order information for the first five columns in the Orders worksheet
'and populate the worksheet with that data starting at row 2
Dim aStartData
aStartData = GetStartData
oProfileSheet.Range("A2:C" & NumOrders + 1).Value = aStartData

'Apply a border to the used rows
' oProfileSheet.UsedRange.Borders(c.xlInsideHorizontal).Weight = c.xlThin
' oProfileSheet.UsedRange.BorderAround , c.xlThin, 15


'Apply window settings for the worksheet
oProfileSheet.Activate
oSS.Windows(1).ViewableRange = oProfileSheet.UsedRange.Address
oSS.Windows(1).DisplayRowHeadings = False
oSS.Windows(1).DisplayColumnHeadings = False
oSS.Windows(1).FreezePanes = True
oSS.Windows(1).DisplayGridlines = False


'=== Setup for final presentation ==================================================

oSS.DisplayToolbar = False
oSS.AutoFit = True
oProfileSheet.Activate

Response.Write oSS.XMLData
Response.End


Function GetStartData()
ReDim aStartData(NumOrders,3)

For r = 0 To NumOrders-1
aStartData(r, 0) = r
aStartData(r, 1) = 0.008333
aStartData(r, 2) = 0.008333
Next
GetStartData = aStartData
End Function


%>
Up to here is working great, it display the information as required. The issue begins when I want the user to edit the starting figures via the owc spreadsheet before it is imported into a database. I am unsure how to reference the details within the owc spreadsheet and therefore can not export or write any of the information elsewhere.
If someone could provide any insight as to how this might be done, that would be greatly appreciated, I am going mad with this.

Many thanks

Clarkie
 
I'm not very familiar with OWC but Google may offer some help: [google][/google]

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top