Results 1 to 3 of 3

Thread: Report requiring more info

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2007
    Posts
    56

    Question Report requiring more info

    IDE : VS 2008,
    Platform : .NET 3.5,

    I created a crystal report and added it to my VS2008 web application. I thought I did it the same as all the other reports I've done , but I keep getting this screen asking for more information. It asks for Server, Database, and User names, and a password, a checkbox to Use Integrated Security and a Log On button. Here's the code I used for the web app report page:

    Code:
    Imports CrystalDecisions.CrystalReports.Engine 
    Imports DWITools 
    Imports System.Net.Mail 
    Imports System.Data.SqlClient 
    Imports System 
    Imports DBLayer 
    
    Partial Class PrintER 
        Inherits System.Web.UI.Page 
        Dim Rep As New CrystalDecisions.CrystalReports.Engine.ReportDocument 
        Dim DBObj As New JobMastModel.DBClasses.DBTools 
    
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 
            lblerid.Text = Session("erid") 
            lblname.Text = Session("name") 
    
            If Not IsPostBack Then 
                 
            Else 
                If Not Session("ReportData") Is Nothing Then 
                    Rep.Load(Request.PhysicalApplicationPath & "Reports\ER.rpt") 
    
    
                    Rep.SetDataSource(Session("ReportData")) 
                    crViewER.ReportSource = Rep 
                    'crView.DataBind() 
    
                End If 
                'RunReport() 
            End If 
    
            BuildReport() 
        End Sub 
    
        Private Function GetSqlConnection() As SqlConnection 
            ' Retreives a valid unopened Sql Connection object 
            Return New SqlConnection("Server=DWDATA2;Database=DWJobInfo;User ID=DWWEB;Password=53B33TL3;") 
        End Function 
    
        ''Private Rep As New ReportDocument 
    
        Private Sub BuildReport() 
    
            'Dim dc As New DWData 
            Dim dt As Data.DataTable 
    
            'dt = dc.db.CreateDT("SELECT * FROM tblERmain WHERE er_id = '" & lblerid.Text & "'", DBTools.DB.M2M) 
    
            dt = DBObj.CreateDT("SELECT * FROM tblERmain WHERE er_id = '" & lblerid.Text & "'", DBTools.DB.DW) 
    
            Rep.Load(Request.PhysicalApplicationPath & "Reports\ER.rpt") 
    
            ' dc.Close() 
    
            Rep.SetDataSource(dt) 
    
            Session.Add(Request.PhysicalApplicationPath & "ReportData", dt) 
    
            crViewER.ReportSource = Rep 
    
        End Sub 
    
        Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload 
            Rep.Close() 
            Rep.Dispose() 
        End Sub 
    End Class
    The ER.rpt report has multiple smaller reports inside of it. That's the one thing that i can think of that's different than the other reports i've created that work perfectly fine. does anyone know why it's asking for more information?

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Report requiring more info

    because the credentials need to be passed to the sub reports.... setting the credentials/connection on the parent report doesn't automatically propagate it down to the sub-reports (why I don't know, it is what it is....)

    You'll need to loop through all of the reports/subreports and set their connection appropriately.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2007
    Posts
    56

    Re: Report requiring more info

    how exactly do i do that?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width