My first attempt at editing a report, seems simple enough but record is not updated.
It does work when I run the update report and supply the values at the parameter selection screen.
It does not work when editing report.
In Editable Report:
-Dropdown works
-Value selected shows in cell
-When I refresh the report the data reverts to original value.
Note: i only require one value in the select for the drop down, but even changing it to 2 so i include an id column doesn't help.
Report code for update procedure
DROP PROCEDURE IF EXISTS sp_DBR_update_customername
$$
CREATE PROCEDURE sp_DBR_update_customername(
incustomername varchar(255),
inID int
)
BEGIN /* Check the data */
#if (inValue>0) then
/* Accept the update, no need to return a value */
update test.projects1
set CustomerName = incustomername
where ID=inID;
#else
/* Reject the update, return the original value */
# select budget
# from film_budget
# where category_id=inCategory and payment_week=inWeek;
#end if; END
$$ END
Editable Report Code
DROP PROCEDURE IF EXISTS sp_DBR17
$$
CREATE PROCEDURE sp_DBR17(project_name_in varchar (15))
BEGIN
-- Hide ID
select 'dbr.hidecolumn', 'ID';
-- Show category as a selectlist
select 'dbr.editable', '[CustomerName]', 'sp_DBR_update_customername', 'inID=ID', 'incustomername=CustomerName', 'type=select', "select=select distinct
test.projects1.CustomerName AS CustomerName2
from
test.projects1
order by test.projects1.CustomerName";
select 'dbr.colstyle', 'ID', mydbr_style('noformating');
select 'dbr.colstyle', 'NetworkNumber', mydbr_style('noformating'); select
p.ID as 'ID',
p.ProjectNumber as 'ProjectNumber',
p.CustomerName as 'CustomerName',
p.NetworkNumber as 'NetworkNumber'
from test.projects1 p
WHERE
p.ProjectNumber = project_name_in; -- Hide ID
select 'dbr.hidecolumn', 'ID';
-- Show category as a selectlist select
p.ID as 'ID',
date(p.Customer Quote Due Date )as 'Customer Quote Due',
date(p.Customer Start Date) as 'Customer Start',
date(p.Customer Completion Date )as 'Customer Completion',
date(p.Awarded Date )as 'Awarded',
date(p.Prefield Done Date )as 'Prefield Done',
date(p.Take off Completed Date) as 'Take Off Completed',
date(p.BOM Completed Date )as 'BOM Completed',
date(p.Construction Completed Date )as 'Construction Completed',
date(p.Asbuilts submitted date) as 'Asbuilts Submitted',
date(p.Project Complete Date) as 'Project Complete'
from test.projects1 p
WHERE
p.ProjectNumber = project_name_in; END
$$