Page 1 of 1

how to display full year calendar in teechart/reportbuilder

Posted: Wed Sep 24, 2014 1:48 pm
by 16568795
Hello

I have teechart pro 2014 and reportbuilder 15.04

I wish to display a full year calendar on the report. (not just one month but all 12 months)

how can this be achieved ?

Thanks

kam

Re: how to display full year calendar in teechart/reportbuilder

Posted: Thu Sep 25, 2014 7:31 am
by yeray
Hello kam,

I see two alternatives you could give a try:
- 12 TChart in the same form/report, each chart showing a month.
- 1 TChart with a TSubChartTool and 12 TSubCharts in the tool, each subchart showing a month.

Re: how to display full year calendar in teechart/reportbuilder

Posted: Mon Sep 29, 2014 11:37 pm
by 16568795
Hi

Thanks for suggestions:

It is not clear to me however how to assign the values to the calendars.

eg if i have 12 calendars on a page

calendar 1 should be set to january 2014
calendar 2 should be set to february 2014
etc. etc.

some sample code would be helpful

kind regards

Kam

Re: how to display full year calendar in teechart/reportbuilder

Posted: Tue Sep 30, 2014 11:11 am
by yeray
Hi Kam,

Here it is a simple example:

Code: Select all

uses TeeCalendar;

var Calendars: array[0..11] of TChart;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Caption:='2014 Calendar';

  for i:=0 to 11 do
  begin
    Calendars[i]:=TChart.Create(Self);
    Calendars[i].Parent:=Self;
    Calendars[i].Width:=200;
    Calendars[i].Height:=200;
    Calendars[i].Left:=(i mod 3)*Calendars[i].Width;
    Calendars[i].Top:=(i div 3)*Calendars[i].Height;

    with (Calendars[i].AddSeries(TCalendarSeries) as TCalendarSeries) do
    begin
      Date:=StrToDate('1/' + IntToStr(i+1) + '/2014');
      NextMonthButton.Visible:=false;
      PreviousMonthButton.Visible:=false;
      Trailing.Visible:=false;
      Today.Visible:=false;
    end;
  end;
end;