hi,
we're making a customized matrix box with as SourceTable Date. The horizontal rules displays the staff members and the matrix is filled with their tasks they have planned that day.
So far, so good, but what we want seems to be harder as we thought. When a staff members plans a task (eg TASK01 from 28/07/07 till 30/07/07), the matrix box only fills in the startdate. What we want, is that the period is filled with the taskname.
Is this possible?
This is what we have to fill in the startdate:
codAgenda := '';
idx := 0;
recAgenda.RESET;
recAgenda.SETCURRENTKEY(EmployeeID,TaskID,StartDateSub);
recAgenda.SETRANGE(StartDateSub,CurrForm.PlanMatrix.MatrixRec."Period Start");
recAgenda.SETRANGE(EmployeeID,ID);
IF recAgenda.FINDFIRST THEN BEGIN
recTask.SETRANGE(ID, recAgenda.TaskID);
IF recTask.FINDFIRST THEN BEGIN
FOR idx := recAgenda.EndDateSub - recAgenda.StartDateSub DOWNTO 0 DO BEGIN
codAgenda := recAgenda.TaskID;
END;
END
END;
Answers
If I understood right you have to change to sourceExpr in the left side (starting date?) and place a variable (for the tasks name) which you can get by the rec's starting date,ending date filters on the OnAfterGetRecord of the matrix.
Pargesoft
What I've got
Staff Member 01
Task 01 -> Stardate 28/07/07
-> EndDate 31/07/07
Matrix:
What i want:
Have you tried to filter starting date and ending date by setfilter and assign the value to codAgenda in that loop. Something like:
codAgenda := '';
idx := 0;
recAgenda.RESET;
recAgenda.SETCURRENTKEY(EmployeeID,TaskID,StartDateSub);
recAgenda.SETFILTER(StartDateSub,'>=%1',CurrForm.PlanMatrix.MatrixRec."Period Start");
recAgenda.SETFILTER(StartDateSub,'<=%1',CurrForm.PlanMatrix.MatrixRec."Period End");
recAgenda.SETRANGE(EmployeeID,ID);
IF recAgenda.FINDFIRST THEN BEGIN
REPEAT
codAgenda := recAgenda.TaskID;
UNTIL recAgenda.NEXT = 0;
END;
Pargesoft
So in the cell of the matrix, you need to put some code to get a value to show.
See http://www.mibuso.com/howtoinfo.asp?FileID=13 on how to do it.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I'm trying to find an answer on this, if you know an answer, let me know!
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Or isn't it that you mean?
IF recAgenda.EndDateSub +1 >= CurrForm.PlanMatrix.MatrixRec."Period End" THEN