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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Impromptu Upgrade - Catalog issues

Status
Not open for further replies.

bflochick

MIS
Jul 9, 2002
49
US
Right now I am in testing mode on a updated test database (we are migrating from Costpoint 4.0 to 5.1). I have upgraded my Impromptu catalogs and placed them in a different directory (catalogs73). I attempted to use the report upgrade utility for all my impromptu reports, again they are in a seperate, copied, directory (reports73). They all upgraded sucessfully but when I open them, they automatically point to the old catalogs in the "catalogs" directory. Is there any way, aside from opening each individual report under the correct catalog and saving, to point all these reports to the right place? My options in Impromptu point to catalog 73, but these reports still want to open with the old catalogs. We have about 3000 reports out there that need to be upgraded and I am hoping there is an easier way.
 
write a macro which will open all imr reports in a certain directory. open report in impromptu, change catalog path, save report, close report and open new imr report (loop).

I can send you a marco (if you like) but i have it not stored on the computer i'm working from now.

good luck!



christenhusz
 
Thanks for the reply...Well seeing I don't know a thing about macros it would be much appreciated if you would send me one, when you get the chance.

Thanks again,
Christina
 
sorry one day late....

here is the macro: change the "NewCatalogPath" and "ReportDirectory" path to the correct value, compile the macro again and run. Always try the macro first on a copy of your reports... ;-)

Good Luck

'******************************************************************************
'* Date: 21-08-2004 *
'* Version: 1.0 *
'* Author: Martijn Christenhusz *
'* Description: *
'* *
'* With this macro you can change the catalog location of reports. *
'* 1 Open the catalog *
'* 2 Open the first report *
'* 3 Save the report *
'* 4 Close the report *
'* 5 Repeat step 2 to 4 until all the files are done *
'******************************************************************************

Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)

Sub Main()

Dim objImpApp As Object
Dim objImpRepp As Object

Dim NewCatalogPath As String
Dim ReportName As String
Dim FileName As String
Dim ReportDirectory As String

'Set new catalog path and report directory
NewCatalogPath = "C:\temp\RBI Outdoors new.CAT"
ReportDirectory = "C:\Temp\input\*.imr"

'open application and make application visable
Set objImpApp = CreateObject("Impromptu.Application")
objImpApp.Visible 1

'open catalog as catalog creator
objImpApp.OpenCatalog NewCatalogPath,"Creator","sa"

'Set directory to scan
FileName= Dir (ReportDirectory)

Do While FileName<>""
ReportName = mid(ReportDirectory,1,Len(ReportDirectory) -5) & FileName
Set objImpRepp = objImpApp.OpenReport (ReportName)
'Give Impromptu some time to open the report and retrieve the data.
Call Sleep(3000)

'Save the active report' the new catalog loaction will be saved.
objImpRepp.Save

'Close the active report
objImpRepp.CloseReport
FileName=Dir
Loop

'Close IMP
objImpApp.Quit

'Clear Memory
Set objImpRepp = Nothing
Set objImpApp = Nothing

End Sub

christenhusz
 
Thank you so much, I will try this out today. Your a life saver :eek:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top