I using stored procedure in my report..but why i did't find any field in it??
so i can't create report table without field in dataset(stored procedure)
We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.
I already use refresh field but doesn't work,there isn't field in data set..
My store procedure like :
STORE PROCEDURE [dbo].[sp_cast]
@userid char(50),
@cpny char(3),
@PBegin datetime,
@PEnd datetime,
@jenis char(10)
AS
BEGIN
sets from
SET NOCOUNT ON;
DECLARE @jmlRequest int,
@bln char(2),
@thn char(4),
@jns char(10),
@jab char(50)
DECLARE BR cursor for
select sum(jmlrequest), month(wktpelaksanaan),year(wktPelaksanaan),jns,kdjab
from BRBArequest
where jns=@jenis and wktpelaksanaan between @PBegin and @PEnd
group by jns, month(wktpelaksanaan),year(wktPelaksanaan),kdjab
OPEN BR
FETCH NEXT FROM BR INTO @jmlRequest, @bln, @thn, @jns, @jab
WHILE (@@FETCH_STATUS = 0)
BEGIN
update BRBATempRealisasiDet setJmlReq=@jmlRequest
where KdBR=@jns and userid=@userid and CompanyID=@cpny and Bln=@bln and Thn=@thn
DECLARE @jmlBAAdjst int,
@test varchar(250)
DECLARE BA cursor for
select (sum(CtrlTot)-sum(CtrlTotAdjst)) as Expr1 from BRBARealisasi A
inner join BRBARequest B on A.BatchNo=B.BatchNo and month(B.wktpelaksanaan)=@bln and year(B.wktpelaksanaan)=@thn and B.jns=@jns
OPEN BA
FETCH NEXT FROM BA INTO @jmlBAAdjst
WHILE (@@FETCH_STATUS = 0)
BEGIN
update BRBATempRealisasiDet set JmlBA= @jmlBAAdjst
where userid=@userid and CompanyID= @cpny and KdBR= @jns
and bln= @bln and thn= @thn
FETCH NEXT FROM BA INTO @jmlBAAdjst
END
CLOSE BA
DEALLOCATE BA
FETCH NEXT FROM BR INTO @jmlRequest, @bln, @thn, @jns, @jab
END
CLOSE BR
DEALLOCATE BR
update BRBATempRealisasiDet set JmlReq='0', JmlBA='0'
where JmlReq is null and JmlBa is null
update BRBATempRealisasiDet set JmlBudget='0'
where JmlBudget is null
Please provide the actual tetx that you are suing to call the SP
Rgds, Geoff
We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.
because yoy set the no count on the last teransaction only will be returned by the stored procedure which is an update, you might be able to see stuff in SQL but reporting needs a dataset to work with,
add a select statement as the last statement of the stored proc to return whatever data it is that you need
-Mo
If you don't stand for something, you'll fall for anything
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.