Crystal Reports Runtime »

// Apply to all tables foreach (CrystalDecisions.CrystalReports.Engine.Table table in report.Database.Tables) { TableLogOnInfo logOnInfo = table.LogOnInfo; logOnInfo.ConnectionInfo = connInfo; table.ApplyLogOnInfo(logOnInfo); }

Requires CrystalDecisions.CrystalReports.Engine and CrystalDecisions.Shared DLLs (SAP Crystal Reports runtime for .NET). crystal reports runtime

// Set parameters if needed report.SetParameterValue("@StartDate", DateTime.Now.AddDays(-30)); report.SetParameterValue("@EndDate", DateTime.Now); // Apply to all tables foreach (CrystalDecisions

using CrystalDecisions.CrystalReports.Engine; using CrystalDecisions.Shared; // Load the report ReportDocument report = new ReportDocument(); report.Load(@"C:\Reports\MyReport.rpt"); logOnInfo.ConnectionInfo = connInfo

// Assign to CrystalReportViewer crystalReportViewer1.ReportSource = report;

Here’s a showing how to load and set a database connection for a Crystal Reports report at runtime in a .NET application (C#):

// Set database logon info ConnectionInfo connInfo = new ConnectionInfo(); connInfo.ServerName = "YOUR_SQL_SERVER"; connInfo.DatabaseName = "YourDatabase"; connInfo.UserID = "yourUser"; connInfo.Password = "yourPassword";

Accept
crystal reports runtime
crystal reports runtime
  • Cookie Policy

    When you visit any website, the website may store or retrieve information on your browser, mostly in the form of Cookies. This information may be about you, your preferences, or your device, or it may be used to make the website work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience.

    More Information
  • Essential CookiesAlways Enabled

    These cookies are essential components required for the operation of our website, so they cannot be disabled in our system. These cookies are set based on your instructions and are considered as your service requests, such as logging in.