I migrate from Visual Studio 2003+Crystal Reports for Visual Studio .NET to Visual Studio 2012+SAP Crystal Report 2013.
When running the migrated program, The lower part of the Text is not visible.
Program is changing text field's font size at runtime. Text field's height is expanding, when run at vs2003. But vs2012 is not.
Please tell me the reason and how to solve the problem.
old environment:
Windows XP SP3
.Net Framework 1.1
Visual Studio 2003
Crystal Reports for Visual Studio .NET
new environment:
Windows7 SP1
.Net Framework 4.5
Visual Studio 2012
SAP Crystal Reports 2013 14.1.1.1036
sample code:
' MyReportClass is CrystalDecisions.CrystalReports.Engine.ReportClass
Dim report As New MyReportClass
' get FieldObject
Dim field As CrystalDecisions.CrystalReports.Engine.FieldObject
field = report.ReportDefinition.ReportObjects("textField1")
Debug.WriteLine(field.Height) ' design time height=208twip
' change font size at runtime from 10pt to 14pt
Dim font As New System.Drawing.Font(field.Font.FontFamily, 14)
field.ApplyFont(font)
Debug.WriteLine(field.Height) ' vs2003 height=280twip, vs2012 height=208twip
' set DataSource
Dim dt As New DataTable
dt.Columns.Add("textField1")
dt.Rows.Add("123456789")
report.SetDataSource(dt)
' viewer is CrystalReportViewer
viewer.ReportSource = report