BAckground logo

Alex Clay aclay at mac.com
Wed Apr 25 08:38:27 EDT 2018


Hi Wendy,

We added a feature to print a graphic on any report. The graphic can be changed and positioned by the user and it prints behind other text. I've posted a screenshot of how this looks here:

https://ibb.co/kiZQic <https://ibb.co/kiZQic>

Since this is a system-wide feature, we dynamically add the image during a superclass' $construct. Here is the code we use:

> If isclear(ivOptionsRow.ReportLogoGraphic)
> 	Quit method
> End If
> 
> Do $cinst.$_getReportLogoLeft() Returns lnLeft
> Do $cinst.$_getReportLogoTop() Returns lnTop
> 
> ;  Add the field
> Do $cinst.$objs.$add(kPictureobj,0,0,ivOptionsRow.ReportLogoHeight,ivOptionsRow.ReportLogoWidth) Returns lirReportLogoField
> Calculate lirReportLogoField.$dataname as "ivOptionsRow.ReportLogoGraphic"
> Calculate lirReportLogoField.$rawpictformat as "*ALL"
> 
> ;  Add the print method
> Do lirReportLogoField.$methods.$add("$print") Returns lirPrintMethod
> 
> Do lirPrintMethod.$lvardefs.$add("pfrPosition",kFieldreference,#NULL,#NULL,kTrue)
> 
> Do lirPrintMethod.$methodlines.$add("Calculate pfrPosition.$posmode as kPosPaper")
> Do lirPrintMethod.$methodlines.$add(con("Calculate pfrPosition.$top as ",lnTop))
> Do lirPrintMethod.$methodlines.$add(con("Calculate pfrPosition.$left as ",lnLeft))
> Do lirPrintMethod.$methodlines.$add("Do default")
> 
> Quit method lirReportLogoField


As Phil and Michael pointed out, using the positioning parameter to the object's $print method lets you position the image where you want on the page. The picture object is added at the top of the report, so it prints "first". This allows other content to overprint the image. 

We ship this feature in Studio 8.1, and as Alain pointed out, Omnis has had issues printing certain images on reports. I've reported these and Studio 8.1.5 seems to fix all the issues we've found. In 4.3 you may need to use certain graphic format and adjust the alpha and color channels to get it to work just right.

Hope this helps!

Alex



> On Apr 25, 2018, at 02:59, Wendy <wizardcompserv at gmail.com> wrote:
> 
> Hi
> 
> I am hoping someone has done this.
> 
> 
> 
> My customer would like their logo as a background object at the top of a
> report - how do I get it to go behind the text as 'Align' option is greyed
> out both on the logo and the text?
> 
> 
> 
> Many thanks
> 
> Wendy Osbaldestin
> 
> Wizard Computer Services
> 
> Tel:  01260271647
> 
> Mobile: 07740541021
> 
> 
> 
> 
> 
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list