This is a migrated thread and some comments may be shown as answers.

Reporting WCF Self Hosting Service

9 Answers 66 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Shankar
Top achievements
Rank 1
Shankar asked on 23 Jul 2015, 01:34 PM
Hi,
I have a telerik reporting WCF self host service to show the report with silverlight report viewer. I noticed that the WCF function fire twice when I run the report.
can anyone tell me the cause.

Thanks in advance
Chandan

9 Answers, 1 is accepted

Sort by
0
Shankar
Top achievements
Rank 1
answered on 28 Jul 2015, 08:26 AM

can anyone help me to short out my problem (Reporting WCF function firing twice.).

Thanks

Chandan

0
Stef
Telerik team
answered on 28 Jul 2015, 09:46 AM
Hello 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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Chandan Dey
Top achievements
Rank 1
answered on 30 Jul 2015, 09:45 AM

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

0
Stef
Telerik team
answered on 03 Aug 2015, 01:36 PM
Hello 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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Chandan Dey
Top achievements
Rank 1
answered on 03 Aug 2015, 02:48 PM

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​

 

0
Chandan Dey
Top achievements
Rank 1
answered on 20 Aug 2015, 08:28 AM

can anyone help me to short out this problem.

thanks

Chandan

0
Stef
Telerik team
answered on 24 Aug 2015, 01:04 PM
Hi 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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Chandan Dey
Top achievements
Rank 1
answered on 27 Aug 2015, 09:18 AM

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

0
Stef
Telerik team
answered on 28 Aug 2015, 04:08 PM
Hello 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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Shankar
Top achievements
Rank 1
Answers by
Shankar
Top achievements
Rank 1
Stef
Telerik team
Chandan Dey
Top achievements
Rank 1
Share this question
or