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] Printing in alternate pages in HTML format

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Printing in alternate pages in HTML format
 Login/Join
 
Member
posted
Hi,
I want the contents of the hold file should be printed in alternate pages i.e. 1,3,5. Is it possible to achieve it.
Thanks in advance.

TNVP.



WebFOCUS 7.1.4,Linux,
HTML,PDF,Excel,CSV

This message has been edited. Last edited by: T.N.V.Pandian,
 
Posts: 10 | Registered: September 29, 2008Report This Post
Virtuoso
posted Hide Post
What do you mean by "printed". By definition, hold files are not printed, so there's some other piece in there that is retrieving the records and outputting them to HTML, PDF, Excel, etc.


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
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Member
posted Hide Post
Darin,
Thank you for showing interest in my issue.Please have a look at the following code.

 

TABLE FILE CAR
PRINT COUNTRY 
CAR
ON TABLE HOLD
END

TABLE FILE HOLD
PRINT *
END
    


I have some data in hold file.By using the above code,the data get displayed in consecutive pages(Page no 1,2,3,4....).But,I want the data to be displayed in alternate pages(Page no 1,3,5,....).

Thanks,
TNVP



WebFOCUS 7.1.4,Linux,
HTML,PDF,Excel,CSV

This message has been edited. Last edited by: T.N.V.Pandian,
 
Posts: 10 | Registered: September 29, 2008Report This Post
<JG>
posted
This will do it for HTML

 TABLE FILE CAR
LIST COUNTRY 
CAR
ON TABLE HOLD
END
-RUN
SET LINES=10
-RUN
SET PAGE=NOPAGE
DEFINE FILE HOLD
PB/A100='<p style="page-break-before: always">';
XNUM/I9 =;
ODDPAGE/I9= IF LIST EQ 1 THEN 1 ELSE IF IMOD(E01,2,XNUM) EQ 1 THEN LAST ODDPAGE + 2 ELSE LAST ODDPAGE;
EVENPAGE/I9= ODDPAGE +1;
END
TABLE FILE HOLD
"PAGE  <ODDPAGE "
PRINT COUNTRY 
CAR 

FOOTING BOTTOM
"<PB PAGE  <EVENPAGE "
" "
"<PB "
END 
 
Report This Post
Member
posted Hide Post
JG,
Thanks for your valuable suggestion.It is working fine.But my requirement is as follows. I have data in two hold files.I want the data in hold file-1 to be displayed in page.no 1,3,5.. and data in hold file-2 to be displayed in page no 2,4,6..
One important thing is the number of coulmns in those two hold files are not equal.

Is it possible to achieve it.

Thanks in advance,
TNVP



WebFOCUS 7.1.4,Linux,
HTML,PDF,Excel,CSV
 
Posts: 10 | Registered: September 29, 2008Report This Post
<JG>
posted
That's a very different thing

The following will do what you want but it is unstyled

DATALINE which in my example is A40 should be the maximum total length of
the longest record


