I have been working on a project for Motel reservation system wher I want to display in a graphial look which rooms are occupied, with rooms listed vertically and a range of dates listed horizontally.
The bookings table contains the room and the start and end dates so it is necessary to build the matrix for each unit depicting each day (as opposed to range of days). I have tried verious ways to do this including Crosstab (which does not give me control over cell clicks) and embedded browse on temporary table - which is slow to build for each change of date range.
Having looked at the meehotel example (elsewhere in forum) I thought that a button based approach , where a grid is made from a series of buttons would be the best and fastest way (since this minimises disk/database retriaval). To this end I painstakingly formulated a grid 14 wide and 10 deep (a total of 140 cells).
To my suprise populating this grid to set colours and label text would tak over a second on my pentium 4 system. I gasped as i watched each cell draw individually in a manner that reminded me of the Intel 80286 days.
eg: the same code below
for i = 1 to 14
for j = 1 to 10
s = "B" + alltrim(str(i)) + "_" + alltrim(str(j))
eval (s + ".fill.forecolor") = "Green"
' eval (s + ".text" ) = " "
next j
next i
There must be a beter way to handle this sort of graphical presentation with the performance you would expect from a modern day application.
Any suggestions greatly appreciated. I have attached my working database.
The bookings table contains the room and the start and end dates so it is necessary to build the matrix for each unit depicting each day (as opposed to range of days). I have tried verious ways to do this including Crosstab (which does not give me control over cell clicks) and embedded browse on temporary table - which is slow to build for each change of date range.
Having looked at the meehotel example (elsewhere in forum) I thought that a button based approach , where a grid is made from a series of buttons would be the best and fastest way (since this minimises disk/database retriaval). To this end I painstakingly formulated a grid 14 wide and 10 deep (a total of 140 cells).
To my suprise populating this grid to set colours and label text would tak over a second on my pentium 4 system. I gasped as i watched each cell draw individually in a manner that reminded me of the Intel 80286 days.
eg: the same code below
for i = 1 to 14
for j = 1 to 10
s = "B" + alltrim(str(i)) + "_" + alltrim(str(j))
eval (s + ".fill.forecolor") = "Green"
' eval (s + ".text" ) = " "
next j
next i
There must be a beter way to handle this sort of graphical presentation with the performance you would expect from a modern day application.
Any suggestions greatly appreciated. I have attached my working database.
Comment