1
我正在爲類的項目工作,我們需要生成水晶報告。我正在使用Visual Studio 2013並使用Crystal Reports for SP15進行操作。我創建了一個報告,並在空白的asp.net webform上放置了一個水晶查看器,但是當我運行webform時,它要求輸入數據庫登錄信息。有沒有人遇到過這個問題,或任何人都可以幫助我嗎?謝謝!如何繞過Visual Studio 2013中Crystal Reports的登錄屏幕?
**這裏是我的webfrom頁面代碼:
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports System.Data
Imports System.Data.SqlClient
Partial Class Default2
Inherits System.Web.UI.Page
Dim MyReport As SqlConnection
Dim COMMAND As ReportDocument
Dim ALMOST As SqlCommand
Dim adp As SqlDataAdapter
Dim DT As DataSet
Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
Dim commandString As String = ConfigurationManager.ConnectionStrings("HouseSwappingConnectionString").ConnectionString
Using con As New SqlConnection(commandString)
Using cmd As New SqlCommand("Select * from ListTable", con)
cmd.CommandType = CommandType.Text
Dim da As New SqlDataAdapter(cmd)
Dim ds As New DataSet
da.Fill(ds)
Dim HouseSwap As New ReportDocument
HouseSwap.Load(Server.MapPath("CrystalReport.rpt"))
HouseSwap.SetDataSource(ds.Tables(0))
CrystalReportViewer1.ReportSource = HouseSwap
CrystalReportViewer1.DataBind()
CrystalReportViewer1.RefreshReport()
End Using
End Using
End Sub
好的,謝謝。我對ASP.net來說比較新,所以你能解釋一下我到底能找到我的服務器名稱,數據庫名稱和密碼嗎?我可能會對我所輸入的內容感到困惑。 –
查看連接字符串。 –