Solved

Impromptu reports with .Net

Posted on 2004-04-23
2
781 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
Comment Utility

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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
javascript call 6 35
Azure Web App - See files 3 21
Server error in 'XXXXXXXX' application. 12 47
Duplicate a row 2 29
AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

8 Experts available now in Live!

Get 1:1 Help Now