Page 1 of 1

OnPrintComponent not working

Posted: Fri Feb 10, 2012 10:31 am
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

Posted: Fri Feb 10, 2012 3:51 pm
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.

Posted: Wed Feb 15, 2012 8:52 am
by infrax
Thx. It works now.