Hello,
I need some help with TeePreviewPanel component. When I put at design time such a component on a form, inside the panel of he component will be drawn a rectangle which will contain all the charts added to the component. Please let me know how could I make invisible this rectangle or at least change it color (is black by default). If I print TeePreviewPanel through metafile, this rectangle will be print on the paper around the charts and I want to make it invisible.
Another question is about a title/foot for TeePreviewPanel, has anyone a suggestion how can I implement it? I tried TeePreviewPanel->Title but I don't see it displayed on the component.
Thank you in advance.
Best regards,
Mihael Avram
TeePreviewPanel rectangle
Hello amih,
You can try the following code to save a metafile without paper line margins:
And there's no Title nor Foot for TeePreviewPanel but you can edit Chart's ones by:
You can try the following code to save a metafile without paper line margins:
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
begin
TeePreviewPanel1.Panels.Add(Chart1);
TeePreviewPanel1.Margins.Visible := false;
TeePreviewPanel1.SaveToMetafile('C:\temp\MyMetaFile.emf');
end;
Code: Select all
Chart1.Title.Text.Clear;
Chart1.Foot.Text.Clear;
Chart1.Title.Text.Add('My Title Chart');
Chart1.Foot.Text.Add('My Foot Chart');
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
TeePreviewPanel rectangle
Thank you for your support.
The line:
doesn't work for me. I mean when I put at design time a TeePreviewPanel component on a form without any chart added to it, there is a rectangle drawn inside the panel and I don't want to print that rectangle on the paper, or at least to change its color if it's possible. It's not about the margins of the chart too.
In order to extent the graphics printed on the paper, I used negative numbers like in this example (for portrait):
but I want to disable the print of the rectangle I mentioned above. Any solution?
My best regards
Mihael Avram
The line:
Code: Select all
TeePreviewPanel1.Margins.Visible := false;
In order to extent the graphics printed on the paper, I used negative numbers like in this example (for portrait):
Code: Select all
TMetafile * tmpMeta = new TMetafile;
tmpMeta = TeePreviewPanel1->TeeCreateMetafile(true,
Rect(TeePreviewPanel1->ClientRect.Left,
TeePreviewPanel1->ClientRect.Top,TeePreviewPanel1->ClientRect.Right,
TeePreviewPanel1->ClientRect.Bottom));
Printer()->Canvas->StretchDraw(Rect(-50,-600,Printer()->PageWidth+600, Printer()->PageHeight+600),tmpMeta);
// and here I implemented a title for the page:
Printer()->Canvas->Font->Assign(titleEdit->Font);
int titleLeft = (Printer()->PageWidth - Printer()->Canvas->TextWidth(titleEdit->Text)) / 2;
Printer()->Canvas->TextOut(titleLeft, 10, titleEdit->Text);
My best regards
Mihael Avram
Hi amih,
Using TeeChart v7.07 the next line of code works fine for us:
If it still doesn't solve your problem, tell us what version are you using and we'll look for another solutions.
Using TeeChart v7.07 the next line of code works fine for us:
Code: Select all
TeePreviewPanel1->Margins->Visible = false;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |