Solved

Impromptu reports with .Net

Posted on 2004-04-23
2
790 Views
Last Modified: 2012-06-21
Title:  Impromptu reports with .Net

I am having trouble launching Impromptu reports.  I have an ASP.Net web application and Impromptu version 6.
When the process.start line is executed, nothing happens.  In debug, there is a beep.  Impromptu does not launch.  If I double-click the vbs file in windows the macro runs just fine.

I have tried simply:  process.start("Notepad.exe").  Notepad appears in the task manager but does not open a window.

Any idea what I'm missing?

Code Behind:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim myproc As System.Diagnostics.Process
        myproc = New System.Diagnostics.Process()
        myproc.EnableRaisingEvents = False
        Try
            myproc.Start("C:\Program Files\Cognos\cer1\samples\Impromptu\Macros\accounts.vbs")
        Catch err As Exception
            Response.Write(err.Message)
        End Try
    End Sub

.vbs file:  (this same code works fine as a macro with Impromptu open)
  CatalogLocation="q:\cp\cptools\catalogs\cattbe\test.cat"
  FileName="q:\cp\cptools\reports\rpt_tbe\test.imr"
  Set ImpAppObject = CreateObject("CognosImpromptu.Application")
  ImpAppObject.OpenCatalog CatalogLocation,"Creator","","dbusername","dbpassword"
  ImpAppObject.Visible 1
  Set ImpRepObject = ImpAppObject.Openreport(Filename)  
  ImpRepObject.RetrieveAll
  ImpRepObject.Print,,1
  ImpRepObject.CloseReport
  ImpAppObject.Quit
0
Comment
Question by:Weller0123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 23

Accepted Solution

by:
rama_krishna580 earned 500 total points
ID: 10907093

I did it with script. You can generate script from VB with parameters and then call impromptu report

Here si an example of a script

'IMR Reports
'Balance Sheet 2_2_8.imr
CatalogLocation = "F:\CognosApps\AR ATB\Catalog\ATB Reporting.CAT"
FileName = "F:\CognosApps\AR ATB\reports\Balance Sheet  2_2_8.imr"
Set ImpAppObject = CreateObject("Impromptu.Application")
ImpAppObject.OpenCatalog CatalogLocation, "Creator", "UserName", "UserPwd"
ImpAppObject.Visible 1
set ImpRepObject = ImpAppObject.Openreport (FileName)
'Print the report (FromPage, ToPage, Copies)
ImpRepObject.Print ,,1
ImpRepObject.CloseReport
ImpAppObject.Quit

write the txt file with a script. Include your params there and save this file as .vbs file

THen execute the vbs file (System.Diagnostic.....)


R.K
0
 

Author Comment

by:Weller0123
ID: 10919179
The vbs works fine stand alone.  But, when calling in the ASPNET, as below, nothing launches.  

Also, if I start("notepad.exe"), notepad appears in the task manager but does not open a window.  Are you using a windows application or a web application.  What version of Impromptu do you have installed?  Did you need to add any "Referencing" in the project?
 
Thanks

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myproc As System.Diagnostics.Process
myproc = New System.Diagnostics.Process()
myproc.EnableRaisingEvents = False
Try
myproc.Start("C:\Program Files\Cognos\cer1\samples\Impromptu\Macros\accounts.vbs")
Catch err As Exception
Response.Write(err.Message)
End Try
End Sub
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question