Page 1 of 1

RVPrint support background image in Header ?

Posted: Sat Jul 26, 2008 5:42 pm
by nostradumbass
[ Using TRichViewEdit v10.2 ]

RVPrint does not support header background image?

I am assigning a background image to a RichView and then assigning this to RVPrint using SetHeader method. But the preview does not show the background image. Is this not supported?

I need to impose text on top of a image (in the header) so I really need background image.

My code:

Building the header richview:

Code: Select all

 var
 x : integer;
 p : TJpegImage;
begin
 //  clear header, content
   rV1.Clear;
   rVHdr1.Clear;

 // header - image
   p := TJpegImage.Create;
   p.LoadFromFile(TEMPLATESPATH + cmbMainPresetHeader.Text);
   rVHdr1.BackgroundStyle := bsStretched;
   rVHdr1.BackgroundBitmap := TBitmap(p) ;
   rVHdr1.Invalidate;

 // header - text
   with rvStyleHdr.TextStyles.Add do
   begin
     FontName :=  strToFont(setupInfo.textFont.FontName, defaultFont).Name ;
     Size := strToFont(setupInfo.textFont.FontName, defaultFont).Size;
     Color := strToFont(setupInfo.textFont.FontName, defaultFont).Color;
     Style :=  strToStyle(setupInfo.textFont.FontStyle) ;
     StyleName := 'HEADER';
   end;

   x:=rvStyleHdr.TextStyles.Count-1;

   with rVHdr1 do
   begin
    AddNL( txtHeaderLine1.Text, x, -1);
    AddNL( txtHeaderLine2.Text, x, 0 );
    AddNL( txtHeaderLine3.Text, x, 0 );
    Format;
   end;

Previewing :

Code: Select all

     
    setReportText;
    rvPrint.SetHeader(rvHdr1.RVData);
    rvPrint.AssignSource(rV1);
    rvPrint.FormatPages(rvdoALL);
    RVPrintPreview1.UpdateView;
Regards,
ND

Posted: Sun Jul 27, 2008 5:04 pm
by Sergey Tkachenko
No, it's not supported, sorry.
But you can use table width background image in headers.

Posted: Sun Jul 27, 2008 5:57 pm
by nostradumbass
Thank you.