It seems to me, this approach is not well supported in StimulSoft.
As far as I can see here
http://www.stimulsoft.com/en/videos?tag ... e=3&id=130
We shall
1) Point out the name of stored proc to be used
2) Create manually all the parameters for stored proc
3) Provide correct types for each parameter
4) Provide initial values for each parameter
5) Press button "Retrieve columns"
Ignoring steps 3) and 4) leads to criptic exceptions on step 5), like this "Can not convert nvarchar to bigint" without any explanation - what user can do. This is because Stimulsoft tries to call your stored proc with "null" parameters, but it is not always possible
From my point of view, steps 2-4 are annoing - it seems to me, there are ways to automate those steps. At least Microsoft's ReportBuilder is able to retrieve stored proc's parameters automatically (with types) and bounds all stored proc's parameters to report's parameters (variables in Stimulsoft)
At the moment, I'm still unable to retrieve columns from such a stored procedure:
Code: Select all
ALTER PROCEDURE [dbo].[FixNisReport]
@ID_Task bigint
, @DataType int = 1
as
begin
if object_id( 'tempdb.dbo.#PointMeter' ) is not null
drop table dbo.#PointMeter
create table dbo.#PointMeter
( ID_Point int not null primary key )
insert into dbo.#PointMeter ( ID_Point ) VALUES (8)
select @ID_Task as TaskId, @DataType as TypeId
union
select @ID_Task + 1 as TaskId, @DataType +1 as TypeId
end
GO
Code: Select all
exec sp_executesql N' SET FMTONLY OFF; SET FMTONLY ON;execute FixNisReport @ID_Task, @DataType',N'@ID_Task nvarchar(1),@DataType nvarchar(1)',@ID_Task=N'2',@DataType=N'1'
"Msg 208, Level 16, State 0, Procedure FixNisReport, Line 11
Invalid object name '#PointMeter'."
So, I filled the list of columns by hands - VERY annoyng task, my SP returns about 20 columns.
When I try to run a report, I have an exception "Could not find stored procedure 'execute FixNisReport @ID_Task, @DataType'" The only way I've made report to show data, I changed "Query Text" to just name of stored proc: "FixNisReport" (without "execute" and parameters names). Shouldn't demo video be modified to reflect this fact?
In this case, reports works, but I'm still unable to retrieve column names automatically