| |
ActiveReports 2.0 (Visual Basic 6.0) Support
Started by btmckenna at 06-05-2009 12:34 PM. Topic has 10 replies.
 
 
 
|
|
Sort Posts:
|
|
|
|
06-05-2009, 12:34 PM
|
btmckenna
Joined on 06-06-2009
Posts 7
|
|
|
|
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")
(other code)
End Sub
Any advice at all??
Thanks,
Brian
|
|
|
|
|
Report
|
|
|
|
06-05-2009, 1:37 PM
|
PrantikS
Joined on 12-11-2008
Posts 766

|
Re: Adding watermark to PDF
|
|
|
|
|
|
Brian,
Please use the following lines of script in the script editor to generate the watermark.
Sub OnReportStart
rpt.Watermark = LoadPicture("C:\...picture.bmp")
End Sub
Regards,
Prantik
|
|
|
|
|
Report
|
|
|
|
06-09-2009, 2:37 PM
|
btmckenna
Joined on 06-06-2009
Posts 7
|
Re: Adding watermark to PDF
|
|
|
|
|
|
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!
|
|
|
|
|
Report
|
|
|
|
06-09-2009, 11:46 PM
|
PrantikS
Joined on 12-11-2008
Posts 766

|
Re: Adding watermark to PDF
|
|
|
|
|
|
Hello,
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
|
|
|
|
|
Report
|
|
|
|
06-11-2009, 5:31 AM
|
PrantikS
Joined on 12-11-2008
Posts 766

|
Re: Adding watermark to PDF
|
|
|
|
|
Hello,
I would like to inform you that the watermark property is available for the entire report and not some specific controls. Could you please provide us the RPX and the RDF of your report and please point out where you require the watermark to display and the content of the same, so that we could analyze and provide a better solution.
Regards, Prantik
|
|
|
|
|
Report
|
|
|
|
06-18-2009, 12:35 PM
|
btmckenna
Joined on 06-06-2009
Posts 7
|
Re: Adding watermark to PDF
|
|
|
|
|
|
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?
Thank you!
|
|
|
|
|
Report
|
|
|
|
06-18-2009, 1:26 PM
|
btmckenna
Joined on 06-06-2009
Posts 7
|
Re: Adding watermark to PDF
|
|
|
|
|
rpt.watermark = loadpicture() also throws a wicked error message at you as well... =\
|
|
|
|
|
Report
|
|
|
|
06-18-2009, 2:30 PM
|
btmckenna
Joined on 06-06-2009
Posts 7
|
Re: Adding watermark to PDF
|
|
|
|
|
|
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
End Sub
|
|
|
|
|
Report
|
|
|
|
06-19-2009, 8:08 AM
|
PrantikS
Joined on 12-11-2008
Posts 766

|
|
|
Hello,
Thank you for providing the details. Please take a look at the attached sample which illustrates your requirements. Please change the connection properties to connect to the NorthWind database.
Regards, Prantik
|
|
|
|
|
Report
|
|
|
|
06-19-2009, 11:13 AM
|
btmckenna
Joined on 06-06-2009
Posts 7
|
Re: Adding watermark to PDF
|
|
|
|
|
|
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!
Regards,
Brian
|
|
|
|
|
Report
|
|
|
|
|
GrapeCity » Product Support » ActiveReports 2... » Re: Adding watermark to PDF
|
|
|
|
|