Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
445
Center header across page
posted

I have this code:

Dim report As New Report()

report.Info.Title = "Recycling Customer List"

Me.UltraGridDocumentExporter1.TargetPaperOrientation = Infragistics.Documents.Report.PageOrientation.PortraitDim section As ISection = report.AddSection()

section.PageAlignment.Horizontal = Infragistics.Documents.Report.Alignment.Center

Dim header As ISectionHeader = section.AddHeader()

header.Height = 30

header.AddText(0, 0).AddContent(
"Customer List")

header.Repeat = True

 

section.AddText().AddContent(" ")Me.UltraGridDocumentExporter1.Export(Me.UltraGrid2, section)

report.Publish(sfd.FileName.Trim, FileFormat.PDF)

 

it centers the grid just fine, but the header is still left alined. How do I center the header?

  • 37774
    posted

    You will need to set the alignment on the header's content in order to accomplish this, such as:

    Dim text As IText = header.AddText(0,0)

    text.Alignment.Horizontal = Alignment.Center

    text.AddContant("Customer List")

    -Matt