Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > DB-Aware

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 08-04-2004, 12:52 AM
x_t_r_e_m_e x_t_r_e_m_e is offline
Senior Member
 
Join Date: Feb 2004
Posts: 150
Default Printing a DBChart

How do I print a DBChart that I show to the user?

I can't see how I access the image that DBChart generates.
Reply With Quote
  #2  
Old 08-04-2004, 01:29 AM
rsawoseyin rsawoseyin is offline
Senior Member
 
Join Date: Nov 2001
Posts: 515
Default RE: Printing a DBChart

Rather than try to print the chart directly, I recommend you save the form containing the chart to a bitmap file. The beauty of this is that you can use that image file in many other documents - like including in a presentation, etc. Here is the function in BCBuilder; I hope you can cast in Delphi:

void SaveFormToBitmap(TForm *form)
{
TBitmap *FormImage = form->GetFormImage();
try
{
TSaveDialog *savedialog=new TSaveDialog(form);
if (savedialog->Execute())
FormImage->SaveToFile(savedialog->FileName);
delete savedialog;
}
__finally
{
delete FormImage;
}
}
Reply With Quote
  #3  
Old 08-04-2004, 01:29 AM
rsawoseyin rsawoseyin is offline
Senior Member
 
Join Date: Nov 2001
Posts: 515
Default RE: Printing a DBChart

Rather than try to print the chart directly, I recommend you save the form containing the chart to a bitmap file. The beauty of this is that you can use that image file in many other documents - like including in a presentation, etc. Here is the function in BCBuilder; I hope you can cast in Delphi:

void SaveFormToBitmap(TForm *form)
{
TBitmap *FormImage = form->GetFormImage();
try
{
TSaveDialog *savedialog=new TSaveDialog(form);
if (savedialog->Execute())
FormImage->SaveToFile(savedialog->FileName);
delete savedialog;
}
__finally
{
delete FormImage;
}
}

I hope this helps.

Raph Awoseyin
Port Harcourt, Nigeria
Reply With Quote
  #4  
Old 08-04-2004, 02:53 AM
kalifat kalifat is offline
Senior Member
 
Join Date: Apr 2003
Posts: 623
Default RE: Printing a DBChart

Hello

If you have QuickReport components then join your DBChart with TQRChart component.
Reply With Quote
  #5  
Old 08-04-2004, 04:51 AM
NigelStratton NigelStratton is offline
Member
 
Join Date: Mar 2001
Posts: 67
Default RE: Printing a DBChart

DBChart1.print;

or

DBChart1.printlandscape;

or

DBChart1.printportrait;

nigel
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 12:36 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.