asked on
<%@ Register Assembly="CrystalDecisions.Web, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
<CR:CrystalReportViewer PrintMode="ActiveX" HasCrystalLogo="False" ID="CrystalReportViewer1" runat="server" AutoDataBind="true" />
Dim Report As ReportDocument
Report = New ReportDocument
Report.Load(Hosting.HostingEnvironment.MapPath("~/App_reports/report1.rpt"))
Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo
Dim myTables As Tables = Report.Database.Tables
Dim myTableLogonInfo As New TableLogOnInfo
With myConnectionInfo
.ServerName = Helpers.GetConfigSetting("CrystalDSN")
.DatabaseName = Helpers.GetConfigSetting("DefaultDatabaseName")
.UserID = Helpers.GetConfigSetting("DatabaseUser")
.Password = Helpers.GetConfigSetting("DatabasePassword")
.Type = ConnectionInfoType.SQL
End With
For Each myTable As CrystalDecisions.CrystalReports.Engine.Table In myTables
myTableLogonInfo = myTable.LogOnInfo
myTable.LogOnInfo.ConnectionInfo.AllowCustomConnection = True
myTableLogonInfo.ConnectionInfo = myConnectionInfo
myTable.ApplyLogOnInfo(myTableLogonInfo)
myTable.Location = Helpers.GetConfigSetting("DefaultDatabaseName") & ".dbo." & myTable.Location
Next
CrystalReportViewer1.ReportSource = Report
ASKER
The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications
TRUSTED BY
ASKER