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

Kendo Reporting's calling stored procedure multiple times

2 Answers 188 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kamal
Top achievements
Rank 1
Kamal asked on 10 Sep 2018, 06:07 AM

I am using kendo reporting v 11.x. and MS SQL Server 2016.

Firstly, I created a stored procedure that returns a list of person.

Then, I created a simple blank kendo report using visual studio 2017.

Inside the report, I then created a from the kendo reporting toolbox.

Lastly, I selected the stored procedure and dragged a table using the toolbox and then I opened data explorer dragged the field names from the data source.

Please take a look at the attached files. 

the design tab as shown in the picture my procedure is called multiple times. I verified this by writing an insert query on my procedure. , I click the design time, I could see the data getting inserted multiple times

My procedure:

Alter PROCEDURE SpPersonSel

AS
BEGIN

SET NOCOUNT ON;

INSERT INTO .Test
    (
        [Name]
    )
    VALUES
    (
        'abc'  -- Name - varchar(50)
    )
   SELECT p.* FROM dbo.Person AS p
END
GO

 

2 Answers, 1 is accepted

Sort by
0
Kamal
Top achievements
Rank 1
answered on 10 Sep 2018, 06:22 AM
I meant the preview tab, not the design tab
0
Todor
Telerik team
answered on 12 Sep 2018, 10:49 AM
Hello Kamal,

Each SqlDataSource query/stored procedure will be executed once per rendering for each data item it is assigned to.

I suspect that you have assigned the corresponding SqlDataSource to the Report, and to the Table.
If so, the stored procedure will be called once for the Report. Then, one Detail section will be generated for each data record returned by the Report DataSource (i.e. if the stored procedure returns 5 records there will be 5 Detail sections in the rendered report). As seen from the screenshots, the Table is inside the Detail section, hence the Table will be rendered 5 times. Therefore, the query of the Table DataSource will be called 5 times.
In the described scenario the same Table should be rendered multiple (5 in the context of my example) times inside the report.
The issue should disappear upon removing the DataSource of the Report.

If my assumptions are not correct you can open a support ticket and send us a runnable report (i.e. including backup of the database) for local investigation.

Regards,
Todor
Progress 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
Kamal
Top achievements
Rank 1
Answers by
Kamal
Top achievements
Rank 1
Todor
Telerik team
Share this question
or