Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script to change universe

Status
Not open for further replies.

pippotim

Programmer
Jul 10, 2003
8
IT
Hi,
I have a web page with a list of 16 report.
I have 50 replicas of this web page each one for a different city.
Every city has the same database on a different server.
I have 50 replicas of the universe for every server.
When I select a city, I must refresh the reports on the universe linked to that server.

How can I use a script (as link on web pages) that open the same 16 report and change the universe
in the queries for the selected city (So I have to manage only 16 report
instead of open and modify 16*50 reports)?
Have you any other way to resolve my problem?

Thanks
 
Hi,
the solution you have choose is a very cumbersome. You can do what you are askign through scripts but i would suggest you do some changes in the backend database.
I anm assuming you are using Oracle and suggesting this solution. the same concept however may be possible in different DB. Also i assume the structure of the tables in all the database is identical.
create a schema in Oracle DB which had DB links to the different database. create snonymn to each of the 16 tables representing your cities. create a view which is union of all the tables.
eg
select 'City1' , col1 from citytable1
union
slect 'City2' , col1 from citytable2
and so on. incase you have a column which already identifies each row and its source table then the first dummy column is not required.

create a universe using this table and also the class and objects.
create a single report which has section on cities. make the setup so that section start on new page.

therefore you end up having a single report and single universe to refresh and maintain.
 
Thanks Subhashab but
my problem is quite different.
I work with 50 IBM DB2 Universal Database v7
(the structure of the tables in all the databases is identical).
I cannot modify the databases (only view access).
The Report users can only refresh the 16 reports for their city.
There is no problem to manage the universes cause
I use dynamically linked universes (so I mantain 1 universe).
The user X open webpage of the city X, refresh the 16 different reports linked to the universe X.

I will put on the web server only 16 reports ( not 16*50)
and create on every webpage 16 links to something that isn't the report but a script or a macro or
something else that open the required report, change the universe to the right one and refresh it.
 
Hi pippotim-

You might want to check the option of having each signed used a different where clause on some database column of "city". You can do that within supervisor -> universe -> .. etc. I don't really remember the exact procedure...

Doing that, any user that uses the table that contains the "city" column, is automatically having a where clause filtering only "his" city.

I hope its clear enough to continue from here.

Cheers,
David
 
Hi, I think I have something for you.

You can create a simple BObjects script that can be edited once placed on a user's PC. That is - you create a scipt like this:
================
Sub Main

Dim myDoc As BODocument
Set myDoc = Application.Documents.Open ("ReportName")
' Create a data provider.
Dim myDP As BODataProvider
Set myDP = myDoc.DataProviders.AddQueryTechnique("UniverseName")
' Load this data provider in memory to increase speed.
myDP.Load

Dim myQuery1 As BOQuery
Set myQuery1 = myDP.Queries.Item(1)

end sub
===========

Although it says "add query technique", you cna use it on existing queries to change the universe designation. Just place this one as a *.spt file on your web page/FTP server. Add a function to the user application to pick it up from the page and edit
through the user application to replace "UniverseName" with the real name, and then activate the script from the same application (e.g. Shell command).

You can have it for all 16 reports in the same script.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top