TABLE FILE CAR
LIST COUNTRY
CAR DEALER_COST RETAIL_COST
ON TABLE HOLD
END
-RUN
SET LINES=10
-RUN
SET PAGE=NOPAGE
FILEDEF PRINTFILE DISK PRINTFILE.FTM (APPEND
DEFINE FILE HOLD
ODDPAGE/I9= IF LIST EQ 1 THEN 1 ELSE IF IMOD(E01,2,'I9') EQ 1 THEN LAST ODDPAGE + 2 ELSE LAST ODDPAGE;
EVENPAGE/I9= ODDPAGE +1;
END
TABLE FILE HOLD
PRINT COUNTRY
CAR
BY ODDPAGE
BY E01
ON TABLE HOLD AS PRINTFILE FORMAT ALPHA
END
-RUN
TABLE FILE HOLD
PRINT COUNTRY
CAR
DEALER_COST RETAIL_COST
BY EVENPAGE
BY E01
ON TABLE HOLD AS PRINTFILE FORMAT ALPHA
END
-RUN
!DEL PRINTFILE.MAS
FILEDEF MASFILE DISK PRINTFILE.MAS (APPEND
-RUN
-WRITE MASFILE FILENAME=PRINTFILE, SUFFIX=FIX , $
-WRITE MASFILE SEGMENT=PRINTFIL, SEGTYPE=S2, $
-WRITE MASFILE FIELDNAME=PAGE, ALIAS=E01, USAGE=I9, ACTUAL=A09, $
-WRITE MASFILE FIELDNAME=LIST, ALIAS=E02, USAGE=I5, ACTUAL=A05, $
-WRITE MASFILE FIELDNAME=DATALINE, ALIAS=E03, USAGE=A40, ACTUAL=A40, $
-*
TABLE FILE PRINTFILE
PRINT DATALINE
BY PAGE PAGE-BREAK
BY E02
END
 
Report This Post
<JG>
posted
quote:
ODDPAGE/I9= IF LIST EQ 1 THEN 1 ELSE IF IMOD(E01,2,'I9') EQ 1 THEN LAST ODDPAGE + 2 ELSE LAST ODDPAGE;


I should have said the 2 should equal the number of lines of data on each page
 
Report This Post
Expert
posted Hide Post
If the output is PDF, you could do this with a compound report.

If you had 7.6.x you could use a coordinated compound report.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
I thought of the compound doc as well, but since you're generating each page as its own report, you would have to come up with some mechanism to tell you which record was the last one printed on the last odd-(or even-) numbered page to continue with the next page of the report. It could probably be done, but it seems like a very long way around to accomplish something that doesn't make much sense to me. (Yeah, I know - they're all just user requests regardless of how strange!)

I just cannot come up with a practical application for this requirement. It would be like combining two books into one - all the pages from book one show up on the left side of the page, all the pages from book two show up on the right. There would be no continuous flow when you read it so you would be skipping pages anyway. Just show everything that belongs to report one and THEN show everything that belongs to report two. And save yourself some time.


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
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Expert
posted Hide Post
If you are going to use a compound report, you will have to determine what record is on what page.

If the report is styled, does it have SUBHEAD/FOOTs or WHEN clauses, this will make it very difficult.

It can be done, I did it with one report once. A lot of calculations.

The only other option that I can think of is to save the HTML reports and post process them, determining the page blocks and then merging the two reports, very difficult.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Gold member
posted Hide Post
Hi,

Would the code below help? It should work as is in HTML and with PDF, you don't need the PB field and FOOTING, but instead the &option and FORMAT lines. Of course, the "page number" works correctly only if each report fits to one page.

Thanks to JG for the PB defintion.

Regards,
Mika

  
SET PAGE = NOPAGE
SET HOLDLIST = PRINTONLY
-* Odd pages.
TABLE FILE CAR
SUM SALES
COMPUTE CNTR/I3 = IF COUNTRY NE LAST COUNTRY THEN CNTR + 2 ELSE CNTR ; NOPRINT
COMPUTE PAGENO/I3 = CNTR - 1 ;
BY COUNTRY
BY CAR
BY MODEL
ON TABLE HOLD AS RPT1
END
-RUN 
-* Even pages.
TABLE FILE CAR
SUM SALES RETAIL_COST DEALER_COST
COMPUTE PAGENO/I3 = IF COUNTRY NE LAST COUNTRY THEN PAGENO + 2 ELSE PAGENO ;
BY COUNTRY
BY CAR
BY MODEL
ON TABLE HOLD AS RPT2
END
-RUN 
-* Max. page no.
TABLE FILE RPT2
SUM MAX.PAGENO
ON TABLE SAVE
END
-RUN
-READ SAVE &maxPage.A3.
-TYPE &maxPage
-REPEAT :doLoop FOR &ind FROM 1 TO &maxPage
-SET &XFile = IF IMOD(&ind,2,'I2') EQ 0 THEN 'RPT2' ELSE 'RPT1' ;
-*
-*-SET &option = IF &ind EQ 1 THEN 'OPEN' ELSE
-*-              IF &ind EQ &maxPage THEN 'CLOSE' ELSE '' ;

DEFINE FILE &XFile
PB/A100='<p style="page-break-before: always">';
END

TABLE FILE &XFile
PRINT *
WHERE PAGENO EQ &ind ;
HEADING
"Data file : &XFile"
"Page &ind"
" "
-IF &ind EQ &maxPage THEN GOTO :noFOOT ;
FOOTING
"<PB"
-:noFOOT

-*ON TABLE PCHOLD FORMAT PDF &option

ON TABLE SET STYLE *
TYPE=REPORT, SQUEEZE=ON, FONT=ARIAL, SIZE=9, $
ENDSTYLE
END
-RUN
-:doLoop


WebFOCUS 7.6.x
PMF 5.2.x
 
Posts: 58 | Location: Sydney, Australia | Registered: April 22, 2005Report This Post
Virtuoso
posted Hide Post
That's a good idea Mika, but as you mention, if any one of those sections of the report happen to span more than one page (which would be likely for anything except the car file), I think that breaks the whole thing.

As Waz mentions, any other solution is going to involve a ton of calculations and a lot of difficulty. My solution would be to rethink the layout of your output. There's got to be a better way than what you're proposing.


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
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Expert
posted Hide Post
Its a pity that the report output is HTML, I just remembered, that I did this exact thing @#$% years ago with WP format, much simpler as the output is relatively fixed and known.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
I can think of a functional use of this issue.
A report with more columns than you can handle on a page you might want to split it over two pages, where the rows are on both opposite pages are the same. (remember to start on page 2...) and print on the front and back site.
(or use A3 instead of A4)
If you know how many reporting lines you can have by page you can calculate the page numbers and print the fields on the odd or even pages depending on that page number.

I wonder if you can use the WHEN statement in this situation.

Can you suppress a column based on this??




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Member
posted Hide Post
Hi,

Thanks Darin,JG,Waz,Mika,Frank for your valuable suggestions.Mika's code helps us to meet the requirement.Having it as a reference ,we are working to achieve the exact requirement.

Frank, the functional use you said is exactly same as the one what we want.We are working on it.


Thank you once again.

TNVP



WebFOCUS 7.1.4,Linux,
HTML,PDF,Excel,CSV

This message has been edited. Last edited by: T.N.V.Pandian,
 
Posts: 10 | Registered: September 29, 2008Report This Post
Virtuoso
posted Hide Post
TNVP

did you ever try this code

ON TABLE SET BYPANEL ON ?

TABLE FILE CAR
PRINT 
     MODEL
     BODYTYPE
     SEATS
     DEALER_COST
     RETAIL_COST
     SALES
     LENGTH
     WIDTH
     HEIGHT
     WEIGHT
     WHEELBASE
     FUEL_CAP
     BHP
     RPM
     MPG
     ACCEL
BY COUNTRY
BY CAR
ON TABLE SUBHEAD
""
ON TABLE SUBFOOT
""
ON TABLE SET BYPANEL ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON


This will exactly do what you (we) need....

I was thinking that your problem should / would have been solved already.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Member
posted Hide Post
Frank,
Thanks.The code you gave is working fine in PDF but not with HTML.We need the output in HTML.

Thanks.
TNVP



WebFOCUS 7.1.4,Linux,
HTML,PDF,Excel,CSV
 
Posts: 10 | Registered: September 29, 2008Report 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] Printing in alternate pages in HTML format

Copyright © 1996-2020 Information Builders