[SOLVED] Displaying Data from 2 Data Sources in a single Excel Document
I've got a possible requirement to consolidate data from multiple sources (Postgres and MYSQL as an example) and display below below one another in the same Excel report. Now, when I did initial tests in HTML and WP format, they worked fine. However, when I changed them to EXL2K, it only showed the first data set (sort of skipped the second one)
Is there a possible way to achieve this? Anyone had to do something similiar? I've prepared some sample code any pointers would be appreciated. Thanks
SET EMPTYREPORT=ON
-* From Postgres
ENGINE SQLPSTGR SET DEFAULT_CONNECTION reports
ENGINE SQLPSTGR SET VARCHAR OFF
SQL SQLPSTGR PREPARE SQLOUT FOR
SELECT * from industry limit 10;
END
-RUN
TABLE FILE SQLOUT
PRINT *
HEADING
"Data From Postgres DB"
ON TABLE PCHOLD FORMAT EXL2K FORMULA
END
-* From T2
ENGINE SQLMYSQL SET DEFAULT_CONNECTION t2
ENGINE SQLMYSQL SET VARCHAR OFF
SQL SQLMYSQL PREPARE SQLOUT FOR
SELECT * from supplier limit 10;
END
-RUN
TABLE FILE SQLOUT
PRINT *
HEADING
"Data From MySQL DB"
ON TABLE PCHOLD FORMAT EXL2K FORMULA
END
This message has been edited. Last edited by: touch,
WebFOCUS 7.6 Windows, All Outputs
January 21, 2014, 10:28 PM
jvb
If there is requirement to display multiple reports in one excel sheet then it needs to be implemented using compound reports.Following code may help to achieve the requirement.Here the compound report has been implemented using ON TABLE PCHOLD FORMAT EXL2K OPEN NOBREAK and ON TABLE PCHOLD FORMAT EXL2K CLOSE hope this helps SET EMPTYREPORT=ON
-* From Postgres ENGINE SQLPSTGR SET DEFAULT_CONNECTION reports ENGINE SQLPSTGR SET VARCHAR OFF SQL SQLPSTGR PREPARE SQLOUT FOR
SELECT * from industry limit 10; END -RUN
TABLE FILE SQLOUT PRINT * HEADING "Data From Postgres DB" ON TABLE PCHOLD FORMAT EXL2K OPEN NOBREAK END
-* From T2 ENGINE SQLMYSQL SET DEFAULT_CONNECTION t2 ENGINE SQLMYSQL SET VARCHAR OFF SQL SQLMYSQL PREPARE SQLOUT FOR
SELECT * from supplier limit 10; END -RUN
TABLE FILE SQLOUT PRINT * HEADING "Data From MySQL DB" ON TABLE PCHOLD FORMAT EXL2K CLOSE END
WF 8.1.04,Infoassist,Oracle, Excel, PDF,HTML.
January 21, 2014, 11:07 PM
touch
Thanks jvb
It helps now. Just to add-on if I wanted them on 2 separate sheets (tabs) with Postgre on one tab and MySQl on another how would we break that? (I'm anticipating this could crop up later)
WebFOCUS 7.6 Windows, All Outputs
January 21, 2014, 11:45 PM
Rifaz
Remove NOBREAK and try
-Rifaz
WebFOCUS 7.7.x and 8.x
January 22, 2014, 12:02 AM
touch
whoa worked like a charm.
Thanks guys. Just love these forums. (and taking notes of each issue that i encounter for future reference)