DROP PROCEDURE IF EXISTS sp_DBR_DealerReport
$$
CREATE PROCEDURE `sp_DBR_DealerReport`()
BEGIN
select 'dbr.headerstyle', 'background-color: blue; color: white';
select 'dbr.css', 'tr.odd td { background: #cae1ff; color: black}';
select 'dbr.css', '.blueresult td { background: lightblue; color: black}';
select 'dbr.resultclass', 'tr.odd';
SELECT 'dbr.rownum' as 'Row number',dealers.name, programs.name, contracts.effective_date, contracts.program_name, contracts.agreement_number, contracts.vehicle_make, contracts.vehicle_model, contracts.vin, contracts.transmit_date, contracts.vehicle_mileage
from tripac.contracts, tripac.dealers, tripac.programs
where contracts.dealer_id = dealers.id and contracts.program_id = programs.id
group by dealers.name, programs.name, contracts.effective_date, contracts.program_name, contracts.agreement_number, contracts.vehicle_make, contracts.vehicle_model, contracts.vin, contracts.transmit_date, contracts.vehicle_mileage;
END
$$