Focal Point
[Solved] Same reports pointing to prod or test DB

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

February 17, 2010, 12:03 PM
paulI
[Solved] Same reports pointing to prod or test DB
Thank you all in advance for the great advice posted on this forum. Now to the question. We are in the process of upgrading our ERP system (Banner from SGHE). Is it possible to create a second set of synomoms (the origional pointing to production, the new set pointing to the new ERP) and use the same FEX and HTML? We are looking for a way to not copy the reports, just change the DB they point to when we go live. Also the users need to be able to run the same reports against the new ERP as we test. I have created an new connection but don't know where to go from here. Please advise.

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


Prod: WF 7.7.05, BID, MRE, 7.7.06M Server, Windows 2008, RedHat, Oracle 11gR1, MS Office 2010
Test: I wish we had one!
February 17, 2010, 02:12 PM
eb
In the apps path, where your synonyms are stored, if you open up the .acx file for a given synonym, you will see something
like: CONNECTION=connection_name

If you change the connection name to the newly created one (i.e. the new ERP system), any time you run a report with that synonym, you will go against the new connection.


Erfan
WF 7.6.5 / BID / Info Assist / Report Caster


WF 7.6.5 / BID / Info Assist / Report Caster - HTML/PDF/EXCEL
February 17, 2010, 02:42 PM
Francis Mariani
My advice is not to modify the metadata (synonyms) , but to have two app folders, each containing the metadata for one of the environments. You have added the data adapter connection so you can now generate the metadata from the WebFOCUS Server Console. Create a new app folder and select it as the destination folder for the new environment's synonyms.

When testing, to run a report using these new synonyms, you simply need to add the new folder to the App Path. You can do this temporarily by running the following code before running the fex:

APP PREPENDPATH testappname

quote:
The APP PREPENDPATH command enables you to temporarily add application names to the beginning of an existing APP PATH search path.


You could add a form object to the HTML launch forms so the user can select Prod or Test. If Test is passed to the report, execute the Prepend Path command.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
February 17, 2010, 04:19 PM
Waz
We edit the ACX files to remove specific DB stuff, then swap between DB's (Oracle for us)with the commands:

SQL SQLORA SET USER ...
SQL SQLORA SET SERVER ...


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!

February 18, 2010, 03:51 AM
GamP
Same with us, and we even go a little bit further.
We have created host headers in our web server for every instance of our database(s).
Then, in the initial htm file we check the url that was used to start. And based on the host header we compute the sql server data and send it along to the fex(es) that we execute. In the fex(es) we then can issue the correct SQL SQLMSS (we use MS sql server) commands based on the url.
One app - multiple databases - no changes. All based on the unique header name in the url.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
February 18, 2010, 11:23 AM
paulI
WOW. All great suggestions. Thanks to all. Francis, do you have a sample of the HTML launch for or can you point me in the correct direction? I am not very savvy with HTML. Waz, I thought the SQL SQLORA... commands were only for embedded SQL. Am I incorrect? If so, I will research on the lserv. I am sure there have been many posts on this topic. GamP, yours seems to go along with Waz but you carry it a bit further. Again, thanks to all.


Prod: WF 7.7.05, BID, MRE, 7.7.06M Server, Windows 2008, RedHat, Oracle 11gR1, MS Office 2010
Test: I wish we had one!
February 18, 2010, 03:17 PM
Waz
SQL SQLORA or SQLMSS, etc talk to the DB driver, so the commands can prepare the interface to your DB, and send the SQL as well.


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!

February 18, 2010, 04:06 PM
Francis Mariani
Bare minimum HTML:

<html>
<head>
</head>

<body>
<form id='frmRunFex' action="/ibi_apps/WFServlet" method="get" target="WebFOCUS">
<input type="hidden" name="IBIF_ex" value="test1">
Environment: Prod<input type="radio" name="ENV" value="PROD" checked> Test<input type="radio" name="ENV" value="TEST">

<INPUT TYPE="submit" VALUE="SUBMIT">
</form>
</body>

</html>

Bare minimum FEX:

-? &

-DEFAULT &ENV = 'PROD';

-SET &APPNAME = IF &ENV EQ 'PROD' THEN 'EDP' ELSE 'EDT';

APP PREPENDPATH &APPNAME
-RUN

TABLE FILE CAR
SUM
SALES
BY COUNTRY
END
-RUN

Since the Prod App Folder is already in the App Path, Prepending the Prod App Folder is superfluous, and it shouldn't hurt. The values you pass from the HTML form object ('PROD', 'TEST') could actually be the App Folder names, thus eliminating the Dialogue Manager -SET statement, changing the Prepend command to:
APP PREPENDPATH &ENV



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
February 24, 2010, 05:22 PM
paulI
To all who responded, thanks. One question. If I change the apppath via prependpath, does that change the app path for all users or just the one running the report? Also, is the app path set for all reports the user runs until they change it again? Example, user sets path to test. User runs several reports. Will the test app path be in effect for all reports?


Prod: WF 7.7.05, BID, MRE, 7.7.06M Server, Windows 2008, RedHat, Oracle 11gR1, MS Office 2010
Test: I wish we had one!
February 24, 2010, 05:35 PM
Darin Lee
If you're adding that to the focexec, it is actually only changed for that single request. Any subsequent requests, even by that user will not be affected. If you change it in the server config file, it is changed for every user and every request. The other option would be to add it to a user profile, which we have done in certain cases to restrict access, and then it remains in effect until the profile is changed again.


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
February 24, 2010, 05:38 PM
Darin Lee
Our solution to this was to configure a separate instance of the server that has it's own set of metadata, which is identical to prod but has a different connection string. Then we just specify the server where it should run (in MRE) or change the IBIC_server parameter. However this requires maintaining two sets of metadata. In our case that is sometimes useful as changes are migrated into test first and then into production later.


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
February 24, 2010, 06:05 PM
paulI
Darin, could you explain further changing IBIC_server. I had to create a duplicate set of metadata, thats no problem. We are doing a major upgrade of our erp and that just made more sense. What I am trying to avoid is having 2 set of reports (fex and html). The metadata is in the same folder (c:\ibi\apps) but using different names (prod... for current production and B8_prod.... for the new erp). Everyone has great ideas but I do not know html so I am kind of at a loss. The key for me is to not duplicate fex and html and allow the users to run against prod or test. Again, sorry for my questions, but without knowledge of 'new' technology, I ask dumb questions.


Prod: WF 7.7.05, BID, MRE, 7.7.06M Server, Windows 2008, RedHat, Oracle 11gR1, MS Office 2010
Test: I wish we had one!
March 01, 2010, 05:45 PM
paulI
Thanks all for the help. I ended up using a what Darin Lee suggested. Basically I add an include to the fex prompting the use for prod or test. Based on the answer, I overlay the apppath.
Again, thank you all very much.


Prod: WF 7.7.05, BID, MRE, 7.7.06M Server, Windows 2008, RedHat, Oracle 11gR1, MS Office 2010
Test: I wish we had one!