在此文中
The class Banana.Report.ReportLogo represents the format of a logo's section.
With a Banana.Report.ReportLogo object you can create and insert a logo's section in the report document. The logo format is defined through the dialog File → Logo Setup.
With this class you don't have to rewrite your scripts to change the logo's section, you can just change the format in the dialog Logo Setup, and the script will apply the new format automatically.
Methods
createDocNode(textNode, stylesheet, disambiguosClass)
Create a new Report Element that represent the logo's section as defined in the dialog File → Logo Setup.
The param textNode is the text node to insert within in the logo section.
The param stylesheet is the stylesheet where the styles needed by the logo section are inserted.
The param disambiguosClass is a string used to prevent clashes with stylesheet class names.
// Get the logo format var headerLogoSection = report.addSection(""); var logoFormat = Banana.Report.logoFormat("Logo"); if (logoFormat) { // Use the format as defined in the dialog File --> Logo Setup var logoElement = logoFormat.createDocNode(headerLogoSection, repStyleObj, "logo"); report.getHeader().addChild(logoElement); } else { // If the format 'logo' is not defined, insert an image report.addImage("documents:logo", "logoStyle"); }