Read-Only Topic
|
' and it retrieved all the different reports, but also added a ton of extra Recovered_Sheets. How did you decide what the WANTED defined needed to look for? I would appreciate any help you can give me!!
Thanks!!
Renee
Posts: 5 | Registered: May 06, 2003 |
<JG> |
I was very neglectful of replying to Rlmuell on this because of workload. Fortunately he sent a private message and brought his issue to my attention so that I could try and help. To create a compound Excel up to the Microsoft limit of 64K the following is a variation on my original code and accommodates multiple excels in the same sheet and not just two. ________________________________________________________________________ For multiple Excel documents the important thing is only selecting the table components for the reports after the first document, except for the last where you need the closing body and html tags as well. (slightly cryptic but you will see what I mean) I have coded up an extended example that generates a single excel containing 30 reports. (It's just a simple loop of the same static code for the example but all you need to do is have numbered reports and -INCLUDE them) Notice the first part of the process is outside of the loop and the define in the loop has been extended to ensure that we only get the closing body and html tags for the last report. -* File excelappend.fex FILEDEF EXCEL DISK EXCEL.MAS -RUN -* -* write your dummy master to allow Focus to read the .XHT file as input -* -WRITE EXCEL FILE=EXCEL ,SUFFIX=FIX -WRITE EXCEL SEGNAME=EXCEL ,SEGTYPE=S0 -WRITE EXCEL FIELDNAME =DATALINE ,E01 ,A256 ,A256 ,$ -RUN FILEDEF Z DISK c:\ibi\apps\focalpoint\excelappend.xls (APPEND -RUN TABLE FILE CAR "Report 1" PRINT MODEL ON TABLE HOLD AS X FORMAT EXL2K END -RUN FILEDEF EXCEL DISK x.xht -RUN DEFINE FILE EXCEL WANTED/A1= IF EDIT(DATALINE,'9999999') EQ '</BODY>' THEN 'N' ELSE IF LAST WANTED EQ 'N' THEN 'N' ELSE 'Y'; END TABLEF FILE EXCEL PRINT DATALINE WHERE WANTED EQ 'Y'; ON TABLE SAVE AS Z FORMAT ALPHA END -RUN -SET &REPORT =1; -********************************************************************************* -* At this point you do a -INCLUDE REPORT&REPORT NOT just a loop on sataic code. The 29 is because this -* is what was needed for the requirement. There is no maximum Except respecting the Microsoft 64K rows limit. -********************************************************************************* -REPEAT ENDREPEAT 29 TIMES -SET &REPORT =&REPORT +1; TABLE FILE CAR " " "Report &REPORT" PRINT MODEL BY COUNTRY ON TABLE HOLD AS Y FORMAT EXL2K END -RUN FILEDEF EXCEL DISK y.xht -RUN DEFINE FILE EXCEL WANTED/A1= IF EDIT(DATALINE,'9999999') EQ '<TABLE' THEN 'Y' ELSE IF (&REPORT EQ 30) AND (LAST WANTED EQ 'Y') THEN 'Y' ELSE IF (LAST WANTED EQ 'Y') AND (EDIT(DATALINE,'9999999') EQ '</BODY>') THEN 'N' ELSE IF LAST WANTED EQ 'Y' THEN 'Y' ELSE 'N'; END TABLEF FILE EXCEL PRINT DATALINE WHERE WANTED EQ 'Y'; ON TABLE SAVE AS Z FORMAT ALPHA END -RUN -ENDREPEAT -********************************************************************************* -HTMLFORM BEGIN <html> <head> <title>EXCEL2K Compound </title> </head> <frameset rows="*"> -*************************************************************************************************** -* REMBER use your server address -*************************************************************************************************** <frame name="EXCEL2K" src="http://localhost/approot/focalpoint/excelappend.xls" scrolling="auto" > <noframes> <body> <p>This page uses frames, but your browser doesn't support them.</p> </body> </noframes> </frameset> </html> -HTMLFORM END Hope it helps others.This message has been edited. Last edited by: <JG>, | ||
Member |
JG, Your solution worked great for me. I am now only generating one worksheet on the excel. Thanks! Renee WebFOCUS 7.6.10 | |||
|
Platinum Member |
Another solution, it may already be posted, but you can also use the following script at the top of each report that is in format EXL2K. This worked extremely well for me: First report: SET COMPOUND = 'OPEN NOBREAK' [REPORT TEXT] ON TABLE PCHOLD FORMAT EXL2K END Second report: SET COMPOUND = NOBREAK [REPORT TEXT] ON TABLE PCHOLD FORMAT EXL2K END . . . Last report: SET COMPOUND = CLOSE [REPORT TEXT] ON TABLE PCHOLD FORMAT EXL2K END Again this works very well for multiple report, I created a report with more than 5 reports and it all fit within the limit of the Excel rows (remember, Excek only allows 65536 rows of data!) However, I would like to know if there is a way to create a report that outputs multiple Excel "files", or at least multiple reports in one "file" but separate "sheets". Unless all reports are in exactly the same format, I really don't see a major advantage of exporting multiple files into one Excel file on the same "sheet". Thanks! | |||
|
Member |
This worked like a charm. Thank you. Annette Bradley Lead Systems Analyst/Programmer Prod: WebFOCUS 7.1.0 Test: WebFOCUS 7.1.0 | |||
|
Platinum Member |
Horay, I like! Someone use search to find solution. It work! Big aplause Kofi Client Server 8.1.05: Apache; Tomcat;Windows Server 2012 Reporting Server 8.1.05; Oracle; MS SQL; Windows Server 2012 | |||
|
Powered by Social Strata |
Please Wait. Your request is being processed... |