Writing Gantt valuies back to database

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
SpringerRider
Newbie
Newbie
Posts: 5
Joined: Fri Sep 28, 2007 12:00 am

Writing Gantt valuies back to database

Post by SpringerRider » Thu Feb 26, 2009 4:30 pm

I am using TdbChart and the Gantt Series. I am also using the Gantt Drag tool. Series data is a bound to a Datesource to a MS/SQL query. (TadoQuery)

The Gantts are on a time line. All the Gantts are in one series.

I want my user to be able to move/resize the Gantts interactively and have the values write back to the database. How do I do this?
Thanks

Delphi 2006 Win32
Tchart 8.02 VCL

Yeray
Site Admin
Site Admin
Posts: 9552
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Fri Feb 27, 2009 11:01 am

Hi SpringerRider,

I think you should use OnResizeBar and OnDragBar events to retrieve the new gantt values and do your sql queries. Here is how you could obtain the modified values in these events:

Code: Select all

procedure TForm1.ChartTool1DragBar(Sender: TGanttTool; GanttBar: Integer);
begin
  Chart1.Title.Text[0] := 'Bar Num: ' + inttostr(GanttBar) + '  StartValue: ' + FormatDateTime('c',Series1.StartValues[GanttBar]) + '  EndValue: ' + FormatDateTime('c', Series1.EndValues[GanttBar]);
end;

procedure TForm1.ChartTool1ResizeBar(Sender: TGanttTool; GanttBar: Integer;
  BarPart: TGanttToolBarPart);
begin
  Chart1.Title.Text[0] := 'Bar Num: ' + inttostr(GanttBar) + '  StartValue: ' + FormatDateTime('c', Series1.StartValues[GanttBar]) + '  EndValue: ' + FormatDateTime('c', Series1.EndValues[GanttBar]);
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

SpringerRider
Newbie
Newbie
Posts: 5
Joined: Fri Sep 28, 2007 12:00 am

Post by SpringerRider » Fri Feb 27, 2009 1:41 pm

Thanks Yeray,
That works

Post Reply