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
165
Documents.Report - UltraGridDocumentExporter Grid doesn't fit nice on PDF
posted

(VB.NET - 2008) I create a report add a header/footer and then when I try and export a grid I can't get it to fit nicely on the page - either too small or will run over to the next page. Also if the grid has a couple of more columns it throws off the formatting.

I generate anywhere from 1 to 10 grids in the PDF

The grid has 16 columns and 33 rows (including header and summary row)

How can I have it take up the width of the page and maximize the space between the header and footer so the grid is readable and doesn't overlap into another page?

 

 

 

 

 

 

 

Dim report As Infragistics.Documents.Report.Report = New Report()

Dim

 

section1 As Infragistics.Documents.Report.Section.ISection = report.AddSection()

 

Dim sectionHeader As Infragistics.Documents.Report.Section.ISectionHeader = section1.AddHeader()

sectionHeader.Repeat = True

sectionHeader.Height = 20

 

'Header Text

 

Dim sectionHeaderText As Infragistics.Documents.Report.Text.IText = sectionHeader.AddText(0, 0)

 

Dim headerStyle As New Text.Style(New Font("Arial", 12, FontStyle.Bold), Brushes.Maroon)

sectionHeaderText.Style = headerStyle

sectionHeaderText.Paddings.All = 0

sectionHeaderText.Alignment =

New TextAlignment(Alignment.Center, Alignment.Top)

sectionHeaderText.Background =

New Background(Brushes.LightGray)

sectionHeaderText.AddContent("Header 1 info")

 

 

 

sectionHeaderText.AddLineBreak()

sectionHeaderText.AddContent(

'SET UP THE FOOTER

 

Dim sectionFooter As Infragistics.Documents.Report.Section.ISectionFooter = section1.AddFooter()

sectionFooter.Repeat =

True

sectionFooter.Height = 40

 

'Footer Text/Image

 

Dim sectionFooterText As Infragistics.Documents.Report.Text.IText = sectionFooter.AddText(0, 0)

 

Dim img As New Image(My.Resources.VanguardShipIcon)

 

Dim s As New Size(80, 40)

sectionFooterText.AddContent(img, s, ImageAlignment.Right)

"Header 2 info")

 

"Header 2 info")

 

'SET UP THE FOOTER

 

Dim sectionFooter As Infragistics.Documents.Report.Section.ISectionFooter = section1.AddFooter()

sectionFooter.Repeat =

True

sectionFooter.Height = 40

 

'Footer Text/Image

 

Dim sectionFooterText As Infragistics.Documents.Report.Text.IText = sectionFooter.AddText(0, 0)

 

Dim img As New Image(My.Resources.VanguardShipIcon)

 

Dim s As New Size(80, 40)

sectionFooterText.AddContent(img, s, ImageAlignment.Right)

 

 

 

 

'Add some line breaks between header and the grid

text = section1.AddText()

text.AddLineBreak()

text.AddLineBreak()

text.AddLineBreak()

 

Me.UltraGridDocumentExporterDetailGrid.TargetPaperSize = Infragistics.Documents.Report.PageSizes.Legal

 

Me.UltraGridDocumentExporterDetailGrid.AutoSize = DocumentExport.AutoSize.None

 

Me.UltraGridDocumentExporterDetailGrid.TargetPaperOrientation = PageOrientation.Landscape

 

Me.UltraGridDocumentExporterDetailGrid.Export(Me.ugPortfolioReport, section1)

Me.UltraGridDocumentExporterDetailGrid.Export(Me.ugPortfolioReport, section1)