Sub SetChartTypeLine()
Dim chConstants
Set chConstants = form1.cht1.Constants
form1.cht1.Charts(0).Type = chConstants.chChartTypeSmoothLineMarkers
End Sub
Sub SetChartTypeColumn()
Dim chConstants
Set chConstants = form1.cht1.Constants
form1.cht1.Charts(0).Type = chConstants.chChartTypecolumnclustered
End Sub
Sub SetChartTypePie()
Dim chConstants
Set chConstants = form1.cht1.Constants
form1.cht1.Charts(0).Type = chConstants.chChartTypePie
End Sub
Sub SetChartTypeArea()
Dim chConstants
Set chConstants = form1.cht1.Constants
form1.cht1.Charts(0).Type = chConstants.chChartTypeArea
End Sub
Sub SetChartTypeColumns()
Dim chConstants
Set chConstants = form1.cht1.Constants
form1.cht1.Charts(0).Type = chConstants.chChartTypeColumnclustered3d
End Sub
Sub ChartButton()
form1.cht1.ExportPicture ("chart" & replace(date & time,":","") &".gif" )
End Sub
Sub PivotButton()
form1.pvt1.ExportPicture ("pivot" & replace(date & time,":","") &".gif")
End Sub
Sub Select1_onchange()
if form1.Select1.value=0 then
SetChartTypeColumn
end if
if form1.Select1.value = 1 then
SetChartTypeLine
end if
if form1.Select1.value = 2 then
SetChartTypePie
end if
if form1.Select1.value = 3 then
SetChartTypeArea
end if
if form1.Select1.value = 4 then
SetChartTypeColumns
end if
End Sub
Sub PivotVideoCube()
cht1.DataSource = PivotTable1
End Sub
Sub Window_onLoad()
PivotVideoCube10()
Form1.Hidden1.value=Form1.pvt1.XMLData
BindChart()
end sub
Sub BindChart()
set chs=Form1.cht1
set c = chs.Constants
' Bind the Chart control to the PivotTable control
set chs.DataSource = Form1.pvt1
set cht=chs.Charts(0)
with cht
.HasLegend=True
.HasTitle = True
'.Title.Caption = "zxd test"
end with
end sub
Sub ok()
msgbox Ccur(123.31123234234)
PivotVideoCube10()
BindChart()
end sub
Sub PivotVideoCube10()
Dim strConnect
strConnect = "Data Source=HTTP://" & form1.text2.value & ";Provider = MSOLAP.2;Initial Catalog =" & form1.text3.value
Form1.pvt1.ConnectionString = strConnect
Form1.pvt1.DisplayFieldList = True
Dim CubeName
Dim aDimName
Dim vDimName
Dim MeasureName
Dim strSource
Dim MyMDXStr
CubeName =Form1.text1.value
strSource = "select FROM " & CubeName
Form1.pvt1.CommandText = strSource
End Sub
Sub Allow_Formatting()
Form1.chs1.AllowPropertyToolbox = True
Form1.chs1.HasSelectionMarks = True
End Sub
sub pvt1_onblur()
form1.Hidden1.value=Form1.pvt1.XMLData
end sub
</script>
<script language="javascript">
function TableView ()
{
if (form1.pvt1.style.display !="none")
{
form1.pvt1.style.display="none"
form1.pvtbtn.style.display="none"
form1.cht1.style.display=""
form1.Select1.style.display=""
form1.chtbtn.style.display=""