Hello,
I'm working on adding a watermark that would read "Preliminary" to our reports that we produce for our end users after we collect all their information. I am currently working with an .rpx file wiht ActiveReports and the language being used inside the .rpx being VB Script.
I have found some code that I thought would work, but so far hasn't.....here it is:
Sub OnReportStart
(other code)
set rpt.Watermark.object = System.Drawing.Image.FromFile("C:\...blahblah.bmp")
End Sub
Any advice at all??
Thanks,
Brian
Brian,
Please use the following lines of script in the script editor to generate the watermark.
rpt.Watermark = LoadPicture("C:\...picture.bmp")
Regards,
Prantik
Excellent! That worked! Thank you so much!
One final question...I have other controls on this PDF print out, and I would like to place the watermark on three of them (but not all of them)...so the user can read Preliminary Report in its entirety.
Any thoughts on that?
Thank you!
Could you please let us know what do you mean by “other controls in the PDF printout”? If I understand you correctly, you are exporting the report generated by ActiveReports to the PDF format and you wish to add watermarks in some particular pages. If that is the case then, you could add watermark according to the condition of page number with code as follows:-
If pagenumberof report=requiredpagenumber then
Me. Watermark=LoadPicture (“FilePath”)
Else Me. Watermark=LoadPicture ()
End if
Regards,Prantik
Hmm...I guess I explained this the wrong way. I'm trying to find the property to put some of the controls (grids I use in my report to separate certain areas) BEHIND the watermark (Watermark to the front for those specific controls) but not all of them.
Hope this helps!!
For your above comment on which page to display watermark...where would that go? OnReportStart?
The watermark we used...we changed the angle of it so the controls aren't interfering. However, we would like the 1st page to have the full watermark but the following pages to have a watermark (which is actually a label on the footer) to display on the proceeding pages and not the full watermark.
Any thoughts?
Here is the current code I'm twinkering with:
Sub OnFormat
Const enuIsCompleted = 277 strData = rptWriterClass.strData If rpt.pageNumber = 1 Then if strData(enuIsCompleted) <> "True" then rpt.watermark = loadpicture("C:\Program Files\...\pr.jpg") if err.number <> 0 then msgbox "The Preliminary Report file could not be found. Please us to resolve this issue." end if end if rpt.srHeader1.Visible = True rpt.srHeader2.Visible = False Else 'rpt.watermark = loadpicture() rpt.srHeader1.Visible = False rpt.srHeader2.Visible = True if strData(enuIsCompleted) <> "True" then rpt.Sections("PageFooter").Controls("Label2").visible = true end if End If
Prantik,
That worked!!! OMG...thank you so much for your help on this!
If this was Arby's, I would ring that Customer Sastified bell at least ten times!