Here's what I've got so far:
Master report:
IF object_id('sp_DBR_TrackingV1','P') IS NOT NULL
DROP PROCEDURE [sp_DBR_TrackingV1]
GO
CREATE PROCEDURE sp_DBR_TrackingV1 @StartDate date, @EndDate date
AS
BEGIN
select 'dbr.report', 'sp_DBR_TrackingComments','TranID=1';
SELECT A.TranID, b.ReceiverName, A.ServiceDate, A.ServiceCode, A.ServiceAmt
FROM mydbr_Data..Detail as A
JOIN mydbr_Data..Transaction As B ON
A.TranID = B.TranID
WHERE A.ServiceDate between @StartDate and @EndDAte
ORDER BY A.ServiceAmt DESC;
END
GO
So the master can call the following detail report "TrackingComments":
IF object_id('sp_DBR_TrackingComments','P') IS NOT NULL
DROP PROCEDURE [sp_DBR_TrackingComments]
GO
CREATE PROCEDURE sp_DBR_TrackingComments @TranID varchar(50)
AS
BEGIN
select 'dbr.report', 'sp_DBR_CommentsCreate', 'popup', 'TranID=1';
select 'dbr.button', 'New Comment';
select h.TranID as 'TranID',
h.UserID as 'UserID',
h.CommentDate as 'Date',
h.Comment as 'Comment'
from mydbr_Data..Tracking as h
where h.TranID = @TranID
END
GO
So the final step is to put in a "Create Comment" report:
IF object_id('sp_DBR_CommentsCreate','P') IS NOT NULL
DROP PROCEDURE [sp_DBR_CommentsCreate]
GO
CREATE PROCEDURE sp_DBR_CommentsCreate @inLogin varchar(30), @Comment varchar(500), @TranID varchar(50)
AS
BEGIN
INSERT INTO mydbr_Data..Tracking (UserID, CommentDate, Comment, TranID)
VALUES (@inLogin,CURRENT_TIMESTAMP,@Comment,@TranID);
select 'dbr.refresh', 0;
END
GO
But this doesn't work. The Tracking Comments report only displays the 'New Comment' button (no row result set at all). When 'New Comment' is clicked a popup window appears and it will let me enter a comment, but it never gets saved back to the database.
What am I missing?
Thanks,
-nth-