12-02-24, 03:37 PM
كود :
Imports System.Globalization
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' Create an instance of your Crystal Report
Dim report As New ReportDocument()
report.Load("Path_to_your_report_file.rpt")
' Set the culture to Arabic
Dim arabicCulture As CultureInfo = CultureInfo.CreateSpecificCulture("ar")
System.Threading.Thread.CurrentThread.CurrentCulture = arabicCulture
' Set the locale ID for Crystal Report
report.SetDatabaseLogon("username", "password")
Dim tables As Tables = report.Database.Tables
Dim connectionInfo As New ConnectionInfo()
' Set the locale for each table in the report
For Each table As Table In tables
connectionInfo = table.LogOnInfo
connectionInfo.LocaleID = CType(arabicCulture.LCID, Integer)
table.ApplyLogOnInfo(connectionInfo)
Next
' Set the Crystal Report Viewer's report source to the modified report
CrystalReportViewer1.ReportSource = report
End Sub
End Class
