SAP Knowledge Base Article - Public

1366307 - How do you modify Crystal Report page header field text horizontal alignment using the RDC?

Symptom

  • Crystal Reports Report Designer Component (RDC) SDK used to modify Crystal Reports.
  • How do you modify the horizontal alignment of text fields found in the Page Header?

Resolution

Specify the desired TextObject.HorAlignment value. Sample code:

Set oApp = CreateObject("CrystalRuntime.Application")
Set oRpt = oApp.OpenReport(RptFilePath, 1)

' For each Text Object in the Page Header section, specify desired Horizontal Alignment
For Each reportObject In oRpt.Sections("PH").ReportObjects
    If reportObject.Kind = 2 Then
        reportObject.HorAlignment = 0  ' 0 = default, 1 = left, 2 = center, 3 = right, 4 = justified
    End If
Next

Keywords

KBA , BI-DEV , Business Intelligence Software Development Kits (SDKs) , Problem

Product

SAP Crystal Reports XI R2