Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calendar based scheduler in asp 1

Status
Not open for further replies.

sweetleaf

Programmer
Jan 16, 2001
439
CA
Hi all,

I have to create a report which is layed out as follows:

<ie.Report for March 2001>

ID Days Of Month
------------------------------------------------------------
1 |1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
2 |1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
3 |1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
4 |1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

The START and END dates associated with each ID show up as a highlighted bar on each row. The START and END dates will always be 27 days and will usually cross over into other months(indicated by a &quot;<&quot; or &quot;>&quot; respectively).
Does anyone even know where I can begin with this. Is there a ready made downloadable component that simplifies this..?

thanks
 
I posted this earlier but it was missed somehow, so i'll try again. if anyone even knows how i can approach this problem conceptually that would be greatly appreciated.
i don't necessarily need the actual technique but the ideas sure would be great!

I have to create a report which is layed out as follows:

<ie.Report for March 2001>

ID Days Of Month
------------------------------------------------------------
1 |1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
2 |1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
3 |1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
4 |1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

There are START and END dates associated with each ID which are to be displayed as highlighted bars on each row.For example, if ID 1 started on Mar4 and ended Mar17 then a solid bar would be displayed from 4 to 17. Basically it'd look kinda like a gant chart in order to graphically represent schedules and stuff.

thanks!

 
You could make each number in it's own <span> tag, and then manipulate the background colors of those spans (provided you give them id's) programatically with asp script based on the <start> and <end> dates that you pull from the database.

--OR--

You could set the whole thing up in a table, and then manipulate the background colors of the <td>'s with the script. With this method, you'd have to check values as you went (writing out the table cells), whereas I believe you can do the former after the page was written.

Is that what you were looking for??

 
Thanks link9,

I will try the first suggestion. when you say provide span tag id's programmatically based on the retrieved date values , how do you mean?

thanks again dude
 
Well, let's say you had each number in it's own span...

<span id=date1 style=&quot;BACKGROUND-COLOR: white&quot;>1</span>

All the spans (which would make up the entire calendar) would all have a bgcolor of white.

So, the script that would produce the different colors on the spans that you wanted to have say... yellow backgrounds would look more or less like:
Code:
<span id=date1 style=&quot;BACKGROUND-COLOR: 

<%
if startDate >= 1 and endDate <= 1 then
    response.write(&quot;yellow&quot;)
else
    response.write(&quot;white&quot;)
end if
%>

&quot;>1</span>


next one --
Code:
<span id=date1 style=&quot;BACKGROUND-COLOR: 

<%
if startDate >= 2 and endDate <= 2 then
    response.write(&quot;yellow&quot;)
else
    response.write(&quot;white&quot;)
end if
%>

&quot;>2</span>

So yes, I suppose this is checking as you go, as well, and I'm sure that there's probably a 'slicker' way to do this, but this would work just fine.

The only thing that I could add to this would be to say to stick the asp parts of the above code into a function and call it when you need it (on each span) passing it the number you want to write (1, 2, 3, etc...) and the start and end dates.

That would make your code much more manageable if there was an issue.

good luck! :)
Paul Prewett

 
that was totally helpful!

awesome! I tried your suggestion with a portion of my code and it works great. thanks once again link9..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top