(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")
'Add some line breaks between header and the grid
text = section1.AddText()
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)
e.Layout.Override.MinRowHeight = 5
For Each row As UltraGridRow In e.Layout.Rows row.Height = 10 Next
do you have the similar thing for ultrawebgridview ???
Since there is no e.layout.override.manual in for net.advantage asp.net
Hello Gerry,
Please do not hesitate to contact us if you have any other questions.
Thanks Danko,
I will give it a try.
I am not sure that you could "autofit" the rows into the section.
One thing that you could try is to resize the rows in order to try to achieve what you are looking for.
In the BeginExport event you are able to access the copy of the real layout through the event arguments like e.Layout and try to modify the rows height. You could try to suggestion below :
Please let me know if you have any other question on this matter.
Thanks Danko - that worked.
My next problem is that the grid doesn't export to one page anymore since I made the column header a little higher (I added another line of text to some column headers so its height is bigger). It nows outputs to the PDF 32 rows on one page and 2 rows on the next.
How can I get the grid to fit within the secion on 1 page.
Thanks, Gerry