Jump to content

Read calendar from table


Gianluca

Recommended Posts

Hello,

I realized a small project with UNIGUI 1.90.0.1563 pro registered.  I Cannot enter appointments in the calendar read from a table, probabily because I use a code not good for mobile version, my code is on formCreate:

 

ar
  E : TUniCalendarEvent;
 
begin
    UnimCalendarPanel1.StartDate := toDay ;
    UnimCalendarPanel1.WeekTimeRange.TimeStart := 0.0;
    UnimCalendarPanel1.WeekTimeRange.TimeEnd := 0.99999999999;
    UnimCalendarPanel1.DayTimeRange.TimeStart := 0.0;
    UnimCalendarPanel1.DayTimeRange.TimeEnd := 0.99999999999;

    
    with qCalendario do
    begin
        if active then close;

        Open;
        
        while NOT EOf do
        begin
             E := UnimCalendarPanel1.Events.Add;
             E.CalendarId := StrmCAL.FieldByName( 'CalendarId' ).AsInteger;
             E.Title := FieldByName( 'Titolo' ).AsString;
             E.StartDate := FieldByName( 'DataInizio' ).Asdatetime;
             E.EndDate := FieldByName( 'Datafine' ).Asdatetime;
             e.Notes :=  FieldByName( 'Nota01' ).AsString;
             e.Reminder := FieldByName( 'FlReminder' ).AsString;
             E.IsAllDay := True;
        
             Next;
        end;
        
    end;

 

When Excute program Calendar is not update.

If Someone can help me, thanks in advance.

 
Link to comment
Share on other sites

yes I took a cue from the example to build my calendar. The problem I think is in the way it handles the UNIGUI query does 
not perform the next recordon the next record, it seems to not recognize the WHILE NOT EOF.
I have no error but the query never return a set of record in te loop.
i use firedac on a sql server table.
if you can give me confirmation that the procedure I am using works or if you can suggest one, thank you
Link to comment
Share on other sites

hi sorry very much for the delay but I was not in the office these days.
I am sending you an example starting from the demo. Running the query does not appear to loop on the while not eof statement.
I am also attaching the script of the table and data to populate it, thanks for your collaboration hello

ClendarTestSQL.zip

Link to comment
Share on other sites

×
×
  • Create New...