|
-
May 18th, 2009, 12:30 PM
#1
Thread Starter
Member
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|