Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 24th, 2006, 10:49 PM
Registered User
 
Join Date: Feb 2004
Location: , , Philippines.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to thiNkspAce
Default dialog display when viewing the report

why is it that when i have join statement in my query string and run my report there's a dialog box will show asking for Server Name, Database, User Name and Password? but if i read on 1 table in the database it works fine. im using the cr which is bundled in visual studio .net. i really have trouble with this and i need ur help. i tried searching in google but i haven't found any answer. any suggestions or code snippet will be greatly appreciated!

regards

Reply With Quote
  #2 (permalink)  
Old March 27th, 2006, 01:53 AM
Authorized User
 
Join Date: Sep 2005
Location: Hydrabad, AP, India.
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to vijaykumartaduri Send a message via Yahoo to vijaykumartaduri
Default

Hi,

  You need to provide DB details explicitly to the report.

Try with below block
'-----------------------------

 Private Sub LogOnReport(ByVal cr As CrystalDecisions.CrystalReports.Engine.ReportDocum ent)
        Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
        Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo
        For Each myTable In cr.Database.Tables
            myLogin = myTable.LogOnInfo
            myLogin.ConnectionInfo.ServerName = strInfo(0)
            myLogin.ConnectionInfo.DatabaseName = strInfo(1)
            myLogin.ConnectionInfo.UserID = strInfo(2)
            myLogin.ConnectionInfo.Password = strInfo(3)
            myTable.ApplyLogOnInfo(myLogin)
          Next
'If report has any subreports then use this
        Dim RepObject As CrystalDecisions.CrystalReports.Engine.ReportObjec t
        Dim SubRepDoc As CrystalDecisions.CrystalReports.Engine.SubreportOb ject
        Dim RepDoc As CrystalDecisions.CrystalReports.Engine.ReportDocum ent
        For Each RepObject In cr.ReportDefinition.ReportObjects
            If RepObject.Kind = CrystalDecisions.Shared.ReportObjectKind.Subreport Object Then
                SubRepDoc = CType(RepObject, CrystalDecisions.CrystalReports.Engine.SubreportOb ject)
                RepDoc = cr.OpenSubreport(SubRepDoc.SubreportName)
                For Each myTable In RepDoc.Database.Tables
                    myLogin = myTable.LogOnInfo
                    myLogin.ConnectionInfo.ServerName = strInfo(0)
                    myLogin.ConnectionInfo.DatabaseName = strInfo(1)
                    myLogin.ConnectionInfo.UserID = strInfo(2)
                    myLogin.ConnectionInfo.Password = strInfo(3)
                    myTable.ApplyLogOnInfo(myLogin)
                  Next
            End If
        Next

    End Sub

'----------------------------


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Report Exception Error when viewing aquiintac VB Components 0 November 7th, 2007 11:12 PM
MFC App fails trying to display a dialog cont pkam Visual C++ 1 August 16th, 2007 10:55 AM
Image appears as red 'X' when viewing a report usi brunoals Crystal Reports 0 September 28th, 2006 10:36 AM
viewing MS Access report from VB 6.0 jthadathilm16 Pro VB Databases 1 May 4th, 2006 08:15 PM
Viewing Crystal Report sorted by CustomerId ronbora Crystal Reports 0 November 18th, 2004 10:07 AM



All times are GMT -4. The time now is 04:58 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.