Solved

Impromptu reports with .Net

Posted on 2004-04-23
2
797 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
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.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

617 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