Focal Point
[SOLVED ISSUE] Excel Template and document composer

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

September 07, 2017, 11:42 AM
Geoff Fish
[SOLVED ISSUE] Excel Template and document composer
Has any one been able to get an Excel template to work inside Document Composer. I get an error message when trying to do this.

When I attempt to import it says FOC3289 and 3296 Error Opening file and Error found in Coordinated Compound Report. can this be gotten around?

I have used multiple Excel reports inside document composer previously without issue.

But, because of some unique formatting issues re: rounding of numbers a template would resolve this for me.

However if it is not possible for an Excel template and document composer to co-exist then I need to pursue other solutions. As a stand alone the template delivers the correct numbers and formatting , however I need to deliver it with another report on a single page format

This message has been edited. Last edited by: Geoff Fish,


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
September 07, 2017, 11:55 AM
BabakNYC
I'm not sure but maybe these links help you debug the issue:
https://techsupport.informatio...om/sps/81602527.html

https://techsupport.informatio...om/sps/81032542.html


WebFOCUS 8206, Unix, Windows
September 07, 2017, 11:58 AM
MartinY
quote:
because of some unique formatting issues re: rounding of numbers

What specific rounding issues you have that cannot be resolved with regular field format definition that can only be solved with a template ?

Please provide you code and highlight the field that need specific format.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
September 07, 2017, 03:19 PM
Geoff Fish
ONE ROW NEEDS PERCENT SIGN THE NEXT DOES NOT


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
September 07, 2017, 03:48 PM
MartinY
Why not using FPRINT function in a DEFINE and assign proper display format depending on the row ? It should avoid the need of a template

Something such as
DEFINE FILE CAR
NEW_RETAIL /A11 = IF COUNTRY EQ 'ITALY' OR 'ENGLAND' THEN FPRINT(RETAIL_COST, 'D7', 'A10') || '$' ELSE FPRINT(RETAIL_COST, 'D7', 'A10');
END
TABLE FILE CAR
PRINT RETAIL_COST
      NEW_RETAIL
BY COUNTRY
BY CAR
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=NEW_RETAIL, JUSTIFY=RIGHT, $
END



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
September 08, 2017, 03:58 AM
Tony A
You can also use a dynamic format to retain your fields as numeric. Especially important if you want subtotals - not sure how you would deal with a grand total in the example below as it would be irrelevant Wink

Note that the result of the dynamic format must be 'A8'. It can be any standard format with edit options, see this link

DEFINE FILE CAR
NEWFMT/A8 = DECODE COUNTRY ('ENGLAND' 'D12.2!L' 'JAPAN' 'D12.2!Y' ELSE 'D12.2!E')
END
TABLE FILE CAR
PRINT RETAIL_COST/NEWFMT
BY COUNTRY
BY CAR
END


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
September 08, 2017, 09:16 AM
J.L. Hinds
If I understand the problem correctly, try this...

ON TABLE HOLD AS &PPT_HOLD FORMAT XLSX TEMPLATE 'my_ppt_data.xlsm' SHEETNUMBER 1

That's the first report/tab in Excel. The next one will use the previous "&PPT_HOLD" as the template file.

-SET &PPT_HOLD = &NEW_HOLD || '2' || '';
-SET &LAST_HOLD= &NEW_HOLD || '1.xlsm';

And finally
ON TABLE HOLD AS &PPT_HOLD FORMAT XLSX TEMPLATE &LAST_HOLD SHEETNUMBER 2


WebFOCUS 7.6
Windows, All Outputs
September 08, 2017, 10:05 AM
Geoff Fish
J.L. That looks interesting and I will try it soon. An additional part of the problem that i uncovered is that web focus does not round like excel does. My customer had handed me a spreadsheet with MACROS both down and across . all was well except that he was only displaying 2 decimal places but in fact the calculations of the percent differential was more decimal places than that.

Also I may have left out that the SQL outputted the field as an A20

So this is the solution (abbreviated) that I came up with Sorry it may be awkward and I don't have time to do it against the car file but it works for now

PRINT
DETAIL AS 'Statistic'
FISCAL_DESC NOPRINT
ALUMNI_COUNT/A20 NOPRINT
COMPUTE CURRENT/A64 = STRIP(64, ALUMNI_COUNT, ',', CURRENT); NOPRINT
COMPUTE CURRENT1/A64 = STRIP(64, CURRENT, '%', CURRENT1); NOPRINT
COMPUTE CURRNUM/P12.5 = EDIT(CURRENT1); NOPRINT
COMPUTE CURRNUM1/P12.2% = EDIT(CURRENT1); NOPRINT
COMPUTE CURRNUM2/A20 = IF DETAIL_ORDER EQ 1 OR 2 THEN FTOA(CURRNUM1, '(D12)', 'A16') ELSE PTOA(CURRNUM, '(P4.2L)', 'A12') || '%'; AS 'This Year'
PRIOR_FISC_DESC NOPRINT
PRIOR_ALUMNI_COUNT/A20 NOPRINT
COMPUTE PREVIOUS/A64 = STRIP(64, PRIOR_ALUMNI_COUNT, ',', PREVIOUS); NOPRINT
COMPUTE PREVIOUS1/A64 = STRIP(64, PREVIOUS, '%', PREVIOUS1); NOPRINT
COMPUTE PREVNUM/P12.5 = EDIT(PREVIOUS1); NOPRINT
COMPUTE PREVNUM1/P12.2% = EDIT(PREVIOUS1); NOPRINT
COMPUTE PREVNUM3/A20 = IF DETAIL_ORDER EQ 1 OR 2 THEN FTOA(PREVNUM1, '(D12)', 'A16') ELSE PTOA(PREVNUM, '(P4.2L)', 'A12') || '%'; AS 'Last Year'
COMPUTE DIFF/D12.2% = ( ( CURRNUM - PREVNUM ) / PREVNUM ) * 100; AS '%Variance'

BY LOWEST GROUP_ORDER NOPRINT
BY LOWEST GROUP_NAME NOPRINT
BY LOWEST DETAIL_ORDER NOPRINT

This message has been edited. Last edited by: Geoff Fish,


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML