日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

      歡迎訪問 生活随笔!

      生活随笔

      當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

      编程问答

      OWC简介及其属性

      發布時間:2025/7/14 编程问答 26 豆豆
      生活随笔 收集整理的這篇文章主要介紹了 OWC简介及其属性 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
      轉載:[url]http://www.cnblogs.com/yiriqing/archive/2006/06/14/425923.html[/url] Figure 3 Office Web Components (version 10)

      組件描述
      PivotTable使用戶連接到支持 OLE DB Provider for OLAP Services 8.0 或更高版的 OLAP 數據源上 (也可連接到 Excel 電子數據表單 和 SQL Server 、 Access 關系數據庫)。PivotTable 控件允許用戶對數據進行透視、分組、篩選和排序等操作。
      Spreadsheet提供電子數據表單用戶接口,包括重算引擎和擴展函數庫。
      Chart圖形化顯示來自某個綁定數據源、PivotTable 或 Spreadsheet 控件的數據。當 Chart 組件被綁定到 PivotTable 控件且用戶重新透視數據時能自動刷新。
      DataSource管理與后臺數據庫服務器的通訊。PivotTable 和 Spreadsheet 組件實際上能單獨連接到數據源,,不一定非得要 DataSource 組件。這是因為其 XML 數據可以直接包含 OLE DB 連接串。

      Figure 4 PivotTable and Chart-related Objects

      成員描述
      PivotTable使用戶連接到支持 OLE DB Provider for OLAP Services 8.0 或更高版的 OLAP 數據源上 (也可連接到 Excel 電子數據表單 和 SQL Server 、 Access 關系數據庫)。PivotTable 控件允許用戶對數據進行透視、分組、篩選和排序等操作。
      PivotView表示 PivotTable 的一個特定視圖. 用于對 PivotTable 視圖中的行、列、標尺、格式化進行設置。
      PivotDataAxis包含與數據軸相關的方法和屬性
      PivotResultColumnAxis包含與列軸相關的方法和屬性
      PivotResultRowAxis包含與行軸相關的方法和屬性
      PivotFieldSet多維數據集中定義的字段集
      PivotField多維數據集中定義的字段
      ChartSpace使用戶連接到支持 OLE DB Provider for OLAP Services 8.0 或更高版的任何 OLAP 數據源上,(也可連接到 Excel 電子數據表單和 SQL Server、Access 關系數據庫)。ChartSpace 允許用戶圖形化顯示數據并且將控件綁定到一個已存在的 PivotTable 或 Spreadsheet。
      ChChartsChChart 對象集合
      ChChartChartSpace 中的單個圖表,一個ChartSpace 可容納多達64個圖表。

      Figure 5 PivotTable Component's Programmatic Interface

      成員類型描述
      ActiveView屬性表示一個活動的 PivotTable 布局。該屬性返回一個 PivotView 對象。
      ColumnAxis屬性表示列軸中的字段。返回一個 PivotAxis 對象。
      ConnectionString屬性設置連接到 Analysis Services 服務器的連接字符串,ConnectionString 屬性中的 DataSource 參數決定了 OWC 組件將要使用的連接協議。
      DataAxis屬性表示數據軸的規模。返回一個 PivotAxis 對象。
      DataMember屬性設置控件將要從 Analysis Services 請求的數據源名稱。它與多維數據集同名。
      IncludedMembers屬性定義了 PivotField 內的數據成員。該屬性接受的參數為單一成員或成員數組。
      IsIncluded屬性設置所包含的字段并激活 PivotFieldSet。
      RowAxis屬性表示行軸中的字段,返回 PivotAxis 對象。
      XMLData屬性設置或返回當前用于 PivotTable 報表控件的 XML 數據。有關報表的細節 (格式和數據) 均保存在 XML 數據中。也包括了 OLAP 連接詳細信息。
      AddCustomGroupField方法為指定的 PivotFieldSet 添加一個定制的分組字段。
      AddCustomGroupMember方法為指定的 PivotFieldSet 添加一個定制的分組成員。
      InsertFieldSet方法在行或列軸中插入一個字段集。
      CommandExecute事件在某個命令執行之后觸發,ChartCommandIdEnum 和PivotCommandId 常量包含用于每個 OWC 組件所支持的命令清單。
      Query事件PivotTable 激活某個查詢時觸發。

      Figure 6 Chart Component's Programmatic Interface

      成員類型描述
      DataSource屬性 為 Chart 控件定義數據源。當設置另一個控件(如:PivotTable 或 Spreadsheet)這樣有效地綁定 Chart 控件到其它控件。
      Type屬性 象 ChartChartTypeEnum 枚舉所定義的那樣定義圖表類型,默認類型為條形圖。

      Figure 8 Connecting to an OLAP Data Source
      function initializePivotTable(strDataMember) { // This function calls the InitializePivotTableXML() Web // method var iCallID = service.svcOLAP.callService (onInitializePivotTableResult, 'InitializePivotTableXML', strDataMember); } function onInitializePivotTableResult(result) { // This function handles the InitializePivotTableXML() // Web method result text = result.value; // result string // Evaluate return result if (!result.error) { // Assign the XML to the PivotList XMLData value frm1.PivotTable1.XMLData = text; } else { alert("Unhandled error - " + result.errorDetail.code + " " + result.errorDetail.string); } }
      Figure 9 Generate XMLData for a PivotTable Control
      <WebMethod()> Public Function InitializePivotTableXML(ByVal _ strDataMember As String) As String Dim m_XML As String Dim strOLAPConn As String = _ ConfigurationSettings.AppSettings("OLAPConnectionString") Try Dim objPT As PivotTableClass = New PivotTableClass objPT.ConnectionString = strOLAPConn objPT.DataMember = strDataMember m_XML = objPT.XMLData objPT = Nothing Catch err As Exception m_XML = "<err>" & err.Source & " - " & err.Message & _ "</err>" Finally End Try Return (m_XML) End Function
      Figure 10 LoadCustomPivotTableReport Web Method
      <WebMethod()> Public Function LoadCustomPivotTableReport(ByVal _ strCity1 As String, ByVal strCity2 As String) As String Dim m_XML As String Dim strOLAPConn As String = _ ConfigurationSettings.AppSettings("OLAPConnectionString") Dim objPT As PivotTableClass = New PivotTableClass Dim objPTView As PivotView Dim fldCity, fldName, fldProdFamily As PivotField Dim fSetCustomers, fSetProduct As PivotFieldSet Try objPT.ConnectionString = strOLAPConn objPT.DataMember = "Sales" objPT.AllowFiltering = False objPTView = objPT.ActiveView objPTView.TitleBar.Caption = "City Comparison of Drink Sales" ' Define the column elements objPTView.ColumnAxis.InsertFieldSet(objPTView.FieldSets("Time")) objPTView.ColumnAxis.FieldSets("Time").Fields("Year").Expanded = True ' Define the row elements fSetCustomers = objPTView.FieldSets("Customers") objPTView.RowAxis.InsertFieldSet(fSetCustomers) fSetCustomers.Fields("Country").IsIncluded = False fSetCustomers.Fields("State Province").IsIncluded = False fSetCustomers.Fields("Name").IsIncluded = False ' Define the members of the row elements fldCity = fSetCustomers.Fields("City") fldCity.IncludedMembers = New Object() {strCity1, strCity2} ' Exclude all other field row members in the fieldset fSetProduct = objPTView.FieldSets("Product") objPTView.RowAxis.InsertFieldSet(fSetProduct) fSetProduct.Fields("Product Department").IsIncluded = False fSetProduct.Fields("Product Category").IsIncluded = False fSetProduct.Fields("Product Subcategory").IsIncluded =False fSetProduct.Fields("Brand Name").IsIncluded = False fSetProduct.Fields("Product Name").IsIncluded = False fldProdFamily = fSetProduct.Fields("Product Family") fldProdFamily.IncludedMembers = "Drink" ' Define the measures objPTView.DataAxis.InsertTotal(objPTView.Totals("Store Sales")) objPTView.DataAxis.Totals("Store Sales").NumberFormat = _ "Currency" ' Return the XML data to the client side script m_XML = objPT.XMLData objPT = Nothing Catch err As Exception m_XML = "<err>" & err.Source & " - " & err.Message & "</err>" Finally End Try Return (m_XML) End Function
      Figure 11 Load the XMLData for a Custom Report
      function LoadSavedReport() { // Purpose: Call Web Service method to load the saved // report var iCallID = service.svcOLAP.callService(onLoadSavedReportResult, 'LoadSavedReport', 'OLAPReport1.xml'); } function onLoadSavedReportResult(result) { // Purpose: This function handles the // wsOLAP.onLoadSavedReportResult() Web Service result var text = result.value; // result string // Evaluate return result if (!result.error) { // Assign the XML to the PivotList XMLData value frm1.PivotTable1.XMLData = text; } }
      Figure 12 JavaScript and VBScript Event Handler
      <script language="javascript" event="Query" for="PivotTable1"> { var sLog = document.Form1.Text1.value + ""; document.Form1.Text1.value = "Query Event Fired. " + sLog; } </script> <script language="vbscript"> Sub PivotTable1_CommandExecute(Command, Succeeded) Dim ptConstants Set ptConstants = document.Form1.PivotTable1.Constants ' Check to see if the PivotTable list has been ' refreshed. If Command = ptConstants.plCommandRefresh Then ' Write the current data and time to the text box. document.Form1.Text1.value = vbCrLf & _ "PivotTable Last Refreshed on " & Date & " at " _ & Time & vbCrLf & document.Form1.Text1.value End If End Sub </script>
      Figure 13 Creating Custom Groups
      <WebMethod()> Public Function ApplyCustomGrouping(ByVal _ strReportXMLData As String) As String Dim m_xml As String Dim objPT As PivotTableClass = New PivotTableClass Dim objPTView As PivotView Dim fsTime As PivotFieldSet Dim fsHalfYear As PivotField Try objPT.XMLData = strReportXMLData objPTView = objPT.ActiveView ' Set a variable to the Time field set. fsTime = objPTView.FieldSets("Time") ' Add a custom group field named "Group1" to the Time field ' set. fsHalfYear = fsTime.AddCustomGroupField("CustomGroup1", _ "CustomGroup1", "Quarter") ' Add a custom field set member. This member includes all ' "Q1" and "Q2" members under 1997. fsHalfYear.AddCustomGroupMember _ (fsTime.Member.ChildMembers("1997").Name, _ New Object() {"Q1", "Q2"}, "1stHalf") ' Add another custom fieldset member to include all "Q3" ' and "Q4" members under 1997. fsHalfYear.AddCustomGroupMember _ (fsTime.Member.ChildMembers("1997").Name, _ New Object() {"Q3", "Q4"}, "2ndHalf") ' Collapse the fieldset at the custom member level fsHalfYear.Expanded = False m_xml = objPT.XMLData objPT = Nothing Catch err As Exception m_xml = "<err>" & err.Source & " - " & err.Message & _ "</err>" Finally End Try Return (m_xml) End Function

      轉載于:https://blog.51cto.com/recoverypeak/145324

      總結

      以上是生活随笔為你收集整理的OWC简介及其属性的全部內容,希望文章能夠幫你解決所遇到的問題。

      如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。