I am trying to create a table in which the first three rows are row headers and have a row height of 37, 27, and 27. The remaining rows would have a row height of 17.
It seems like my code is only using the first row setting, 37, and every other row becomes that as well.
Additionally, I cannot get my first three rows to repeat on each page. Below is my cod in which I’m only showing a single column whereas I really have 8 columns.
Dim license As New Aspose.Words.License
license.SetLicense(“Aspose.Total.lic”)
Dim doc As Aspose.Words.Document = New Aspose.Words.Document()
Dim builder As New DocumentBuilder(doc)
Dim rowFormat As Tables.RowFormat = builder.RowFormat
rowFormat.Height = 37 'THIS IS USED FOR ALL ROWS
rowFormat.HeadingFormat = True 'SUPPOSED TO MAKE ROW REPEAT PER PAGE, BUT THIS FAILS.
Dim font As Aspose.Words.Font = builder.Font
font.Name = “Calibri”
font.Size = “14”
font.Bold = True
builder.StartTable()
builder.InsertCell()
builder.Write(“DLB Proposal Log”)
builder.EndRow()
rowFormat.ClearFormatting()
rowFormat.Height = 27
rowFormat.HeadingFormat = True
font.Name = “Calibri”
font.Size = “11”
font.Bold = True
builder.InsertCell()
builder.Write(“Proposal”)
builder.EndRow()
rowFormat.ClearFormatting()
rowFormat.Height = 27
rowFormat.HeadingFormat = True
font.Name = “Calibri”
font.Size = “11”
font.Bold = False
builder.InsertCell()
builder.Write(“Number”)
builder.EndRow()
While dr.Read
rowFormat.ClearFormatting()
rowFormat.Height = 10
rowFormat.HeadingFormat = False
rowFormat.AllowBreakAcrossPages = False
font.Name = “Arial”
font.Size = “8”
font.Bold = False
builder.InsertCell()
builder.Write(dr.Item(“Proposal_Number”).ToString)
builder.CellFormat.FitText = True
builder.EndRow()
End While
builder.EndTable()
For iSectCount = 0 To doc.Sections.Count - 1
doc.Sections(iSectCount).PageSetup.BottomMargin = “21.6”
doc.Sections(iSectCount).PageSetup.TopMargin = “21.6”
doc.Sections(iSectCount).PageSetup.LeftMargin = “21.6”
doc.Sections(iSectCount).PageSetup.RightMargin = “21.6”
doc.Sections(iSectCount).PageSetup.Orientation = Aspose.Words.Orientation.Landscape
doc.Sections(iSectCount).PageSetup.PaperSize = Aspose.Words.PaperSize.Letter
Next
Dim pdfSaveOptions As Aspose.Words.Saving.PdfSaveOptions = New Aspose.Words.Saving.PdfSaveOptions()
doc.Save("C:\WholeProposalLog - " & Format(Now, “yyyy-MM-dd-h-mm-ss”) & “.pdf”, pdfSaveOptions)