SPDataStore.UpdateReportView Method
Updates a report in a SharePoint list.
Namespace: Microsoft.PerformancePoint.Scorecards.Store
Assembly: Microsoft.PerformancePoint.Scorecards.Store (in Microsoft.PerformancePoint.Scorecards.Store.dll)
Syntax
'Declaration
Public Function UpdateReportView ( _
reportView As ReportView _
) As ReportView
'Usage
Dim instance As SPDataStore
Dim reportView As ReportView
Dim returnValue As ReportView
returnValue = instance.UpdateReportView(reportView)
public ReportView UpdateReportView(
ReportView reportView
)
Parameters
reportView
Type: Microsoft.PerformancePoint.Scorecards.ReportViewThe report object that contains the updated information. The Location property must specify the URL of the object to update.
Return Value
Type: Microsoft.PerformancePoint.Scorecards.ReportView
The updated object, which contains updated information such as the new version number.
Implements
IBIMonitoringStore.UpdateReportView(ReportView)
Remarks
For reportView, we recommend that you use a report view object that was previously retrieved by using the GetReportView(RepositoryLocation) method.
Examples
The following code example shows how to retrieve a report, update the retrieved report, and then save the updated object to the repository.
Before you can compile this code example, you must do the following:
Configure your development environment and create a C# class library project in Visual Studio. For information about configuring a development environment, see Setting Up the Development Environment for SharePoint 2010 on Windows Vista, Windows 7, and Windows Server 2008.
Add the Microsoft.PerformancePoint.Scorecards.Client, Microsoft.PerformancePoint.Scorecards.ServerCommon, and Microsoft.PerformancePoint.Scorecards.Store DLLs as references to your project. For more information about PerformancePoint Services in Microsoft SharePoint Server 2010 DLLs, see PerformancePoint Services DLLs Used in Development Scenarios.
Add the following using directives to your class.
using Microsoft.PerformancePoint.Scorecards; using Microsoft.PerformancePoint.Scorecards.Store; using System.Globalization;
Create a method that does the following:
Defines a string variable named "relativePath" to store the server-relative path to the object. The following example path sets the object identifier to "5": /BI Center/Lists/PerformancePoint Content/5_.000.
Creates an instance of a ReportView object named "updatedReportView." For an example of how to create the object, see the CreateReportView method.
Paste the following code example into the new method.
// As a best practice, retrieve an object and then update it.
// The RepositoryLocation constructor takes the server-relative path to the object.
ReportView requestedReportView = SPDataStore.GlobalDataStore.GetReportView(new RepositoryLocation(relativePath));
if (requestedReportView != null)
{
// Update the description to show the time of the last update operation.
requestedReportView.Description.Text = String.Format(
CultureInfo.CurrentCulture,
"Last updated at {0}",
DateTime.Now.ToLocalTime());
// Update the report in the repository.
updatedReportView = SPDataStore.GlobalDataStore.UpdateReportView(requestedReportView);
}