Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Impromptu reports with .Net

Posted on 2004-04-23
2
Medium Priority
?
808 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
2 Comments
 
LVL 23

Accepted Solution

by:
rama_krishna580 earned 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Suggested Courses
Course of the Month10 days, 10 hours left to enroll

886 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