The easiest way to add a watermark it to use the PageStyle band. Anything placed inside this band will print behind the rest of the report. Enable the PageStyle by selecting Report | Page Style... from the main menu in the designer.
If you would like to manually create a watermark on a page, see the following article.
Hi Nico, is there a way to rotate the drawtext, for instance of 45 degrees? I've tried setting the "angle" property, but it seems that any value different than zero causes the text to disappear.
Which version of ReportBuilder are you using? In my testing with RB 12.01, placing a DBText in the PageStyle with the angle set to 45 produced the expected output. Be sure you have the AutoSize property set to True as well to ensure the bounding box is large enough for the text.
Adding a lWaterMark.Angle:=45 (or whatever else value other than zero) causes the whole ppDrawText (lWaterMark) to disappear in the page. Why? Is there any method or workaound to rotate the writing?
The following code worked correctly with RB 12.01. Note that all measurements with drawcommands are in microns so you will need to convert your measurements if needed. Conversion routines can be found in the ppUtils.pas file. The code below uses general values to ensure there is enough space to print the text.
procedure TForm1.ppReport1EndPage(Sender: TObject); var lDrawText: TppDrawText; begin
Comments
The easiest way to add a watermark it to use the PageStyle band. Anything
placed inside this band will print behind the rest of the report. Enable
the PageStyle by selecting Report | Page Style... from the main menu in the
designer.
If you would like to manually create a watermark on a page, see the
following article.
http://www.digital-metaphors.com/rbWiki/Delphi_Code/Formatting/How_To...Manually_Add_a_Watermark_to_a_Page
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
http://www.digital-metaphors.com/rbWiki/Delphi_Code/Formatting/How_To...Manually_Add_a_Watermark_to_a_Page
Hi Nico, is there a way to rotate the drawtext, for instance of 45
degrees? I've tried setting the "angle" property, but it seems that any
value different than zero causes the text to disappear.
Thanks in advance
Which version of ReportBuilder are you using? In my testing with RB 12.01,
placing a DBText in the PageStyle with the angle set to 45 produced the
expected output. Be sure you have the AutoSize property set to True as well
to ensure the bounding box is large enough for the text.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Hi Nico, i'm using v.12.01.197 (the latest), and sorry for the
misunderstanding, i was referring to the sample code you've linked:
http://www.digital-metaphors.com/rbWiki/Delphi_Code/Formatting/How_To...Manually_Add_a_Watermark_to_a_Page
to manually obtain a watermark.
Adding a lWaterMark.Angle:=45 (or whatever else value other than zero)
causes the whole ppDrawText (lWaterMark) to disappear in the page. Why?
Is there any method or workaound to rotate the writing?
Thanks
The following code worked correctly with RB 12.01. Note that all
measurements with drawcommands are in microns so you will need to convert
your measurements if needed. Conversion routines can be found in the
ppUtils.pas file. The code below uses general values to ensure there is
enough space to print the text.
procedure TForm1.ppReport1EndPage(Sender: TObject);
var
lDrawText: TppDrawText;
begin
lDrawText := TppDrawText.Create(nil);
lDrawText.Angle := 45;
lDrawText.Text := 'Test';
lDrawText.Left := 50000;
lDrawText.Top := 2000;
lDrawText.Width := 20000;
lDrawtext.Height := 20000;
lDrawText.Page := ppReport1.Engine.Page;
end;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com