TDBPlanner random all white

Hello devs,


We have an app with a planning, for which we use a TDBPlanner component. Sometimes, it randomly becomes all white (all free), about 5-10 times in a day.

I try to fix this problem for months now, and tried a lot of things, without any effect. Someone had something similar ?

The first thing to check is:
1) is the dataset you connect to NOT empty?
2) are there for the displayed date range in the Planner events that match this timespan in the dataset?


You can monitor this with the event DBxxxSource.OnFieldsToItem. This event should be triggered for every matching record found in the dataset.

Thank you for your quick answer.


When the problem appears there is items on the planning, so the dataset isn't empty. The issue is that schedules are all white, like if all employees works all the day. I just tried with an empty dataset, schedules are showing correctly.

For the second question, items are shown, so they match with the planner.

I would need to know more details about what Planner mode you use, what the item start & end time are when it goes wrong, if you use DBxxSource.OnFieldsToItem, if you use somewhere in your code  PlannerItem.InHeader: boolean ...?

I can't put pictures in my message, I send you an email.

For answering other questions, I use dmMultiResDay planner mode, items start/end are OK because they are correctly displayed, I use DBxxSource.OnFieldsToItem as well as PlannerItem.InHeader.

Code in DBxxSource.OnFieldsToItem (I set to empty some string values because of confidentiality) :
///////////////////////////////////////////////////////
Planner.DisableAlign;

  If (VACcodsoc = '') and (Fields.Fieldbyname('').asstring = '') then
    Item.CaptionFont.Style := [fsBold];

  If length(trim(Fields.Fieldbyname('').asstring))>0 then
    Item.ColorTo:=stringtocolor(Fields.Fieldbyname('').asstring);

  If length(trim(Fields.Fieldbyname('').asstring))>0 then
    Item.ImageID := 0
  else
    Item.ImageID := -1;

  If substr(Fields.Fieldbyname('').asstring,1,3)='' then
  Begin
    With item do
    Begin
      captiontype:=ctnone;
      background:=true;
      allowoverlap:=true;
      color:=stringtocolor(VGCcoljf);
    End;
  End;

  If substr(Fields.Fieldbyname('').asstring,1,3)='' then
  Begin
    With item do
    Begin
      ImageID := -1;
      captiontype:=ctnone;
      background:=true;
      allowoverlap:=true;
      alignment:=tacenter;
      color:=stringtocolor(VGCcolre);
    End;
  End;

  If substr(Fields.Fieldbyname('').asstring,1,3)='' then
  Begin
    With item do
    Begin
      inheader:=true;
      background:=true;
      color:=stringtocolor(VGCcolpi);
    End;
  End;

  Planner.EnableAlign;
///////////////////////////////////////////////////////

More informations, PositionProps are OK (I logged them), and the issue only appears when only one day is shown.


It is the InHeader property that determines whether it is displayed as an all-day event in the header or not. So,please verify in your OnFieldsToItem event handler whether InHeader is always set as expected.

There is always items displayed in the header, as you can see in screenshots that I sent you, and this is not the problem. The issue is that schedules are all white, like if employees are working all day (from 7am to 8:30pm in this case), which is false.


However, I tried to put all items in the header, shcedules are displayed correctly.

For items that were displayed as going from 7am to 8h30pm, what is the event starttime & endtime in the dataset and what is the setup of the time axis?

I'm not sure of what you want but this is an example :

- Time axis : 1 day, 3 ressources, 7:00 am - 8:30 pm
- An item : starttime 6, endtime 36

When starttime = 6 and endtime = 36, the item should be displayed from timeslot 6 to timeslot 36.

If this isn't the case, we'll need something to reproduce.

Items are always all displayed correctly, even when the bug appears.

I'm sorry but I don't understand it. You say "it is displayed correct and there is a bug", I cannot understand what the bug is then.

Please isolate this and prepare a sample source project + exact steps with which we can reproduce this here.


Like I said the problem is about schedules (the background), not items. You can see it very well on screenshots that I sent to you, the item is always correctly displayed, but not schedules (the background) which are all white.


The problem looks to be random, I'm not able to reproduce it, so I can't do a sample source project.

The background of what? The item itself? The timeslot? Background of something else?
Please follow up via email with EXACT & FULL information.

I'm talking about the time axis (sorry if my words aren't precise, I'm not english native).

I asked to followup with FULL details via email. This thread is closed.