Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Compound Excel reports using template

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Compound Excel reports using template
 Login/Join
 
<Kev>
posted
I did a bit of searching, but couldn't find any satisfying answer to my issue. What I'm trying to do is generate a compound report (having three different tables) on a particular sheet of the template. This data will eventually be used by another sheet in the template, hence the template approach.
So, I'm trying to do something like following, but syntax doesn't work.
  
TABLE T1
PRINT *
ON TABLE PCHOLD FORMAT EXL2K NOBREAK
END

TABLE T2
PRINT *
ON TABLE HOLD AS TMPLT2 FORMAT EXL2K TEMPLATE 'TMPLT' SHEETNUMBER 1 CLOSE
END


If you feel I can tackle this better with a different approach, then please go ahead and suggest.

Thanks in advance.

This message has been edited. Last edited by: Kerry,
 
Report This Post
<JG>
posted
Kev there have been several threads regarding EXL2K TEMPLATE over the last month or so
so I'm very surprised that you say you can not find anything.

I would search again.

Particularly with regards to how to actually use templates which you do not seem to know.

But the basic for EXL2K compound template output is
your template must be applied to the first output and that must be used as
the template for the subsequent output
 
Report This Post
Expert
posted Hide Post
Kev,

You are trying to use compound (old style) reporting with a template and that just will not work.

Unless you can manage to combine your data into one manageable output then the single page output to template approach will not work. You would have to resort to outputting to two or more sheets.

The first question you have to ask yourself is how the combined data output from the compound portion of your code will be used? Are they in the same or similar formats - e.g. same number and formats of columns from two or more data sources?

For instance, if your data is designed to be one source within your excel file but comes from different data sources then something like this should achieve the single output that can be placed into a single sheet of a template -

APP PREPENDPATH IBISAMP
FILEDEF TEMPHLD1 DISK TEMPHLD1.FTM (APPEND
-RUN
TABLE FILE CAR
SUM COUNTRY/A30
    RCOST/D20.2
    DCOST/D20.2
 BY COUNTRY NOPRINT
ON TABLE HOLD AS TEMPHLD1 FORMAT ALPHA
END
TABLE FILE GGSALES
SUM REGION/A30
    DOLLARS/D20.2
    BUDDOLLARS/D20.2
 BY REGION NOPRINT
ON TABLE SAVE AS TEMPHLD1
END
TABLE FILE TEMPHLD1
PRINT *
END

This is a very simplistic form but the idea could be expanded to suit very many requirements.

If your requirement is data side by side then, again, use your imagination on how to achieve a single output -
APP PREPENDPATH IBISAMP
DEFINE FILE CAR
  SORTFLD/A30                 = COUNTRY;
  DCOST/D20.2                 = DEALER_COST;
  RCOST/D20.2                 = RETAIL_COST;
  DOLLARS/D20.2    MISSING ON = MISSING;
  BUDDOLLARS/D20.2 MISSING ON = MISSING;
END
DEFINE FILE GGSALES
  SORTFLD/A30            = REGION;
  DCOST/D20.2 MISSING ON = MISSING;
  RCOST/D20.2 MISSING ON = MISSING;
  DOLLARS/D20.2          = DOLLARS;
  BUDDOLLARS/D20.2       = BUDDOLLARS;
END
MATCH FILE CAR
SUM RCOST
    DCOST
    DOLLARS
    BUDDOLLARS
 BY SORTFLD
RUN
FILE GGSALES
SUM RCOST
    DCOST
    DOLLARS
    BUDDOLLARS
 BY SORTFLD
AFTER MATCH HOLD AS TEMPHLD1 OLD-OR-NEW
END
TABLE FILE TEMPHLD1
PRINT *
END

The answer is out there (I am sure that I've posted this sort of idea before) or think outside the box.

T

This message has been edited. Last edited by: Tony A,



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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Member
posted Hide Post
Kev,

Have you tried the OPEN command:


TABLE T1
PRINT *
ON TABLE PCHOLD FORMAT EXL2K OPEN
END

TABLE T2
PRINT *
ON TABLE PCHOLD FORMAT EXL2K CLOSE
END


7.6.4
windows
Excel2k and HTML.
 
Posts: 10 | Registered: April 02, 2008Report This Post
<JG>
posted
GrEaT_DeBaTeOPEN is not resolve Kev's basic problem.

When creating a compound EXL2K TEMPLATE output you cannot use compound syntax of any sort.

An EXL2K TEMPLATE compound document is a pseudo compound document,
created, as both Tony and I have said above.
Subsequent outputs have to use the previous output as their template.
 
Report This Post
<Kev>
posted
JG & Tony,
The intuition behind my flawed syntax is: ouput of T1 is held on (until `CLOSE' is encountered) so that output of T2 is appended right after on the template sheet. I confess it's completely experimental. If I output on same sheet, it overwrites earlier output .
I've used templates earlier to capture full power of VBA, but have needed to output only one table per sheet.
For this case, however, two or more unidentical (one with three columns(A10, D20.2, A5), second with two columns (D10.2, A5), and so on...) need to be captured on one sheet.
I could output these tables on different sheets and use VBA to stick 'em together, but I'm looking for a better solution than that.

Thanks!
 
Report This Post
<JG>
posted
Kev,

If you want vertical data added and new sheets you can use compound.
However if you want columns added then the only option is template and macro.
 
Report This Post
Expert
posted Hide Post
quote:
For this case, however, two or more unidentical ............ need to be captured on one sheet.
Do they need to be vertically above one another, column one lining up with column one? If not then you could use either of my suggestions above. If they have to align then perhaps you could think about using FTOA etc to convert the columns so that you could use the suggestions?

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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
<Kev>
posted
I went ahead with the suggested route by Expert Tony, and am all set.

Thanks!
 
Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Compound Excel reports using template

Copyright © 1996-2020 Information Builders