Solved

Impromptu reports with .Net

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Editing XSL files, 2 41
Get Reply from SSIS to intranet site when finished 3 33
How to deploy to IIS 7 on 2008R2 server with DUO 2-step login? 2 33
Host asp.net pages 5 25
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
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…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

912 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now