Teechart with custom axes to ReportBuilder

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
uniformagri
Newbie
Newbie
Posts: 1
Joined: Wed Apr 24, 2019 12:00 am

Teechart with custom axes to ReportBuilder

Post by uniformagri » Thu Oct 03, 2019 9:36 am

My main question is : how do I get a Teechart with custom axes to a TChart on ReportBuilder ?

Using
- Teechart Pro v2013.08.13052 32bit VCL
- Reportbuilder v18.03 Build 385
- Delphi XE (version 15.0.3953.35171)

I have an issue with a TChart on a VCL-form that needs to be printed (or previewed). The chart has 6 custom axes and 32 series. I need to print this chart, and we're using ReportBuilder everywhere else in our software to print charts (where there will be a printpreview on the screen first). We're using the CloneChart-method to have the Chart copied to ReportBuilder.

With this chart we have the problem that the chart is not fully visible, like it is not stretching. I also notice that the custom axes are not visible in ReportBuilder. My goal is to have an exact copy of the TeeChart on the form, in ReportBuilder for printing purposes.

It seems that the custom axes are not cloned ? I tried copying the custom-axis, added the custom-axis in the ReportBuiled ppChart. Point is that the series are created at runtime. Hmmm, I need to link the series with the right custom axes or something. I tried several other things in a search for stretching, without success.

Regards,
Arthur Habraken

Code: Select all

    for i := 0 to aChartSource.SeriesCount - 1 do
    begin
      if aChartSource[i].Active then
      begin
        s := CloneChartSeries(aChartSource[i]);
        s.ParentChart               := AChartTarget.Chart;
        s.GetVertAxis.Grid.Visible  := (s.GetVertAxis.Grid.Visible and aShowGrid);
        s.GetHorizAxis.Grid.Visible := (s.GetHorizAxis.Grid.Visible and aShowGrid);
        s.Marks.Visible             := (s.Marks.Visible and aShowMarks);
        s.OnGetMarkText             := GetMarkText;

        for ii := 0 to AChartSource[i].Count -1 do
        begin
          if (s.ValueColor[ii] <> AChartSource[i].ValueColor[ii]) then
          begin
            s.ValueColor[ii] := AChartSource[i].ValueColor[ii];
            vRedraw := TRUE;
          end;
        end;
      end;
    end;

Code: Select all

    { Duplicate the axis }
    for i := 0 to aChartSource.CustomAxes.Count - 1 do
    begin
      ppchrtKPI.Chart.CustomAxes.Add;
      LAxis := ppchrtKPI.Chart.CustomAxes[ppchrtKPI.Chart.CustomAxes.Count-1];
      LAxis.Assign(aChartSource.CustomAxes[i]);
    end;

EdDressel
Newbie
Newbie
Posts: 32
Joined: Mon Dec 10, 2018 12:00 am

Re: Teechart with custom axes to ReportBuilder

Post by EdDressel » Thu Oct 03, 2019 2:00 pm

I use RB and TChart in my app, but I don't have TCharts in my reports, I have TppImage objects and create WMFs with TChart in the application and then put the image into my report--it makes life a little easier (well, a lot easier).

Here are some of my methodologies:

1) All my reporting happens in one form.
2) My reports are stored in a database and then loaded into sub reports of a TppReport
3) Before printing, I go through the list of report objects, looking for TppImage reports that are not on the page style band and make a list of them. They have a custom name that matches the name in my applicatoin.
4) I go throuh my list of open forms and see if any of them have the same name as the TppImage objects. If so, I create an WMF of the same size that the TppImage object is from the TChart in my application.
5) I then put the WMF into the

HTH,

Ed Dressel
Thanks,

Ed Dressel

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

Re: Teechart with custom axes to ReportBuilder

Post by Yeray » Wed Oct 09, 2019 8:18 am

Hello,

The problem with the custom axes sounds like the ticket #780 which was fixed in v2018.24.180321.
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