Focal Point
with one request can we get multiple pdf reports

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

June 05, 2013, 12:21 PM
santu
with one request can we get multiple pdf reports
Hi All,

I am generating PDF reports. When webfocus got one request, is it possible to send back two PDF reports to the user??


Web FOCUS 7.7.03
PDF
June 05, 2013, 02:24 PM
J
There are many ways to do this depending on what you want. If you mean the user is selecting search criteria and then you want two different pdf reports, look up html composer in the documentation. You can execute several reports at the same time in different windows,tabs, etc.


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
June 06, 2013, 03:16 AM
santu
I am having one html report. In that report print button is there. when user clicks on print button then it should return 4 PDF's but HTML report data wont be distributed to 4 PDF's. 4 PDF's having 4 different queries with different data but for these parameters are same.

So with one request can we call 4 FEX files which will give 4 PDF's?


Web FOCUS 7.7.03
PDF
June 06, 2013, 08:06 AM
J
Do you have Developer Studio?

If so, you should get familiar with the HTML Composer. It will do exactly what you want. Create a form and point the run button to execute the 4 different procedures.


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
June 06, 2013, 12:04 PM
santu
Sorry for the mistake.

when user clicks on JSP page then it should return 4 PDF report's.

From jsp page 1 request should go.
From webfocus 4 reports have to get.


Web FOCUS 7.7.03
PDF
June 06, 2013, 01:02 PM
J
Is that what you really want?

syntax: http ://webservername/ibi_apps/WFServlet?&IBIF_ex=test.fex


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
June 06, 2013, 01:11 PM
j.gross
Something has to fire off four requests, which will be fulfilled by separate agents on the webfocus reporting server, and targeted to different areas of a single page rendered in the browser. Right?

Have the fex called by JSP return an html page (that you created in dev studio), with four target regions (e.g., tabs), and have the page issue (without user action) the four fex calls, targeted to the four respective portions of the page.

That's the big picture. There are lots of details to attend to -- what event triggers the four requests, how to include parameters passed by JSP (if applicable) in those 4 calls, yada yada.


- Jack Gross
WF through 8.1.05
June 06, 2013, 01:44 PM
J
If you are going j.gross's route, the easiest thing to do for the html page created in dev studio is to have four ibi javascript execute calls to the different procedures.

In the documentation the syntax is:
   
IbComposer_execute('reportID', ['outputTarget']); 


The code goes in the OnInitialUpdate function.


OR do what I said initially and have a button pointing to the four reports and opening them in different tabs. In the OnInitialUpdate function just click that button so that it is automatically pressed on load.

Both solutions are easy and through the GUI except for OnInitialUpdate. If you don't want the html page to appear, have one of the reports point to _self while the others point to _blank

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


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
June 07, 2013, 10:19 AM
George Patton
It's quite likely that I misunderstand the issue, but what is so difficult about doing it as a single compound report? That would allow the parameters to be reused throughout and produce 4 outputs ...


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
June 07, 2013, 10:44 AM
santu
I tried with below as J mentioned.
IbComposer_execute('reportID', ['outputTarget']);

I tried to give the report name as a first argument for IbComposer_execute but it didn't worked for me.
I know reportID means not report name. but i need to open 4 FEX Files as outputs. So these FEX files dont have any report ID right?

I tried with OnInitialUpdate function by writing below lines inside.

window.open(rpt1,'_self');
window.open(rpt2,'_blank');
window.open(rpt3,'_blank');
window.open(rpt4,'_blank');

where rpt1,rpt2,rpt3 and rpt4 are different FEX file URL's. Window.open() solved my problem but Window.open() is proper way to solve it?

I don't know about below syntax.
IbComposer_execute('reportID', ['outputTarget']);

In my case i need to open FEX files. So What will be the reportID for FEX files?

George Patton: I want 4 reports in 4 different PDF's with one click but not in one PDF. I think you misunderstood.

Thanks j-gross and J for your reply.


Web FOCUS 7.7.03
PDF
June 07, 2013, 10:55 AM
J
Santu, the ibcomposer function expects the id of a frame that the reports are in,, you could create 4 frames pointing to the reports and hide them.

I wasn't talking about doing window.open. If you point the html composer button to the for reports and by creating a hyperlink through the gui it will execute those reports. Just click in oninitial update.

George's suggestion is probably best unless you absolutely have to have separate documents. In document composer compound report, you could have a table of contents and the user could click on the section they wish.


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
June 07, 2013, 12:11 PM
santu
Hi J,

Its great information.

Is there any other solution to get the reports as different documents instead of getting one report?


Web FOCUS 7.7.03
PDF
June 09, 2013, 01:14 PM
George Patton
Me, I like to do things the easy way:

Create a file for each report as follows:

First report:
-* File a_test1.fex

-SET &&CTRY=&COUNTRY;
-RUN

TABLE FILE CAR
PRINT DEALER_COST
BY COUNTRY
BY CAR
BY MODEL
WHERE COUNTRY EQ '&&CTRY'
ON TABLE SAVE AS 'C:\TEMP\DEALER.PDF' FORMAT PDF
END
-RUN

EX a_test2.fex
-RUN

The last line of the first report calls the second report.
Now make the second report
-* File a_test2.fex

TABLE FILE CAR
PRINT RETAIL_COST
BY COUNTRY
BY CAR
BY MODEL
WHERE COUNTRY EQ '&&CTRY'
ON TABLE SAVE AS 'C:\TEMP\RETAIL.PDF' FORMAT PDF
END
-RUN
-SET &&CTRY='';

! C:\TEMP\DEALER.PDF
-RUN
! C:\TEMP\RETAIL.PDF
-DONE


This should work for as many reports as you want and they will get displayed in sequence at the end of processing. The display phase could be in a separate FEX of course.

If you save as HTML the reports display as side-by-side tabs in the browser, which is kind of neat.

This message has been edited. Last edited by: George Patton,


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
June 09, 2013, 03:26 PM
FrankDutch
You might take a look at the report library function.




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