构建自定义报告视图精.docx
- 文档编号:2170402
- 上传时间:2023-05-02
- 格式:DOCX
- 页数:16
- 大小:104.68KB
构建自定义报告视图精.docx
《构建自定义报告视图精.docx》由会员分享,可在线阅读,更多相关《构建自定义报告视图精.docx(16页珍藏版)》请在冰点文库上搜索。
构建自定义报告视图精
为MicrosoftBusinessScorecardManager2005构建自定义报告视图
本文档是一份初稿,在发布此处所述软件的最终商业版本之前可能会做重大改动。
本文档所包含的信息代表了MicrosoftCorporation在发布之日对所讨论问题的看法。
因为Microsoft必须顺应不断变化的市场条件,故不应将本文档理解为Microsoft一方的承诺,Microsoft不保证所给出的信息在发布之日以后仍保持准确性。
本白皮书仅供参考。
Microsoft对本文档中的信息不做任何明示或暗示的保证。
遵守所有适用的版权法是用户的责任。
除版权法规定的权利外,未经MicrosoftCorporation的明确书面许可,不得以任何形式、任何手段(电子、机械、影印、录制或其他方式)或出于任何目的复制、传播本文档的任何部分,也不得将其存入或引入检索系统。
Microsoft可能拥有本文档主题涉及到的专利、专利使用、商标、版权或其他知识产权。
除非在Microsoft的任何书面许可协议中有明确的表示,否则提供本文档并不表示授权您使用这些专利、商标、版权或其他知识产权。
©2005MicrosoftCorporation。
保留所有权利。
本文档中所例举的公司、组织、产品、域名、电子邮件地址、徽标、人员、地点和事件纯属虚构。
与任何真实的公司、组织、产品、域名、电子邮件地址、徽标、人员、地点或事件均不相关,也不应推断出任何关联性。
Microsoft、MSDN和Office徽标是MicrosoftCorporation在美国和/或其他国家(地区)的注册商标或商标。
目录
简介4
关于自定义报告视图4
创建示例自定义报告视图4
创建配置组件4
使用配置组件7
创建Web组件9
使用Web组件11
简介
Microsoft®OfficeBusinessScorecardManager2005的一个核心功能是能够以报告视图的形式将异类报告与记分卡或KPI关联起来。
这些报告提供补充数据和其他工具以帮助决策者分析绩效信息并根据这些信息制定决策。
BusinessScorecardManager支持多种报告视图,包括OfficeWeb组件(OWC)、PivotCharts®、PivotTables®、电子表格、基于MicrosoftSQLServer™ReportingServices的报表、记分卡视图和网页。
此外,开发人员和第三方独立软件供应商(ISV)可以构建基于.NET的自定义报告视图类型,这些视图类型可与BusinessScorecardManager进行无缝集成。
本文说明以下内容:
●关于自定义报告视图。
●创建示例自定义报告视图,包括:
●创建配置组件。
●使用配置组件。
●创建Web组件。
●使用Web组件。
关于自定义报告视图
要创建自定义报告视图,必须构建以下两个组件:
1.由BusinessScorecardBuilder托管的配置组件。
2.用于显示自定义报告视图的Web组件,由基于MicrosoftWindowsSharePoint®Services或基于MicrosoftOfficeSharePointPortalServer的网页托管。
配置组件是派生自CustomReportViewWinControlBase类的Windows®Forms用户控件。
该组件显示于BusinessScorecardBuilder的报告视图编辑器中,用户可使用它来配置自定义报告视图。
自定义报告视图Web组件由基于WindowsSharePointServices或SharePointPortalServer的网页上的报告视图Web部件托管。
创建示例自定义报告视图
本部分说明创建示例自定义报告视图的步骤。
将构建一个可将记分卡的当前状态和选择信息显示到屏幕上的组件。
创建配置组件
创建示例自定义报告视图的第一步是创建配置组件。
报告视图的配置窗格将显示一个可用于将数据传递到Web组件的文本框,以及一个用于测试验证检查是否在运行的复选框。
还要添加一些控件,以设置首选高度、首选宽度以及报告视图组,如图1所示(组表示可用于在基于WindowsSharePointServices或SharePointPortalServer的网站上的报告视图Web部件中显示报告视图的物理区域)。
图1
完成的示例配置组件
下面是配置组件的示例代码:
usingSystem;
usingSystem.Windows.Forms;
usingSystem.ComponentModel;
usingSystem.Drawing;
usingMicrosoft.PerformanceManagement.Scorecards.Client;
usingMicrosoft.PerformanceManagement.Scorecards.Extensions;
namespaceCustomReportViewSample
{
///
///SamplecustomReportViewauthoringcontrol
///
publicclassSampleCustomReportViewWinControl:
CustomReportViewWinControlBase
{
CustomReportViewcustomReportView;
CheckBoxvalidate=newCheckBox();
TextBoxcustomDataTextBox=newTextBox();
ErrorProvidervalidationErrorProvider=newErrorProvider();
ComboBoxgroupComboBox=newComboBox();
TextBoxpreferredHeight=newTextBox();
TextBoxpreferredWidth=newTextBox();
constintMaxReportViewZones=30;
publicSampleCustomReportViewWinControl()
{
//Addthecustomdatacontrol
Labellabel=newLabel();
label.Left=10;
label.Top=10;
label.Text="&CustomData:
";
label.Height=label.PreferredHeight;
label.Width=label.PreferredWidth;
this.Controls.Add(label);
customDataTextBox.Left=10;
customDataTextBox.Top=label.Bottom+10;
customDataTextBox.Height=50;
customDataTextBox.Width=200;
customDataTextBox.Multiline=true;
this.Controls.Add(customDataTextBox);
//Addthepass-validationcontrol
validate.Left=10;
validate.Top=customDataTextBox.Bottom+10;
validate.Height=50;
validate.Width=200;
validate.Text="Pass&validation";
validate.Checked=true;
this.Controls.Add(validate);
//Addthepreferredheightcontrol
LabelpreferredHeightLabel=newLabel();
preferredHeightLabel.Top=validate.Bottom+10;
this.Controls.Add(preferredHeightLabel);
preferredHeightLabel.Text="Preferred&height:
";
preferredHeightLabel.TextAlign=ContentAlignment.MiddleRight;
preferredHeight.Top=preferredHeightLabel.Top;
preferredHeight.Left=preferredHeightLabel.Right+5;
preferredHeight.Width=40;
this.Controls.Add(preferredHeight);
preferredHeight.Name="preferredHeight";
preferredHeight.MaxLength=5;
//Addthepreferredwidthcontrol
LabelpreferredWidthLabel=newLabel();
preferredWidthLabel.Top=preferredHeightLabel.Bottom+10;
this.Controls.Add(preferredWidthLabel);
preferredWidthLabel.Text="Preferred&width:
";
preferredWidthLabel.TextAlign=ContentAlignment.MiddleRight;
preferredWidth.Top=preferredWidthLabel.Top;
preferredWidth.Left=preferredWidthLabel.Right+5;
preferredWidth.Width=40;
this.Controls.Add(preferredWidth);
preferredWidth.Name="preferredWidth";
preferredWidth.MaxLength=5;
//Addthegroupdropdown
LabelgroupLabel=newLabel();
groupLabel.Top=preferredWidthLabel.Bottom+10;
this.Controls.Add(groupLabel);
groupLabel.Text="&Group:
";
groupLabel.TextAlign=ContentAlignment.MiddleRight;
for(inti=1;i<=MaxReportViewZones;i++)
{
groupComboBox.Items.Add(i);
}
groupComboBox.DropDownStyle=ComboBoxStyle.DropDownList;
groupComboBox.Left=groupLabel.Right+5;
groupComboBox.Top=groupLabel.Top;
groupComboBox.Height=groupComboBox.PreferredHeight;
groupComboBox.Width=40;
this.Controls.Add(groupComboBox);
}
publicoverridevoidSetCustomReportView(
CustomReportViewcustomReportView)
{
this.customReportView=customReportView;
customDataTextBox.Text=customReportView.Data;
if(customReportView.PreferredHeight>0)
preferredHeight.Text=
customReportView.PreferredHeight.ToString();
if(customReportView.PreferredWidth>0)
preferredWidth.Text=customReportView.PreferredWidth.ToString();
if(customReportView.Zone>=0&&
customReportView.Zone groupComboBox.SelectedIndex=customReportView.Zone; else groupComboBox.SelectedIndex=0; } publicoverridestringGetCustomType() { return"SampleCustomReportView"; } publicoverridestringGetDisplayName() { return"CustomReportViewSample"; } publicoverrideboolValidateData() { if(! validate.Checked) { //Thischeckisjusttodemonstratethevalidationmechanism //Inactualcode,youwouldvalidateyourcustomdatahere this.validationErrorProvider.SetError( this.validate, "Thisboxmustbechecked"); } returnvalidate.Checked; } publicoverridevoidUpdateData() { //UpdatedatafromUI customReportView.Data=customDataTextBox.Text; if(preferredHeight.Text.Length>0) customReportView.PreferredHeight=int.Parse( preferredHeight.Text); else customReportView.PreferredHeight=int.MinValue; if(preferredWidth.Text.Length>0) customReportView.PreferredWidth=int.Parse(preferredWidth.Text); else customReportView.PreferredWidth=int.MinValue; customReportView.Zone=groupComboBox.SelectedIndex; } } } 使用配置组件 要使用配置组件,必须先对该组件进行注册。 然后在BusinessScorecardBuilder中验证该组件是否已准备就绪。 使用配置组件 1.在运行BusinessScorecardBuilder的服务器的全局程序集缓存(GAC)中注册配置组件。 若要在GAC中注册配置组件,请在命令提示符后运行以下命令: gacutil/f/iCustomReportViewSample.dll 2.使用BusinessScorecardBuilder注册配置组件。 若要执行此操作,请在pmbuilder.exe所在的文件夹中(默认情况下,此程序安装在\ProgramFiles\MicrosoftOfficeBusinessScorecardManager2005\Builder中)创建一个名为pmbuilder.exe.config的新配置文件。 作为示例报告视图扩展内容的配置文件具有以下内容: 构建自定义报告视图时,必须将程序集引用值和PublicKeyToken值更改为您的程序集的相应值。 3.注册该组件以后,可以验证它是否已准备就绪。 打开BusinessScorecardBuilder,然后打开一个新工作区。 4.在“工作区浏览器”中,单击任一记分卡或KPI。 5.在该窗口右窗格的“报告视图”选项卡上单击“添加”。 将打开“创建报告视图”向导。 6.单击“新建定义”,然后单击“下一步”。 7.在“报告视图类型”下拉列表中,所创建的自定义报告视图目前显示在可用报告视图的列表中,如图2所示。 图2 自定义报告视图类型选择 自定义报告视图配置窗格的用户界面(UI)包含一个可输入任意字符串的文本框和一个可测试验证界面的复选框。 清除通过验证复选框会导致BusinessScorecardBuilder在用户单击“确定”时显示错误。 自定义数据文本框的内容将被传递给自定义报告视图。 在实际操作中,可以使用CustomData属性将配置数据传递给视图控件,例如序列化对象的表单。 创建Web组件 本部分说明如何构建自定义报告视图的查看时组件,该组件用于将内容在基于WindowsSharePointServices或SharePointPortalServer的网页上呈现给用户。 在此示例中,将显示所有有用的状态数据,这些数据在运行时可用于该控件。 这些数据(如图3所示)包括: 1.在创作组件中设置的自定义数据。 2.链接的记分卡。 3.选定的记分卡视图。 4.选定的记分卡节点(KpiGroup对象)。 5.选定的实际值或目标值(KpiMeasure对象)。 7.活动的页面筛选器。 8.选定单元格的行部分。 9.选定单元格的列部分。 图3 示例自定义报告视图Web控件 图4说明KPIGroupID、KPIMeasureID和Column部分是如何随着用户所选单元格的不同而变化的。 图4 选择单元格后的示例自定义报告视图Web组件 自定义报告视图的Web组件是从CustomReportViewControlBase类派生的。 下面是报告视图Web组件的示例代码: usingSystem; usingSystem.Web; usingSystem.Web.UI; usingSystem.Web.UI.WebControls; usingSystem.ComponentModel; usingMicrosoft.PerformanceManagement.Scorecards.Extensions; usingMicrosoft.PerformanceManagement.Scorecards.Client; namespaceCustomReportViewSample { /// ///Asamplecustomreportviewcontrol /// publicclassSampleCustomReportViewControl: CustomReportViewControlBase { /// ///Renderthiscontroltotheoutputparameterspecified. /// /// protectedoverridevoidRender(HtmlTextWriteroutput) { //Showthecontextinformationavailabletothecontrol output.Write(" "+HttpUtility.HtmlEncode(this.CustomData)); output.Write(" "+HttpUtility.HtmlEncode(this.ContextData.Scorecard.Name.Text)); output.Write(" "+HttpUtility.HtmlEncode(this.ContextData.ConfiguredView.Name.Text)); output.Write(" "+HttpUtility.HtmlEncode(this.ContextData.SelectedKpiG
CustomData:
ScorecardName:
ScorecardViewName:
selectedKpiGroupId:
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 构建 自定义 报告 视图