TMDFNCPlanner with Postgresql query :

Hello everyone,

I am desperately trying to map a Postgresql query to the planner adapter. But I can't display the default elements of the table.
The query is a filtered table configured like this:

CREATE TABLE IF NOT EXISTS public.larcauth_edt_classe
(
id character varying(13) NOT NULL,
ressource_dow character varying(5) default ' ',
title character varying(255) default ' ' ,
text character varying(255) default ' ',
starttime timestamp without time zone,
endtime timestamp without time zone,
recurrency character varying(255) ,
color smallint default 0,
ref_term smallint,
ref_classroom integer,
CONSTRAINT larcauth_edt_classe_pkey PRIMARY KEY (id)
)
My idea is to break down a day into 30-minute periods. Everything is configured in advance for one week. The interface is designed to modify the 30-minute events that already exist for each day: it cannot create or delete any. At the end of this configuration, which I haven't managed to finalize, the software is supposed to create a real schedule taking into account real dates and public holidays or other events implemented in other calendars.
Some recordings of the request.

123

The schedule is set to pmDay. I use the resources to display the events of each day from Monday (0) to Saturday (6) without worrying about the real dates.
I've also tried to fill a dataset from the SQL query, using the planner and database example delivered with the UI pack, without success: I'm missing something. I've come to ask for your help.

Thank you for your help.

Can you show us the code you are using to load the planner / activate the dataset?

Hello,

Here is the configuration in the form creation procedure :
I activate the dataset in the form show procedure.
When I launch it, it does not stop running and the form is not showing.

// classroom planner configuration
PlannerClasse.BeginUpdate;
// today is thre reference day
PlannerClasse.ModeSettings.StartTime := int(Now) + EncodeTime(3,0,0,0);;
PlannerClasse.ModeSettings.EndTime := int(Now) + EncodeTime(21,0,0,0);
// Planner mode : pmday with resources
PlannerClasse.Mode := pmDay;
// update interaction : dialog
PlannerClasse.Interaction.UpdateMode := pumDialog;
PlannerClasse.Interaction.TopNavigationButtons := ;
// No insert Mode
PlannerClasse.Interaction.MouseInsertMode := pmimNone ;
// No delete Mode
PlannerClasse.Interaction.MouseInsertMode := pmimNone ;
PlannerClasse.Interaction.KeyboardInsertMode := pkimNone;
// Default item presentation
PlannerClasse.DefaultItem.FontColor := gcBlack;
PlannerClasse.DefaultItem.TitleFontColor := gcWhite;
// Timeline configuration
PlannerClasse.TimeLine.DisplayUnit := 30;
PlannerClasse.TimeLine.DisplayUnitSize := 40;
PlannerClasse.TimeLine.DisplayUnitFormat := 'hh'; // Heures
PlannerClasse.TimeLine.DisplaySubUnitFormat := 'nn'; // Minutes
PlannerClasse.TimeLine.DisplayStart := 14;
PlannerClasse.TimeLine.DisplayEnd := 36;
PlannerClasse.TimeLine.ActiveStart := 15;
PlannerClasse.TimeLine.ActiveEnd := 35;
PlannerClasse.TimeLineAppearance.LeftSize := 100;
PlannerClasse.PositionsAppearance.TopSize := 60;
PlannerClasse.PositionsAppearance.TopFont.Size := 18;
PlannerClasse.Positions.Count := 6;
PlannerClasse.ItemEditor := TMSFNCPlannerItemEditorRecurrency1;
PlannerClasse.Adapter := PlannerDatabaseAdapter;
PlannerClasse.PositionsAppearance.TopFont.Size := 18;
PlannerClasse.EndUpdate;

// configuration des liens sur la base de données
PlannerDatabaseAdapter.Active := False;
PlannerDatabaseAdapter.Item.AutoIncrementDBKey := False;
// DSedt is the datasource of the query showed below
** PlannerDatabaseAdapter.Item.DataSource := DSEdt ;**
PlannerDatabaseAdapter.Item.DBKey := 'id';
PlannerDatabaseAdapter.Item.StartTime := 'starttime';
PlannerDatabaseAdapter.Item.EndTime := 'endtime';
PlannerDatabaseAdapter.Item.Title := 'title';
PlannerDatabaseAdapter.Item.Text := 'title';
PlannerDatabaseAdapter.Item.Resource := 'ressource_dow';
PlannerDatabaseAdapter.Item.Recurrency := 'recurrency';
// Activation
PlannerDatabaseAdapter.Active := True;

Regards.

Can you remove the recurrency and see if that helps?

Thank you for your help !
You are right. I've got something now. I will try to check the other parameters because :

  • the planner show me doubled events. Normally I should have 22 per day.
  • There are no title or text
  • Sometimes there are events where i should not fin 30min periods like before 7h00 and after 16h30.
  • It seems that the planner is locked. I can't click on it or select periods.
    It looks like that :

Regards

Hello all,

The others problems I met are quite solved, not linked to the first one.

  • The Planner shows me doubled events. Normally, I should have 22 per day. Solved ( The query has been checked and modified.)
  • There's no title or text! Solved (increase TimeLine.DisplayUnitSize with TimeLineAppearance to false)
  • Sometimes there are events for which I shouldn't have 30-minute periods, like before 7:00 am and after 4:30 pm. Solved ( Request has been checked and modified.)
  • The scheduler seems to be locked. I can't click on it or select periods (in progress).

Thank you very much for unblocking me. Post solved.

Regards

Thanks for the feedback!