Friday, May 31, 2013

Save PerformancePoint Analytic Reports to SharePoint

Save PerformancePoint Analytic Reports to SharePoint


These are the steps of how to save a "navigated" PerformancePoint Analytic Reports as a custom view into SharePoint programmatically and reference it later .

1. Get the report Id from the client side.

When a PerformancePoint Analytic Report is "navigated" from the default view, there is a custom report created with a newly assigned ID. By referencing this new ID, you can save the custom report into SharePoint.

From JavaScript:

    var webPartRecords = PPSMA.ClientConnectionManager.get_instance().get_connectionManagerRecord().WebPartRecords;

The returned objec collection "webPartRecords" contains object "webPartRecord". This object has "ClientId" which you can use to locate the PPS web part on page and "recordId" which you can use to save the report. The recordId is retrieved from the ViewState F775B8BE98A540C2AB08B34D53460E4B.

var lastReportId = wP.ViewState["F775B8BE98A540C2AB08B34D53460E4B"];

2. Once you have the reportId, pass it to the server side code and save the report.

ReportView report = BIMonitoringServiceApplicationProxy.Default.GetAnalyticReportView(new RepositoryLocation(new Guid(reportId)));
ReportView newReport = SPDataStore.GlobalDataStore.CreateReportView(listUrl, report);

No comments:

Post a Comment