Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Fiscal Calendar?

Reply
Thread Tools

Fiscal Calendar?

 
 
ajmera.puneet@gmail.com
Guest
Posts: n/a
 
      07-31-2006
If I have Calendar Control on Asp.net page and I have a table for
Fiscal years on sql server
then, How can I check the dates from table to Calendar Control,so that
I can format the Calendar control cells according to my need.
I want to change the color of Dates according to fiscal month. i.e. As
Calendar control has dates for Current + next + Previous months, I need

to change the color of dates of month which is comes under Fiscal
month.
I have table for fiscal years, which has following :

CREATE TABLE [AccountingCalendar] (
[AccountingCalendarID] [int] IDENTITY (1, 1) NOT NULL ,
[FiscalYear] [smallint] NOT NULL ,
[FiscalQuarter] [tinyint] NOT NULL ,
[FiscalMonth] [tinyint] NOT NULL ,
[MonthName] [varchar] (9) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT
NULL ,
[MonthStart] [smalldatetime] NOT NULL ,
[MonthEnd] [smalldatetime] NOT NULL ,
[CalendarYear] [smallint] NOT NULL ,
[CalendarQuarter] [tinyint] NOT NULL ,
[CalendarMonth] [tinyint] NOT NULL ,
[NoOfWeeks] [tinyint] NOT NULL ,
CONSTRAINT [pkAccountingCalendar] PRIMARY KEY CLUSTERED
(
[AccountingCalendarID]
) WITH FILLFACTOR = 90 ON [PRIMARY]
) ON [PRIMARY]
GO


And data according to it.
Now How can I check the dates from these table with Calendar Date and
change the backgrond color for the month Started from MonthStart to
MonthEnd field of table.


Any suggestion or help will be appriciated.
TIA

 
Reply With Quote
 
 
 
 
=?Utf-8?B?YnJpYW5zW01DU0Rd?=
Guest
Posts: n/a
 
      08-01-2006
Hello TIA,

From your question I am assuming you want to color the background of each
day depending upon some criteria. In order to do that you will want to create
an event handler for the Calendar control's DayRender event. In your code,
get the data from SQL into some in-memory datastore (DataTable probably in
the PageLoad event). Then, in the DayRender event handler query the in-memory
datastore against the DayRenderEventArg e.Day and set the e.Cell.BackColor
appropriately. Something like this pseudocode:

private void calBigMarathon_DayRender(object sender,
System.Web.UI.WebControls.DayRenderEventArgs e)
{
if (e.Day.Date.DayOfYear == dtFiscal.Solvent)
{
set e.Cell.BackColor = black;
}
else
{
set e.Cell.BackColor = red;
}
}

--
enjoy - brians
http://www.limbertech.com


"(E-Mail Removed)" wrote:

> If I have Calendar Control on Asp.net page and I have a table for
> Fiscal years on sql server
> then, How can I check the dates from table to Calendar Control,so that
> I can format the Calendar control cells according to my need.
> I want to change the color of Dates according to fiscal month. i.e. As
> Calendar control has dates for Current + next + Previous months, I need
>
> to change the color of dates of month which is comes under Fiscal
> month.
> I have table for fiscal years, which has following :
>
> CREATE TABLE [AccountingCalendar] (
> [AccountingCalendarID] [int] IDENTITY (1, 1) NOT NULL ,
> [FiscalYear] [smallint] NOT NULL ,
> [FiscalQuarter] [tinyint] NOT NULL ,
> [FiscalMonth] [tinyint] NOT NULL ,
> [MonthName] [varchar] (9) COLLATE SQL_Latin1_General_CP1_CI_AS
> NOT
> NULL ,
> [MonthStart] [smalldatetime] NOT NULL ,
> [MonthEnd] [smalldatetime] NOT NULL ,
> [CalendarYear] [smallint] NOT NULL ,
> [CalendarQuarter] [tinyint] NOT NULL ,
> [CalendarMonth] [tinyint] NOT NULL ,
> [NoOfWeeks] [tinyint] NOT NULL ,
> CONSTRAINT [pkAccountingCalendar] PRIMARY KEY CLUSTERED
> (
> [AccountingCalendarID]
> ) WITH FILLFACTOR = 90 ON [PRIMARY]
> ) ON [PRIMARY]
> GO
>
>
> And data according to it.
> Now How can I check the dates from these table with Calendar Date and
> change the backgrond color for the month Started from MonthStart to
> MonthEnd field of table.
>
>
> Any suggestion or help will be appriciated.
> TIA
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a java library/class for performing "fiscal year" math? edsnooper@yahoo.com Java 0 11-03-2006 03:01 PM
Red Hat Reports Fiscal Fourth Quarter and Fiscal Year 2006 Results Have A Nice Cup of Tea NZ Computing 0 03-29-2006 12:51 AM



Advertisments