Hi
I've created a simple crosstab report and what I'm trying to do is to allow the user to click in any of the blank data cells and it then shades that cell in green and writes a value from one of the cells in the stub.
I've got this working up to the point of where I need to insert values into a table. I'm not sure how I go about this.
select 'dbr.javascript'," $(document).ready(function() { $('table.prodruns td.cell.align_r.ct_set_start_one').click(function () { var value = $(this).html(); if (value == '') { var cell = $(this),
state = cell.data('state') || 'first'; switch (state) {
case 'first':
cell.addClass('bggreen');
cell.data('state', 'second');
break;
case 'second':
cell.removeClass('bggreen');
cell.data('state', 'first');
break;
default:
break;
} // add to do value to the clicked cell var column_num = parseInt( $(this).index() ) + 1; var A = col_value_get( this, 'todo' ); col_value_set( this,column_num, 0, A); }
}); }); ";
I have a stored procedure to do the insert but it requires 3 values - the orderid, date, and quantity.
The crosstab is as follows:
select 'dbr.hidecolumn','OID';
select 'dbr.crosstab','pWeek';
select 'dbr.hdr','Line';
select 'dbr.lockcolumns','dReq';
select 'dbr.resultclass','prodruns';
select 'dbr.colstyle','ICode','[min-width:70px;max-width: 70px;white-space:nowrap;overflow:hidden;text-overflow: ellipsis;]';
select 'dbr.colstyle','IDesc','[text-align:center;min-width:250px;max-width:250px;white-space:nowrap;overflow:hidden;text-overflow: ellipsis;]';
select 'dbr.colstyle','Cust','[min-width:120px;max-width:120px;white-space:nowrap;overflow:hidden;text-overflow: ellipsis;]';
select 'dbr.colstyle','CustCon','[min-width:120px;max-width:120px;white-space:nowrap;overflow:hidden;text-overflow: ellipsis;]';
select 'dbr.colstyle','Notes','[min-width:250px;max-width:250px;white-space:nowrap;overflow:hidden;text-overflow: ellipsis;]';
select 'dbr.colstyle','oQTY','%0.0f';
select 'dbr.colstyle','mQTY','%0.0f';
select 'dbr.colstyle','dQTY','%0.0f';
select 'dbr.colstyle','pQTY','[border-left:1px solid #CCC;]%0.0f;[text-align:right;min-width:50px;border-left:1px solid #CCC;] ;';
select 'dbr.colclass','dQTY','todo';
select 'dbr.colclass','pQTY','wqty'; select a.OrderID as "Order ID[OID]",
a.Line as "Line[Line]",
a.Priority as "Priority[Prior]",
a.ItemCode as "Item Code[ICode]",
c.`Item Description` as "Description[IDesc]",
a.`Order` as "FPO[oFPO]",
d.CustName as "Customer[Cust]",
a.CustCon as "Cust.Control[CustCon]",
a.CustOrder as "Cust.Order[COrder]",
a.QtyOrdered as "Qty.Ord[oQTY]",
a.Qtyout as "Made Qty[mQTY]",
a.QtyOrdered-a.Qtyout as "To Made[dQTY]",
date(a.Reqd) as "Required[dReq]",
a.AddNotes as "Notes[Notes]",
date_format(b.pdate,"%d/%m/%Y") as "Week[pWeek]",
b.pQty as "Prod.Qty[pQTY]"
from schedule a
join p_forecast b on a.OrderID=b.oid
join `item master` c on a.ItemCode=c.`item code`
join customer d on c.`Customer ID`=d.`Customer Code`
where a.Complete="N" order by a.Line,a.Priority,b.pdate;
I can get (I hope) the orderid and cell value but I don't know how to get the date in an easy way.
Hope you follow that.
Cheers
Jake