This is probably quite simply but I can't find out how in the documentation or forums
I have an editable report as a list where the last column is editable (a character field). Under this I have two crosstabs, one for the overall totals from the list and one for the totals of those records which have been 'ticked off' in the character field.
It all displays fine at the start, but when I edit the character field the 'ticked off' crosstab doesn't update. I have set up the report in one file - code below. Is this the right way to do it? Should the crosstabs be separate procedures and therefore calls? If so, how do I keep them in the design?
Any help greatly appreciated as I'm new to myDBR.
Cheers,
David
DROP PROCEDURE IF EXISTS sp_DBR_Cashbatch
$$
CREATE PROCEDURE sp_DBR_Cashbatch
()
BEGIN
/* select 'dbr.report', 'sp_DBR_editbatchno'; */
select 'dbr.embed_object','shared_embed';
select 'dbr.editable', 'Batch Ref', 'sp_DBR_editbatchno', 'inOrderID=Order ID', 'inDate=Date', "Options={'callback':autosum_float}";
select 'dbr.sum',3,4;
select d.OrderID as 'Order ID',
d.PmtDateTime as 'Date',
sum(d.PmtAmount) as 'Amount',
sum(d.PmtCardCharge) as 'Card Charges',
d.PmtDescription as 'Description',
d.PmtType as 'Type',
d.T28Auth as 'Authorisation',
d.PmtBatch as 'Batch Ref'
from dt_travel.dt_payment d
group by d.OrderID, d.PmtDateTime, d.PmtDescription, d.PmtType, d.T28Auth, d.PmtBatch;
select 'dbr.crosstab', 'Type';
select 'dbr.subtitle', 'Current Batched Totals';
/* select 'dbr.sum', 'Amount','Card Charges', 'Overall'; */
select d.PmtType as 'Type',
sum(d.PmtAmount) as 'Amount',
sum(d.PmtCardCharge) as 'Card Charges',
sum(d.PmtAmount+d.PmtCardCharge) as 'Overall',
count(d.PmtAmount) as 'No of Items'
from dt_travel.dt_payment d where d.pmtBatch is not null
group by d.PmtType;
select 'dbr.crosstab', 'Type';
select 'dbr.subtitle', 'Overall Batch Totals';
/* select 'dbr.sum', 'Amount','Card Charges', 'Overall'; */
select d.PmtType as 'Type',
sum(d.PmtAmount) as 'Amount',
sum(d.PmtCardCharge) as 'Card Charges',
sum(d.PmtAmount+d.PmtCardCharge) as 'Overall',
count(d.PmtAmount) as 'No of Items'
from dt_travel.dt_payment d
group by d.PmtType;
END
$$