how to display full year calendar in teechart/reportbuilder

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
kam
Newbie
Newbie
Posts: 2
Joined: Mon Mar 24, 2014 12:00 am

how to display full year calendar in teechart/reportbuilder

Post by kam » Wed Sep 24, 2014 1:48 pm

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

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

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

Post by Yeray » Thu Sep 25, 2014 7:31 am

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

kam
Newbie
Newbie
Posts: 2
Joined: Mon Mar 24, 2014 12:00 am

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

Post by kam » Mon Sep 29, 2014 11:37 pm

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

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

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

Post by Yeray » Tue Sep 30, 2014 11:11 am

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;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply