Hi, I'm a newbie in VB.Net, need some help here. I'm generating a report and view it in a win app, which is in VB.Net. I've specified the database logon info by the following code:
*************************************************
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim crtableLogoninfo As New TableLogOnInfo()
Dim crConnectionInfo As New ConnectionInfo()
Dim CrTables As Tables
Dim CrTable As Table
Dim TableCounter
Dim crReportDocument As New cr1()
With crConnectionInfo
.ServerName = "mydb"
.UserID = "myuserid"
.Password = "mypassword"
End With
CrTables = crReportDocument.Database.Tables
For Each CrTable In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
CrTable.ApplyLogOnInfo(crtableLogoninfo)
Next
CrystalReportViewer1.ReportSource = crReportDocument
End Sub
*****************************************************
It's an Oracle DB and just one table, suppose to be very simple. But whenever the app starts, this "Database Login" window always opens first, asking for server info, db info, user name and password. Actually if I click "Cancel", the report still get generated. So how to get rid of this annoying "Database Login" window?
My second question is, how to automatically send this report to printer? I know in VB6 you just say action=1. Unfortunately this thing doesn't work in .Net any more.
Thanks!Just look through CrystalReport knowledgebase, seems that this is a known issue. Refer to this article:
http://support.businessobjects.com/library/kbase/articles/c2010461.asp
Is there already a fix for this ?|||Figured this out by carefully reading this article: http://support.businessobjects.com/library/kbase/articles/c2010461.asp
The Form_new method has to be overwritten, adding some customized initialization, where ser/uid/pass can be specified.
**** I just took it for granted to do it in Form_load...
Showing posts with label window. Show all posts
Showing posts with label window. Show all posts
Monday, March 12, 2012
Wednesday, March 7, 2012
How to get non-html format data to open in a new window
I am totally new to reporting services and am struggling with how to
accomplish something. I have an aspx page that needs to display the
html format version of a report on the bottom portion of the page and
then provide a drop down list from which the user can select another
format and an export button. When the user clicks a new format (pdf,
csv, etc) and then the export button, I need for the report to pop open
in a new window. I have succeeded in getting the report to come out on
the bottom part of the page but have no idea how to get the other
formats to pop open in a new page. I am coding in vb - can someone
point me in the right direction.You could use window.open(URL) method to open in a new window
"lisa.bogart@.eds.com" wrote:
> I am totally new to reporting services and am struggling with how to
> accomplish something. I have an aspx page that needs to display the
> html format version of a report on the bottom portion of the page and
> then provide a drop down list from which the user can select another
> format and an export button. When the user clicks a new format (pdf,
> csv, etc) and then the export button, I need for the report to pop open
> in a new window. I have succeeded in getting the report to come out on
> the bottom part of the page but have no idea how to get the other
> formats to pop open in a new page. I am coding in vb - can someone
> point me in the right direction.
>
accomplish something. I have an aspx page that needs to display the
html format version of a report on the bottom portion of the page and
then provide a drop down list from which the user can select another
format and an export button. When the user clicks a new format (pdf,
csv, etc) and then the export button, I need for the report to pop open
in a new window. I have succeeded in getting the report to come out on
the bottom part of the page but have no idea how to get the other
formats to pop open in a new page. I am coding in vb - can someone
point me in the right direction.You could use window.open(URL) method to open in a new window
"lisa.bogart@.eds.com" wrote:
> I am totally new to reporting services and am struggling with how to
> accomplish something. I have an aspx page that needs to display the
> html format version of a report on the bottom portion of the page and
> then provide a drop down list from which the user can select another
> format and an export button. When the user clicks a new format (pdf,
> csv, etc) and then the export button, I need for the report to pop open
> in a new window. I have succeeded in getting the report to come out on
> the bottom part of the page but have no idea how to get the other
> formats to pop open in a new page. I am coding in vb - can someone
> point me in the right direction.
>
Subscribe to:
Posts (Atom)