Focal Point
[SOLVED] Another EXL2K Image question...

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3521098003

September 29, 2008, 04:38 AM
Anatess
[SOLVED] Another EXL2K Image question...
Okay, I have EXL2K reports that have a logo image on the first line of the header. I've always done it using a DEFINE as follows:
DEFINE FILE CAR
SLOGO/A100='http:\yada\yada\yada.gif';
END
TABLE FILE CAR
PRINT CAR
BY COUNTRY
ON TABLE SUBHEAD
"<SLOGO "
"Car Report"
ON TABLE PCHOLD FORMAT EXL2K
END


Works perfectly. Well, now I have a new requirement to produce the report even if there's no data. So, I had to SET EMPTYREPORT=ON. And, of course, when the report is empty, the logo is not there. Sigh. I tried just imbedding the image using the stylesheet as follows:

TABLE FILE CAR
PRINT CAR
BY COUNTRY
ON TABLE SUBHEAD
" "
"Car Report"
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET STYLE *
     UNIT=IN,
     ORIENTATION=LANDSCAPE,
TYPE=HEADING,
     IMAGE=http:\yada\yada\yada.gif,
$
ENDSTYLE
END


That doesn't work. I add POSITION and SIZE parameters, doesn't work. I put it under TYPE=REPORT, doesn't work. But, if I use HTML, it works. So, how do I do this in Excel? By the way, I can't use a template because it is a compound report.


WF 7.1.3, Windows XP

This message has been edited. Last edited by: Anatess,


WF 8.1.05 Windows
September 29, 2008, 09:45 AM
Prarie
I have not tested this...so don't know if it will work, but try SET EMPTYREPORT = ANSI

Also you have the Stylesheet with HEADING...but you are trying to style a SUBHEAD.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
Ok...had a second to test this...does not appear to work. And to embed an image in EXL2K...you to have to do like you did in the original code. Looks like you are going to have to have something print when it is 0 records and trick it...


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
Why not test -IF &RECORDS EQ 0 THEN GOTO SOMETAG
where SOMETAG executes the heading with the logo against the car routine printing a line that says "NO DATA TODAY"


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
Yep...that would be the trick.
Anatess,

Take a step back from the picture and you can see why your code would not work. A DEFINE establishes a virtual column and populates a value based on your expression for every record as it is retrieved from the database. If no records are retrieved, this value would never be calculated. COMPUTE would not work either because there are no records in the internal matrix on which to apply your expression.

Thus, Pat's suggestion to branch to some alternate code where a record would be retrieved. Something like
TABLE FILE CAR
PRINT COUNTRY NOPRINT
HEADING
"heading here"
WHERE READLIMIT EQ 1
stylesheet here
END

inserting your DEFINEs, images, HEADINGS, etc. as appropriate to express the "NO DATA" condition.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
How about using your first suggestion, EMPTYREPORT, and inserting the image in your HEADING via the STYLE sheet, like this:

TYPE=HEADING, IMAGE=MYLOGO.GIF, POSITION=(0 0), SIZE=(1.00 0.75),
ALT='This logo was placed here by Douglas Lee',$

Change the POSITION, which is shown to be in the upper left corner of the margins, and SIZE to match the actual size of the image. Note, the image size can be different then the actual size. However, it should match to ensure the correct / desired display and aspect ratio.

Or, use the Report / Image... from Report Painter which produces something like this:

TYPE=REPORT, IMAGE=flag_usa.bmp,$

-Doug




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
Okay, I went ahead and did like Prairie said... I checked &RECORDS and if it is 0 then I branched to a piece of code that reads FOCAPPQ (readlimit eq 1) and just display the header with No Data Available on detail.

Doug, I couldn't get the image to display from STYLESHEET. I don't know why. I even put the full http: address for the image, still no dice. I coded it just like your sample too. Maybe it doesn't work for compound Excel reports, I don't know...

How do I mark this thread [SOLVED]?


WF 8.1.05 Windows
Check this link for instructions on how to mark the post solved:

https://forums.informationbuilders.com/eve/forums/a/tpc/...1057331/m/9471069592


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google