9 Answers, 1 is accepted
can anyone help me to short out my problem (Reporting WCF function firing twice.).
Thanks
Chandan
In case you are using a custom report resolver for the Reporting WCF service, note that the resolver is called on each interaction with the report in the viewer - on initial loading, changing parameters, exporting, printing, refreshing and etc.
If I have misunderstood the question, please elaborate on the scenario.
Regards,
Stef
Telerik
Hi Stef,
Thanks for your reply.
The reply is not very clear to me. If a custom report resolver (in my app) called on each intraction with report viewer (on init loading, changing param, export, report refresh etc) then how can I stop this. May be in my cash when I click Get result button the Init loading is called and changing param called thats why my WCF service method call twice. In my report I am working with 1000000 data it will take 30 min. to process. If I able to stop twice call may be time will decrease 15/20 min. for the report generation.
thanks
Chandan
This is the designed behavior as the report must be resolved with the newly passed details (parameters, export format, etc.). If you are using a custom resolver where you are performing some time and memory consuming operations, consider caching the already retrieved data for further use.
Regards,
Stef
Telerik
Hi Stef,
Thanks for reply.
In my report I use telerik report viewer in my Silverlight page with Start date & end date and when Click on Get Result button. the call goes like
repViewer = new ControlsLib.SummaryReportTemplate();
repViewer.ExportOption = "pdf";
repViewer.repViewer.RenderBegin += new RenderBeginEventHandler(repViewer_RenderBegin);
repViewer.repViewer.ReportServiceUri = new Uri(App.p_ReportEndPoint);
repViewer.repViewer.Report = "DhaaniReportWCF.SummaryReportByGroup, DhaaniReportWCF";
grdChart.Children.Add(repViewer);repViewer = new ControlsLib.SummaryReportTemplate();
repViewer.ExportOption = "pdf";
repViewer.repViewer.RenderBegin += new RenderBeginEventHandler(repViewer_RenderBegin);
repViewer.repViewer.ReportServiceUri = new Uri(App.p_ReportEndPoint);/reportservice"
}
else if (cmbReport.SelectedItem.ToString() == ENERGY_SAVINGS_REPORT_BY_GROUP)
{
repViewer.repViewer.Report = "DhaaniReportWCF.SummaryReportByGroup, DhaaniReportWCF";
}
grdChart.Children.Add(repViewer);​
***********
void repViewer_RenderBegin(object sender, RenderBeginEventArgs args)
{
int intDaysOfMonth = DateTime.DaysInMonth(m_EndDateForResult.Year, m_EndDateForResult.Month);
DateTime dtEndDateStart = new DateTime(m_EndDateForResult.Year, m_EndDateForResult.Month, 1, m_EndDateForResult.Hour, m_EndDateForResult.Minute, m_EndDateForResult.Second);
DateTime dtCalculatedStartTime = DateTime.MinValue;
//if (cmbCumulativeConsumption.SelectedItem.ToString() == LAST3MONTHS_CONSUMPTION)
//{
// p_DTStart = new DateTime(m_EndDateForResult.AddMonths(-2).Year, m_EndDateForResult.AddMonths(-2).Month, 1, m_EndDateForResult.AddMonths(-2).Hour, m_EndDateForResult.AddMonths(-2).Minute, m_EndDateForResult.AddMonths(-2).Second);
//}
//else if (cmbCumulativeConsumption.SelectedItem.ToString() == LAST12MONTHS_CONSUMPTION)
//{
// p_DTStart = new DateTime(m_EndDateForResult.AddMonths(-11).Year, m_EndDateForResult.AddMonths(-11).Month, 1, m_EndDateForResult.AddMonths(-11).Hour, m_EndDateForResult.AddMonths(-11).Minute, m_EndDateForResult.AddMonths(-11).Second);
//}
args.ParameterValues["pcs"] = machines.TrimEnd(',');
args.ParameterValues["startTime"] = p_DTStart;
args.ParameterValues["endTime"] = m_EndDateForResult;
args.ParameterValues["dHours"] = m_Hours;
args.ParameterValues["isCustom"] = isCustom;
args.ParameterValues["dblDuration"] = dblDuration;
//progIndicator.Stop();
}
when I see in my wcf the methods call twice....I want stop 2nd call...... how....
thanks
Chandan​
can anyone help me to short out this problem.
thanks
Chandan
Test if subscribing for the RenderBegin event only once and setting the viewer's Report property only once, results in firing the RenderBegin event properly (just once).
You will have to debug the application to check how many times the viewers' properties are set. Check also if using the latest Telerik Reporting Q2 2015 Sp1 version results in the same issue (note that the RenderBegin event is replaced by ApplyParameters event).
Regards,
Stef
Telerik
Hi Stef,
Thanks for your reply.
I checked the RenderBegin event call only once and the viewer's Report property only once but still the method (objectdatasource) for generation data in report called twice or sometime thrice.
Now I just changed in my implementation from objectdatasource to Report NeedDataSource it solved my problem. But I am still in curiosity about 2/3 times method call with objectdatasource problem.
Thanks
Chandan
The method wrapped by the ObjectDataSource method can be executed more than once if the same data source component is used by multiple data items in the report, or one data item placed within another data item e.g. Table in Detail section.
Regards,
Stef
Telerik