I am trying to programmatically get to the Web Analytics Report (more specifically, Summary Report) for my site collection. Here is my code:
*******************************************************************
AnalyticsReportFunction ar = new AnalyticsReportFunction();
object[,] result = null;
try
{
result = ar.GetWebAnalyticsReportData(SPContext.Current.Site.Url,
"2",
ReportType.SummaryReport.ToString(),
DateTime.Today.AddDays(-30),
DateTime.Today);
}
catch (Exception e)
{
}
*******************************************************************************
The problem is that it throws a strange "viewName" exception, and so result remains null. I couldn't find anywhere online what this exception means. The innerexception is null. The stack trace is:
at Microsoft.Office.Server.WebAnalytics.Reporting.ViewParametersManager.GetViewPropertyCount(ReportType reportType)
at Microsoft.Office.Server.WebAnalytics.Reporting.AnalyticsReportFunction.GetWebAnalyticsReportData(String siteUrl, String reportLevel, String reportName, DateTime startDate, DateTime endDate)
Does anyone know what can be the issue?
Thanks a lot!
BorisBoris Velikovich