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

Version 4 to Version 6 Upgrade

Status
Not open for further replies.

miketedescucci

Technical User
Apr 1, 2004
3
US
Hello all,

I was wondering if anyone knew of a way to upgrade Impromptu version 4 reports to version 6 without going through each and every report.

Thanks in advance,
Mike
 
Mike, I had the same hopes and questions when I went thru it 2 years ago. Unfortunately at that time, and I'm willing to bet it's the same situation, you have to upgrade them one at a time. Upgrade the catalogs, then upgrade the reports one by one. I had over 1,000 reports to do. Sorry to be the bearer of bad news.

Scott
 
Yeah, that is a bummer.. Considering they won't open up in v6 from v4. We don't have a copy of v5 to be the stopgap, unless someone knows of a way to go right from 4 to 6?

 
Mike, I just noticed your response on 4/2... if memory serves me (and I can't promise you that it does), but you should be able to upgrade the catalogs and reports straight from v4 to v6 without going thru v5.

I just looked thru my thin notes and I even have noted that with one particular problem I even tried going from v4 to v5 to v6 to see if that fixed a problem I had with a report going from v4 to v6.

By the way, one strange issue, if it hasn't been resolved, is that if you use a % wildcard in a prompt, you may receive an error message, try using %% and it should work.


Scott
 
We upgraded directly from v4 to v6 a few years back. I know for a fact that all we had the users do was open up the v4 report in v6.

We tend not to have particularly complicated reports, but I don't remember that I heard of ANY reports that upgraded with problems.
 
Depending on the number of reports you have, it may be worth your time to write a Cognos script to open each of the catalogs and upgrade, then open each of the reports and upgrade.
Cognos script is nearly identical to VB, and the documentation regarding the script language is reasonably good. If you've got any VB programmers, this should be pretty easy.

Pain is stress leaving the body

DoubleD
 
Here is a script to do the dull job.
First upgrade the catalog and change the constant values in the macro. The macro scans the therectory for imr files. The macro runs against the newest version. In the destination directory a rename_reports.bat is generated to rename the new converted reports to the original reportnames.

If youy have questions feel free..!

Martijn

option explicit

' ** CONSTANTS **
'
const EXTENTION = "~V7_1.imr"
const REPORTDIRECTORYPATH = "C:\Temp\input"
const ADMIN_NAME = "Administrator"
const ADMIN_PASSWORD = ""

const OFS_MAXPATHNAME = 128
const FATAL_ERROR = 100
const USERS_LOG_FILE = "rename_reports.bat"

' ** STRUCTS **
'
Type OFSTRUCT
cBytes As String*1
fFixedDisk As String*1
nErrCode As Integer
Reserved1 As Integer
Reserved2 As Integer
szPathName As String*OFS_MAXPATHNAME
End Type

' ** GLOBAL VARIABLES **
'
Dim giLineNumber As Integer
Dim gsInUsersFile As String
Dim gscmdline As String


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

'API function declarations
Declare Function OpenFile Lib "kernel32" (ByVal lpFileName As String, lpReOpenBuff As OFSTRUCT, ByVal wStyle As Long) As Long

'Log results to log file
Declare Sub LogMsg(strLog As String)

'Open log file and make headertext
Declare Sub StartLogFile

'Close log file
Declare Sub CloseLogFile

'Check if file exists
Declare Function FileExists(FileName As String) As Integer

' ** MAIN **
'
Sub Main()

Dim objImpApp As Object
Dim objImpRepp As Object
Dim ReportName As String
Dim NewReportName As String
Dim FileName As String
Dim NewFileName As String
Dim ReportDirectory As String
Dim count As Integer
Dim A()
Dim X

'Open log file
StartLogFile

'Set new catalog path and report directory
ReportDirectory = REPORTDIRECTORYPATH & "\*.imr"

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

count=1
ReDim A(1000)

'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.
NewReportName = mid(ReportName,1,Len(ReportName) -4) & EXTENTION
objImpRepp.Saveas NewReportName

NewFileName = mid(FileName,1,Len(FileName) -4) & EXTENTION

'write rename command to batchfile
gscmdline = "rename " & """" & NewFileName & """ " & """" & FileName & """"
LogMsg gscmdline

'Close the active report
objImpRepp.CloseReport

A(count)=FileName
count=count+1
FileName=Dir
Loop

'close logfile
CloseLogFile

'Close IMP
objImpApp.Quit

'Clear Memory
Set objImpRepp = Nothing
Set objImpApp = Nothing

End Sub

'write a string to the logfile
Sub LogMsg(strLog As String)
print #3, strLog
End Sub

'Check if CSV file exist
Function FileExists(FileName As String) As Integer
Dim RetCode As Integer
Dim OpenFileStructure As OFSTRUCT

Const OF_EXIST = &H4000
Const FILE_NOT_FOUND = 2

RetCode = OpenFile(FileName$, OpenFileStructure, OF_EXIST)
If OpenFileStructure.nErrCode = FILE_NOT_FOUND Then
FileExists = False
Else
FileExists = True
End If
End Function

'Open logfile and create logheader
Sub StartLogFile
Dim strLogFile As String

'Logfile = Users.log in the workdirectory
strLogFile = REPORTDIRECTORYPATH & "\" & USERS_LOG_FILE

'Delete old logfile with the same name
If FileExists(strLogFile) Then
Kill strLogFile
End If

'Open logfile for writing
Open strLogFile for Output As #3
LogMsg "@echo off"
LogMsg "echo\"
LogMsg "echo Renaming of files from Version 7.1"
LogMsg "echo\"
End Sub

'Close logfile
Sub CloseLogFile
LogMsg ""
End Sub

 
Martijn,

Nice macro. Lots of good ideas in it. However I see several issues I am curious how you handle. The first is the inability to pass a user class id and password. The dialog comes up when the macro is run. If you use a consistent class to be able to modify reports, you could use it to fill the dialog, but as you don't necessarily know which catalog will be opened, I think you would have to fill the dialog with SendKeys, rather than do it via an API call.

Secondly, there is the problem of reports with prompts. The report opens and stays at the prompt dialog. Again, a SendKeys call to accept the report defaults should fix this.

Overall a nice macro. I intend to work with it a bit and see if I can get it to flexibly handle my batch updates in the future.

Regards,

Dave Griffin



The Decision Support Group
Reporting Consulting with Cognos BI Tools
&quot;Magic with Data&quot;
[pc2]
Want good answers? Read FAQ401-2487 first!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top