OK, this is an odd one but I have a CrossTab report that when run locally on my dev machine under IIS runs perfectly fine.
However when run in Azure the needDataSource event for the CrossTab isn't raise. I have attached a remote debugger, I can see the report initialize, and the Reports NeedDataSource event is raised however CrossTab1_NeedDataSource is never executed.
No errors are thrown, no error statements in the console during debugging.
Is there another way to force the NeedDataSource even to fire? Or a way to bind the cross tab(s) from the reports datasource.
However when run in Azure the needDataSource event for the CrossTab isn't raise. I have attached a remote debugger, I can see the report initialize, and the Reports NeedDataSource event is raised however CrossTab1_NeedDataSource is never executed.
No errors are thrown, no error statements in the console during debugging.
Is there another way to force the NeedDataSource even to fire? Or a way to bind the cross tab(s) from the reports datasource.
using
System.Linq;
using
Bentley.SelectServer.Database;
using
System;
namespace
Bentley.SelectServer.Reporting
{
/// /*------------------------------------------------------------------------------------------------------*/
/// <summary>
/// Summary description for MonthlyPeakUsage.
/// </summary>
/// <author>marcus.kellermann</author> <date>7/23/2013</date>
/// /*------------------------------------------------------------------------------------------------------*/
//public partial class MonthlyPeakUsage : Telerik.Reporting.Report, iBaseReport
public
partial
class
MonthlyPeakUsage : BaseReport, iBaseReport
{
public
MonthlyPeakUsage()
{
InitializeComponent();
this
.DocumentName = GetReportName();
this
.crosstab1.NeedDataSource +=crosstab1_NeedDataSource;
}
///*--------------------------------------------------------------------------------------**/
/// <summary>
/// Report Name used for Display in the report and parameters name
/// </summary>
/// <returns></returns>
/// <author>Marcus.Kellermann</author> <date>07/2011</date>
/*==============+===============+===============+===============+===============+==========*/
public
string
GetReportName()
{
return
ReportingStrings.MonthlyPeakUsageReport;
}
///*--------------------------------------------------------------------------------------**/
/// <summary>
/// Creates the Report Configuration Object used to configure the reporting GUI
/// </summary>
/// <returns>Report Configuration</returns>
/// <author>Marcus.Kellermann</author> <date>07/2011</date>
/*==============+===============+===============+===============+===============+==========*/
public
ReportConfiguration GetReportConfiguration()
{
return
new
ReportConfiguration
{
ShowGeneralParametersTab=
true
,
ShowMachineParametersTab=
false
,
ShowUserParametersTab=
false
,
ShowVirtualSites =
false
,
ReportName = ReportingStrings.MonthlyPeakUsageReport,
ShowIncludeDetails =
false
,
ShowCAGOption =
false
};
}
/// /*------------------------------------------------------------------------------------------------------*/
/// <summary>
/// Handles the NeedDataSource event of the crosstab1 control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
/// <author>marcus.kellermann</author> <date>7/23/2013</date>
/// /*------------------------------------------------------------------------------------------------------*/
private
void
crosstab1_NeedDataSource(
object
sender, EventArgs e)
{
Telerik.Reporting.Processing.Table table = (Telerik.Reporting.Processing.Table)sender;
Telerik.Reporting.Processing.Report rpt = table.Report;
DateTime startDate = (DateTime)rpt.Parameters[ReportParameterNames.StartDate].Value;
DateTime endDate = (DateTime)rpt.Parameters[ReportParameterNames.EndDate].Value;
String userID = (String)rpt.Parameters[ReportParameterNames.UserID].Value;
string
reportID = (String)rpt.Parameters[ReportParameterNames.ReportID].Value;
Boolean includeWeekends = (
bool
)rpt.Parameters[ReportParameterNames.IncludeWeekends].Value;
//Jiao: Add UltimateID to ReportParameter
long
ultimateID =
long
.Parse ((
string
)rpt.Parameters[ReportParameterNames.UltimateID].Value);
var reportDataSet = Reports.MonthlyPeakUsage(startDate, endDate, userID,
new
Guid(reportID), includeWeekends, ultimateID);
ReportUtils.CheckReportSize(reportDataSet.MonthlyPeakUsage.Count());
table.DataSource = reportDataSet.MonthlyPeakUsage;
}
private
void
MonthlyPeakUsage_NeedDataSource(
object
sender, EventArgs e)
{
RPTLogger.Log.trace(
"In Report Need DataSource"
);
}