S
slowmotiongenius
Hello-
I'm a bit stumped at this point. Many of your posts have been helpful
getting me as far as I am at this point, but I'm not sure how to
proceed.
What I have currently is an asp.net project going. I'm trying to read
data in from a ColdFusion webservice, and write it out to a pivot table
so the end user can manipulate the data as they see fit.
I'm altering the recent example Alvin Bruney has posted to his Amazon
page for the VS2005 issue to suit my needs. I have to read the data
into the codebehind, and then pass it from the server to the client
(I'm attempting this with a recordset at the moment) and it's failing.
I'm passing it by writing out vbscript at the moment, but you can see
in my code I've also attempted this with Javascript.
My code and the resultant source from the compiled page are below. They
are resulting in an error on line 5 of the source "Error: Object
required: 'ADODB'"
Is this a good way to pass a recordset from the codebehind to the
client? Is there another way to hook this data into the datasource of
the pivottable? I've read that a recordset is a vaild datasource.
Appreciate any help any of you can give me with this.
My code************************
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim CFCwebService As New pivotData.getPivotService
Dim arrString() As String
Dim strPivotTable As String
For i As Integer = 0 To 9
ReDim Preserve arrString(i)
arrString(i) = CFCwebService.getPivotData(i)
Next
strPivotTable = "<object
classid=""clsid:0002E552-0000-0000-C000-000000000046"" id=""Pivot1""
height=""300"" width=""600"" ></object>"
Response.Write(strPivotTable)
Response.Write(LoadData(arrString))
'Response.Write(vbCrLf + "<script language='javascript'>" +
vbCrLf + "loadData();" + vbCrLf + "</script>")
Response.Write(vbCrLf + "<script language='vbscript'>" + vbCrLf
+ "LoadData()" + vbCrLf + "</script>")
Response.Write(CustomizeSpreadSheet())
End Sub
Function LoadData(ByVal strPayload() As String)
Dim newRS As New ADODB.Recordset
Dim xmlRS As New ADODB.Recordset
newRS.Fields.Append("ticket_numbers",
ADODB.DataTypeEnum.adVarChar, 10)
With newRS
.Open()
For i As Integer = 0 To 9
.AddNew()
.Fields.Item("ticket_numbers").Value = strPayload(i)
Next
End With
newRS.MoveFirst()
newRS.Save(newStream, ADODB.PersistFormatEnum.adPersistXML)
Dim strConn As String
strConn = "provider=mspersist"
newStream.Position = 0
xmlRS.Open(newStream)
''''JAVASCRIPT TRY
''strScript.Append(vbCrLf + "<script language='javascript'>" +
vbCrLf + "function loadData(){")
''strScript.Append(vbCrLf + "if(document.all.Pivot1 != null){")
'strScript.Append(vbCrLf +
"document.all.Pivot1.ConnectionString = ""DataSource='mydata.xml'"";")
'.Append(xmlRS)
''strScript.Append(vbCrLf +
"document.all.Pivot1.ConnectionString = ""Provider=mspersist"";")
''strScript.Append(vbCrLf + "document.all.Pivot1.DataSource =
").Append(xmlRS).Append(";")
'strScript.Append(vbCrLf +
"document.all.Pivot1.ConnectionString =
""DataSource=").Append(xmlRS).Append(""";")
''strScript.Append(vbCrLf + "}" + vbCrLf + "}" + vbCrLf +
"</script>")
''''JAVASCRIPT TRY
''''VBSCRIPT TRY
strScript.Append(vbCrLf + "<script language='vbscript'>" +
vbCrLf + "Function loadData()")
strScript.Append(vbCrLf + "Pivot1.ConnectionString =
""Provider=mspersist""")
strScript.Append(vbCrLf + "Pivot1.DataSource = ").Append(xmlRS)
strScript.Append(vbCrLf + "End Function")
strScript.Append(vbCrLf + "</script>")
''''VBSCRIPT TRY
Return strScript.ToString
End Function
************************
The source of the compile page comes up with:
****************************
<object classid="clsid:0002E552-0000-0000-C000-000000000046"
id="Pivot1" height="300" width="600" ></object>
<script language='vbscript'>
Function loadData()
Pivot1.ConnectionString = "Provider=mspersist"
Pivot1.DataSource = ADODB.RecordsetClass
response.write("loaddata has been called")
End Function
</script>
<script language='vbscript'>
LoadData()
</script>
<script language='javascript'>
if(document.all.Pivot1 != null){
document.all.Pivot1.ActiveView.FilterAxis.label.visible = true
document.all.Pivot1.ActiveView.RowAxis.label.visible = true
document.all.Pivot1.ActiveView.ColumnAxis.label.visible = true
document.all.Pivot1.ActiveView.titlebar.visible = true
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
Untitled Page
***************************
I'm a bit stumped at this point. Many of your posts have been helpful
getting me as far as I am at this point, but I'm not sure how to
proceed.
What I have currently is an asp.net project going. I'm trying to read
data in from a ColdFusion webservice, and write it out to a pivot table
so the end user can manipulate the data as they see fit.
I'm altering the recent example Alvin Bruney has posted to his Amazon
page for the VS2005 issue to suit my needs. I have to read the data
into the codebehind, and then pass it from the server to the client
(I'm attempting this with a recordset at the moment) and it's failing.
I'm passing it by writing out vbscript at the moment, but you can see
in my code I've also attempted this with Javascript.
My code and the resultant source from the compiled page are below. They
are resulting in an error on line 5 of the source "Error: Object
required: 'ADODB'"
Is this a good way to pass a recordset from the codebehind to the
client? Is there another way to hook this data into the datasource of
the pivottable? I've read that a recordset is a vaild datasource.
Appreciate any help any of you can give me with this.
My code************************
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim CFCwebService As New pivotData.getPivotService
Dim arrString() As String
Dim strPivotTable As String
For i As Integer = 0 To 9
ReDim Preserve arrString(i)
arrString(i) = CFCwebService.getPivotData(i)
Next
strPivotTable = "<object
classid=""clsid:0002E552-0000-0000-C000-000000000046"" id=""Pivot1""
height=""300"" width=""600"" ></object>"
Response.Write(strPivotTable)
Response.Write(LoadData(arrString))
'Response.Write(vbCrLf + "<script language='javascript'>" +
vbCrLf + "loadData();" + vbCrLf + "</script>")
Response.Write(vbCrLf + "<script language='vbscript'>" + vbCrLf
+ "LoadData()" + vbCrLf + "</script>")
Response.Write(CustomizeSpreadSheet())
End Sub
Function LoadData(ByVal strPayload() As String)
Dim newRS As New ADODB.Recordset
Dim xmlRS As New ADODB.Recordset
newRS.Fields.Append("ticket_numbers",
ADODB.DataTypeEnum.adVarChar, 10)
With newRS
.Open()
For i As Integer = 0 To 9
.AddNew()
.Fields.Item("ticket_numbers").Value = strPayload(i)
Next
End With
newRS.MoveFirst()
newRS.Save(newStream, ADODB.PersistFormatEnum.adPersistXML)
Dim strConn As String
strConn = "provider=mspersist"
newStream.Position = 0
xmlRS.Open(newStream)
''''JAVASCRIPT TRY
''strScript.Append(vbCrLf + "<script language='javascript'>" +
vbCrLf + "function loadData(){")
''strScript.Append(vbCrLf + "if(document.all.Pivot1 != null){")
'strScript.Append(vbCrLf +
"document.all.Pivot1.ConnectionString = ""DataSource='mydata.xml'"";")
'.Append(xmlRS)
''strScript.Append(vbCrLf +
"document.all.Pivot1.ConnectionString = ""Provider=mspersist"";")
''strScript.Append(vbCrLf + "document.all.Pivot1.DataSource =
").Append(xmlRS).Append(";")
'strScript.Append(vbCrLf +
"document.all.Pivot1.ConnectionString =
""DataSource=").Append(xmlRS).Append(""";")
''strScript.Append(vbCrLf + "}" + vbCrLf + "}" + vbCrLf +
"</script>")
''''JAVASCRIPT TRY
''''VBSCRIPT TRY
strScript.Append(vbCrLf + "<script language='vbscript'>" +
vbCrLf + "Function loadData()")
strScript.Append(vbCrLf + "Pivot1.ConnectionString =
""Provider=mspersist""")
strScript.Append(vbCrLf + "Pivot1.DataSource = ").Append(xmlRS)
strScript.Append(vbCrLf + "End Function")
strScript.Append(vbCrLf + "</script>")
''''VBSCRIPT TRY
Return strScript.ToString
End Function
************************
The source of the compile page comes up with:
****************************
<object classid="clsid:0002E552-0000-0000-C000-000000000046"
id="Pivot1" height="300" width="600" ></object>
<script language='vbscript'>
Function loadData()
Pivot1.ConnectionString = "Provider=mspersist"
Pivot1.DataSource = ADODB.RecordsetClass
response.write("loaddata has been called")
End Function
</script>
<script language='vbscript'>
LoadData()
</script>
<script language='javascript'>
if(document.all.Pivot1 != null){
document.all.Pivot1.ActiveView.FilterAxis.label.visible = true
document.all.Pivot1.ActiveView.RowAxis.label.visible = true
document.all.Pivot1.ActiveView.ColumnAxis.label.visible = true
document.all.Pivot1.ActiveView.titlebar.visible = true
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
Untitled Page
***************************