Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

TDBPlanner random all white

 Post Reply Post Reply
Author
Mathieu View Drop Down
New Member
New Member
Avatar

Joined: 17 Oct 2019
Posts: 36
Post Options Post Options   Quote Mathieu Quote  Post ReplyReply Direct Link To This Post Topic: TDBPlanner random all white
    Posted: 12 Nov 2019 at 2:48pm
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 ?
Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 8326
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 12 Nov 2019 at 3:05pm
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.
Back to Top
Mathieu View Drop Down
New Member
New Member
Avatar

Joined: 17 Oct 2019
Posts: 36
Post Options Post Options   Quote Mathieu Quote  Post ReplyReply Direct Link To This Post Posted: 12 Nov 2019 at 3:32pm
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.
Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 8326
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 12 Nov 2019 at 3:35pm
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 ...?
Back to Top
Mathieu View Drop Down
New Member
New Member
Avatar

Joined: 17 Oct 2019
Posts: 36
Post Options Post Options   Quote Mathieu Quote  Post ReplyReply Direct Link To This Post Posted: 12 Nov 2019 at 3:50pm
I can't put pictures in my message, I send you an email.
Back to Top
Mathieu View Drop Down
New Member
New Member
Avatar

Joined: 17 Oct 2019
Posts: 36
Post Options Post Options   Quote Mathieu Quote  Post ReplyReply Direct Link To This Post Posted: 12 Nov 2019 at 4:04pm
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.


Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 8326
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 12 Nov 2019 at 4:07pm
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.
Back to Top
Mathieu View Drop Down
New Member
New Member
Avatar

Joined: 17 Oct 2019
Posts: 36
Post Options Post Options   Quote Mathieu Quote  Post ReplyReply Direct Link To This Post Posted: 12 Nov 2019 at 4:19pm
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.
Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 8326
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 12 Nov 2019 at 8:32pm
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?
Back to Top
Mathieu View Drop Down
New Member
New Member
Avatar

Joined: 17 Oct 2019
Posts: 36
Post Options Post Options   Quote Mathieu Quote  Post ReplyReply Direct Link To This Post Posted: 13 Nov 2019 at 2:47pm
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
Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 8326
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 13 Nov 2019 at 2:49pm
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.
Back to Top
Mathieu View Drop Down
New Member
New Member
Avatar

Joined: 17 Oct 2019
Posts: 36
Post Options Post Options   Quote Mathieu Quote  Post ReplyReply Direct Link To This Post Posted: 13 Nov 2019 at 3:01pm
Items are always all displayed correctly, even when the bug appears.
Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 8326
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 13 Nov 2019 at 3:13pm
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.

Back to Top
Mathieu View Drop Down
New Member
New Member
Avatar

Joined: 17 Oct 2019
Posts: 36
Post Options Post Options   Quote Mathieu Quote  Post ReplyReply Direct Link To This Post Posted: 13 Nov 2019 at 3:17pm
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.
Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 8326
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 13 Nov 2019 at 3:22pm
The background of what? The item itself? The timeslot? Background of something else?
Please follow up via email with EXACT & FULL information.
Back to Top
Mathieu View Drop Down
New Member
New Member
Avatar

Joined: 17 Oct 2019
Posts: 36
Post Options Post Options   Quote Mathieu Quote  Post ReplyReply Direct Link To This Post Posted: 13 Nov 2019 at 3:25pm
I'm talking about the time axis (sorry if my words aren't precise, I'm not english native).
Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 8326
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 13 Nov 2019 at 3:30pm
I asked to followup with FULL details via email. This thread is closed. 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down