<%@ 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
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.