Gianluca Posted June 28, 2022 Share Posted June 28, 2022 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 More sharing options...
Sherzod Posted June 28, 2022 Share Posted June 28, 2022 6 minutes ago, Gianluca said: with qCalendario do begin if active then close; Open; Hello, Is your query returning results? Link to comment Share on other sites More sharing options...
Gianluca Posted June 28, 2022 Author Share Posted June 28, 2022 Hello, yes return a set of record from the table, I send a screen shoot, thanks. Link to comment Share on other sites More sharing options...
Sherzod Posted June 28, 2022 Share Posted June 28, 2022 30 minutes ago, Gianluca said: toDay ? Link to comment Share on other sites More sharing options...
Sherzod Posted June 28, 2022 Share Posted June 28, 2022 Okay, you are using DateUtils's method. Link to comment Share on other sites More sharing options...
Gianluca Posted June 28, 2022 Author Share Posted June 28, 2022 sorry I don't understand. can you please help me with a small example? thanks Link to comment Share on other sites More sharing options...
Sherzod Posted June 28, 2022 Share Posted June 28, 2022 10 minutes ago, Gianluca said: can you please help me with a small example? Have you checked on a demo example? \FMSoft\Framework\uniGUI\Demos\Touch\CalendarPanel Link to comment Share on other sites More sharing options...
Gianluca Posted June 28, 2022 Author Share Posted June 28, 2022 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 More sharing options...
Sherzod Posted June 28, 2022 Share Posted June 28, 2022 Hello, Sorry, can you make a simple testcase to check? Link to comment Share on other sites More sharing options...
Gianluca Posted July 1, 2022 Author Share Posted July 1, 2022 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 More sharing options...
Recommended Posts