N
Notachance
The graphing page in my web application allows users with OWC to design
graphs using a client-side PivotTable and ChartSpace and then persist
them to a database. I'd like to allow users without OWC to at least see
a GIF image, so I've been trying to get the server to create a
PivotTable and ChartSpace in server-side memory, fill their XMLData
properties, bind them together and do an ExportPicture. However, all I
get is an empty chart of gridlines, which implies the datasource
binding isn't working properly, I think.
I've posted example code below. I suspect I'm making an obvious
mistake, so any pointers would be gratefully received!
Dim oPivotTable As New Microsoft.Office.Interop.Owc11.PivotTable
Dim oChartSpace As New Microsoft.Office.Interop.Owc11.ChartSpace
oPivotTable.XMLData = GetXMLData(msLayoutsuid, "pivot").InnerXml
oChartSpace.XMLData = GetXMLData(msLayoutsuid, "chart").InnerXml
'One of the following:
oChartSpace.DataSource = oPivotTable ' Doesn't seem to work
oChartSpace.DataSource = oPivotTable.GetOcx ' Intellisense can't see it
oChartSpace.DataSource = CType(oPivotTable,
msdatasrc.DataSource).GetOcx ' Errors saying pivottableclass doesn't
have getocx()
oChartSpace.ExportPicture("C:\output\chart.gif", "gif", 600, 350)
graphs using a client-side PivotTable and ChartSpace and then persist
them to a database. I'd like to allow users without OWC to at least see
a GIF image, so I've been trying to get the server to create a
PivotTable and ChartSpace in server-side memory, fill their XMLData
properties, bind them together and do an ExportPicture. However, all I
get is an empty chart of gridlines, which implies the datasource
binding isn't working properly, I think.
I've posted example code below. I suspect I'm making an obvious
mistake, so any pointers would be gratefully received!
Dim oPivotTable As New Microsoft.Office.Interop.Owc11.PivotTable
Dim oChartSpace As New Microsoft.Office.Interop.Owc11.ChartSpace
oPivotTable.XMLData = GetXMLData(msLayoutsuid, "pivot").InnerXml
oChartSpace.XMLData = GetXMLData(msLayoutsuid, "chart").InnerXml
'One of the following:
oChartSpace.DataSource = oPivotTable ' Doesn't seem to work
oChartSpace.DataSource = oPivotTable.GetOcx ' Intellisense can't see it
oChartSpace.DataSource = CType(oPivotTable,
msdatasrc.DataSource).GetOcx ' Errors saying pivottableclass doesn't
have getocx()
oChartSpace.ExportPicture("C:\output\chart.gif", "gif", 600, 350)