OnPrintComponent not working

General TRichView support forum. Please post your questions here
Post Reply
infrax
Posts: 31
Joined: Wed Aug 10, 2011 10:57 am

OnPrintComponent not working

Post by infrax »

I have this code:

Code: Select all

RichViewXml1.RichView := RVReportHelper1.RichView;
RichViewXml1.LoadFromFile('someXMLWithControls.xml');

//RVPrint1.OnPrintComponent := RVPrintComponent;
RVReportHelper1.OnPrintComponent := RVPrintcomponent;

//RVPrint1.AssignSource(RVReportHelper1.RichView);
//RVPrint1.FormatPages(rvdoAll);
//RVPrint1.Print('Test',1,true);

RVReportHelper1.Init(PrinterCanvas,4000);
RVReportHelper1.FormatNextPage(8000);
RVReportHelper1.DrawPageAt(0,0,1,PrinterCanvas,False,RVReportHelper1.GetLastPageHeight);
On RVReportHelper OnPrintComponent event is not fired. But if I use RVPrint (see commented code) OnPrintComponent fires OK. What am I missing?

Thanks
Sergey Tkachenko
Site Admin
Posts: 17572
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

This is a bug.
If you have a source code, open RVItem.pas, find
TRVControlItemInfo.PrintToBitmap, change all occurrences of TPrintableRV to TCustomPrintableRV.
infrax
Posts: 31
Joined: Wed Aug 10, 2011 10:57 am

Post by infrax »

Thx. It works now.
Post Reply