Programming MS Office 2000 Web Components Chapter 4 Section 6

Source: Internet
Author: User

Key points of the Programming Model

 

Each table in this section is a quick reference for the pivot table component programming model. When writing a program using the pivot control, you can refer to this chapter to learn what attributes, methods, and events should be used.

Table4-1. Bind to data

Attribute

Explanation

PivotTable. connectionstring

Set this property to a valid connection string to connect the pivot control to the data source.

PivotTable. commandtext

Set this attribute to an SQL statement or a command acceptable to any provider. This attribute is only used for table column data sources.

PivotTable. datamember

Set this attribute to the name of the OLAP cube to be used, or the name of the dataset in the DSC referenced by the datasource attribute.

PivotTable. datasource

Set this attribute to an instance of DSC and then use it as the data source. Even if you use the connectionstring attribute to connect to the data source, a DSC object is returned for the datasource attribute.

Table 4-2.Adjust and save the view Layout.

Attribute or Method

Explanation

Effectview. fieldsets

This attribute contains all valid field sets available in the report.

Effectview. Totals

This attribute contains all valid aggregate values available in the report.

Insertfieldset

Use this method to insert a field set on the row, column, or filter axis.

Pivotdataaxis. inserttotal

You can use this method on the Data axis to insert a total value to the report.

Required tfield. isincluded

If this attribute is set to false, a field in the field set can be excluded from the report. You can also use this attribute to determine whether a field is in a report.

Expanded

Set this attribute to true. You can expand a field or member to display its child elements. Read the value of this attribute to check whether a field or member is in the expanded status.

Extends tview. autolayout

This method can be used to clear the view for the OLAP data source, or to place all fields in the detail area for the table data source.

Effectview. addtotal

Use this method to create a new sum value based on a detail field.

Effectfield. sortdirection

Use this attribute to set the field sorting method or obtain the current sorting direction of the field.

Effectfield. sorton

This attribute is used to sort members of a field by their total value, rather than by their title.

Effectfield. sortonscope

This attribute is used to sort a series of members based on a total value, but only to sort members within a range on the other axis (???)

Effectfieldset. filtermember

Use this attribute to read or set the selected member in a field set on the filter axis.

Effectfield. filtermembers

Use this attribute to obtain the set of currently filtered members for a given field

Effectfield. filterfunction

Use this attribute to set or determine the filter function used by the filtermembers attribute. The filter function can include or exclude members, or has no filtering action.

PivotTable. xmldata

This attribute is used to obtain the definition information of the current report. It is a huge string. You can save this string, read it in the future, and reset the report.

Effectview. totalorientation

Use this property to make the pivot table control display the row title as the title of the total value, rather than the column title.

Effectgroupaxis. displayemptymembers

Use this property to force the pivot table control to display rows or columns with no data at all.

Table 4-3.Customize and format the view.

Attribute

Explanation

PivotTable. autofit

Using this property to disable autofit is particularly useful in a form-based environment (such as VB.

Effectview. titlebar

Use this attribute to adjust the text and format of the title bar.

Optional tTable. displaytoolbar,
Optional tTable. displayfieldlist,
PivotTable. displaypropertytoolbox

Use these attributes to control the visibility of toolbar, Field List, and attribute toolbox elements.

Required tTotal. numberformat

Use these attributes to format the total number.

Effectfield. subtotalbackcolor

Use this attribute to set the background color of the subtotal so that the subtotal is different from those that make up the subtotal. The subtotalbackcolor attribute is useful when a large report visually distinguishes the aggregate values of different levels.

Effectfield. subtotalfont

This attribute can be used to make the font of the subtotal different from that of the number that makes up the subtotal.

PivotTable. memberexpand

Use this property to enable the pivot table control to automatically expand fields and members when they are added to the view.

Table 4-4. Important events.

Event

Explanation

Querycomplete

This event is triggered when the pivot table control executes a query on the data source. When this event occurs, the layout of the report should be changed. This is a good opportunity to adjust the report title and any other user interface elements that need to be synchronized with the report.

Click

Triggered when you click on a report. Use the selection attribute to determine where the user has clicked.

Dblclick

Similar to the click event, but triggered when you double-click the event. It is often used to trigger a jump and go to another page to display the details that constitute a summary value. It can also be used to display the attribute toolbox or display the user interface in your custom format.

Selectionchange

Triggered when the selected part of the report changes. It is mainly used when a new value is selected and other elements on the page or form need to be changed.

Pivottablechange

This event is triggered for multiple reasons when you use a table column data source. The event parameter reason describes the cause of the event. For example, a new summary value is created or a summary value is deleted.

Viewchange

This event is triggered frequently, so you should not process too many tasks in the event processing function. Any slight modification in the view may trigger this event. The event parameter reason describes what happened. Refer to the owc online help file (msowcvba. CHM) for the enumerative javastviewreasonenum, which contains a complete list of the causes for triggering this event.

 

 

 

 

SmallEnd

This chapter includes answers to many developers' frequently asked questions about the pivot table component. Therefore, after reading this chapter, you should have a better understanding of the functions of this powerful technology. The following describes more about the pivot table component in Chapter 7. In this chapter, we will study the source code of a complete OLAP sales analysis and report system.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.