Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Thu Mar 14, 2019 10:35 am

Hello,
I have a table which contains six rows,
the first row is the header, the followings contain other tables.
The main table border does not appear at the bottom of the table (it is partially covered by a textbox on the last row)
How can I correct it?

This is my code:
' Tariffa:
Dim tblTariffa As Table = SezBiglietto.Body.AddTable(True)

'Posizionamento della table, in modo che stia esattamente nei margini voluti:
tblTariffa.TableFormat.WrapTextAround = True
tblTariffa.TableFormat.Positioning.VertRelationTo = VerticalRelation.Margin
tblTariffa.TableFormat.Positioning.VertPosition = 260
tblTariffa.TableFormat.Positioning.HorizRelationTo = HorizontalRelation.Margin
tblTariffa.TableFormat.Positioning.HorizPosition = 378 '380

Dim hdrTariffa As String = Biglietto.hdrTariffa
'Predispone ed Aggiunge le righe e le celle VUOTE
tblTariffa.ResetCells(6, 1)

'testata tabella tariffa
tblTariffa.Rows(0).IsHeader = True
tblTariffa.Rows(0).Height = 30
tblTariffa.Rows(0).Cells(0).Width = 208
tblTariffa.Rows(0).Cells(0).CellFormat.BackColor = Drawing.Color.FromArgb(46, 49, 146) ' violone

'Definisce nessun bordo sotto ogni riga della table:
tblTariffa.TableFormat.Borders.Horizontal.BorderType = Spire.Doc.Documents.BorderStyle.None
'bordo sotto (bottom) la riga 0 della testata:
tblTariffa.Rows(0).Cells(0).CellFormat.Borders.Bottom.BorderType = Spire.Doc.Documents.BorderStyle.Thick

'Carica testo della riga di testata:
Dim parhdrTariffa As Paragraph = tblTariffa.Rows(0).Cells(0).AddParagraph()
fTiti11.TextColor = Drawing.Color.White
parhdrTariffa.AppendText(Biglietto.hdrTariffa).ApplyCharacterFormat(fTiti11)
tblTariffa.Rows(0).Cells(0).CellFormat.VerticalAlignment = VerticalAlignment.Middle

'riga con biglietto e prezzo biglietto:
tblTariffa.Rows(1).Cells(0).Width = 208
tblTariffa.Rows(1).HeightType = TableRowHeightType.Exactly
Dim parTariffaRiga1 As Paragraph = tblTariffa.Rows(1).Cells(0).AddParagraph()
tblTariffa.Rows(1).RowFormat.Paddings.All = 0
tblTariffa.Rows(1).RowFormat.Paddings.Top = 5

Dim tbBiglietto As TextBox = parTariffaRiga1.AppendTextBox(80, 30)
Dim parBiglietto As Paragraph = tbBiglietto.Body.AddParagraph()
parBiglietto.ApplyStyle(fTiti9st.Name)
parBiglietto.AppendHTML(Biglietto.lblBiglietto)
tbBiglietto.Format.HorizontalPosition = 0
tbBiglietto.Format.VerticalPosition = 0
tbBiglietto.Format.LineColor = Drawing.Color.White
tbBiglietto.Format.FillColor = Drawing.Color.White

Dim tbPrezzoBiglietto As TextBox = parTariffaRiga1.AppendTextBox(50, 30)
Dim parPrezzoBiglietto As Paragraph = tbPrezzoBiglietto.Body.AddParagraph()
parPrezzoBiglietto.ApplyStyle(fTiti9st.Name)
parPrezzoBiglietto.AppendHTML(Biglietto.lblPrezzoBiglietto)
parPrezzoBiglietto.Format.HorizontalAlignment = HorizontalAlignment.Right
tbPrezzoBiglietto.Format.HorizontalPosition = 150
tbPrezzoBiglietto.Format.VerticalPosition = 0
tbPrezzoBiglietto.Format.LineColor = Drawing.Color.White
tbPrezzoBiglietto.Format.FillColor = Drawing.Color.White

'riga con commissioni e prezzo commissioni:
tblTariffa.Rows(2).Cells(0).Width = 208
tblTariffa.Rows(2).HeightType = TableRowHeightType.Exactly
Dim parTariffaRiga2 As Paragraph = tblTariffa.Rows(2).Cells(0).AddParagraph()
tblTariffa.Rows(2).RowFormat.Paddings.All = 0
tblTariffa.Rows(2).RowFormat.Paddings.Top = 5

Dim tbCommissioni As TextBox = parTariffaRiga2.AppendTextBox(80, 30)
Dim parCommissioni As Paragraph = tbCommissioni.Body.AddParagraph()
parCommissioni.ApplyStyle(fTiti9st.Name)
parCommissioni.AppendHTML(Biglietto.lblCommissioni)
tbCommissioni.Format.HorizontalPosition = 0
tbCommissioni.Format.VerticalPosition = 0
tbCommissioni.Format.LineColor = Drawing.Color.White
tbCommissioni.Format.FillColor = Drawing.Color.White

Dim tbPrezzoComm As TextBox = parTariffaRiga2.AppendTextBox(50, 30)
Dim parPrezzoComm As Paragraph = tbPrezzoComm.Body.AddParagraph()
parPrezzoComm.ApplyStyle(fTiti9st.Name)
parPrezzoComm.AppendHTML(Biglietto.lblPrezzoCommissioni)
parPrezzoComm.Format.HorizontalAlignment = HorizontalAlignment.Right
tbPrezzoComm.Format.HorizontalPosition = 150
tbPrezzoComm.Format.VerticalPosition = 0
tbPrezzoComm.Format.LineColor = Drawing.Color.White
tbPrezzoComm.Format.FillColor = Drawing.Color.White

'riga con prezzo totale:
tblTariffa.Rows(3).Cells(0).Width = 208
tblTariffa.Rows(3).HeightType = TableRowHeightType.Exactly
Dim parTariffaRiga3 As Paragraph = tblTariffa.Rows(3).Cells(0).AddParagraph()
tblTariffa.Rows(3).RowFormat.Paddings.All = 0
tblTariffa.Rows(3).RowFormat.Paddings.Top = 10

Dim tbTotale As TextBox = parTariffaRiga3.AppendTextBox(120, 30)
Dim parTotale As Paragraph = tbTotale.Body.AddParagraph()
parTotale.ApplyStyle(fTiti9st.Name)
parTotale.AppendHTML(Biglietto.lblTotale)
parTotale.Format.HorizontalAlignment = HorizontalAlignment.Right
tbTotale.Format.HorizontalPosition = 0
tbTotale.Format.VerticalPosition = 0
tbTotale.Format.LineColor = Drawing.Color.White
tbTotale.Format.FillColor = Drawing.Color.White

Dim tbPrezzoTotale As TextBox = parTariffaRiga3.AppendTextBox(50, 30)
Dim parPrezzoTotale As Paragraph = tbPrezzoTotale.Body.AddParagraph()
parPrezzoTotale.ApplyStyle(fTiti9st.Name)
parPrezzoTotale.AppendHTML(Biglietto.lblPrezzoTotale)
parPrezzoTotale.Format.HorizontalAlignment = HorizontalAlignment.Right
tbPrezzoTotale.Format.HorizontalPosition = 150
tbPrezzoTotale.Format.VerticalPosition = 0
tbPrezzoTotale.Format.LineColor = Drawing.Color.White
tbPrezzoTotale.Format.FillColor = Drawing.Color.White

'riga con nota 1 alla tariffa:
tblTariffa.Rows(4).Cells(0).Width = 208
tblTariffa.Rows(4).HeightType = TableRowHeightType.Exactly
Dim parTariffaRiga4 As Paragraph = tblTariffa.Rows(4).Cells(0).AddParagraph()
tblTariffa.Rows(4).RowFormat.Paddings.All = 0
'tblTariffa.Rows(4).RowFormat.Paddings.Top = 10

Dim tbNota1 As TextBox = parTariffaRiga4.AppendTextBox(200, 20)
Dim parNota1 As Paragraph = tbNota1.Body.AddParagraph()
parNota1.ApplyStyle(fTiti9st.Name)
parNota1.AppendHTML(Biglietto.lblNotaTariffa1)
parNota1.Format.HorizontalAlignment = HorizontalAlignment.Right
tbNota1.Format.HorizontalPosition = 0
tbNota1.Format.VerticalPosition = 0
tbNota1.Format.LineColor = Drawing.Color.White
tbNota1.Format.FillColor = Drawing.Color.White

'riga con nota 2 alla tariffa:
tblTariffa.Rows(5).Cells(0).Width = 208
tblTariffa.Rows(5).HeightType = TableRowHeightType.Exactly
Dim parTariffaRiga5 As Paragraph = tblTariffa.Rows(5).Cells(0).AddParagraph()
tblTariffa.Rows(5).RowFormat.Paddings.All = 0
tblTariffa.Rows(5).RowFormat.CellSpacing = 0

Dim tbNota2 As TextBox = parTariffaRiga5.AppendTextBox(200, 20)
Dim parNota2 As Paragraph = tbNota2.Body.AddParagraph()
parNota2.ApplyStyle(fTiti9st.Name)
parNota2.AppendHTML(Biglietto.lblNotaTariffa2)
parNota2.Format.HorizontalAlignment = HorizontalAlignment.Right
tbNota2.Format.HorizontalPosition = 0
tbNota2.Format.VerticalPosition = 0
tbNota2.Format.LineColor = Drawing.Color.White
tbNota2.Format.FillColor = Drawing.Color.White

and here attached you can see the result, where the bottom border of table "Tariffa" is partially not visible.

Thank you for your help,
Paola

paolagumi
 
Posts: 81
Joined: Tue Apr 21, 2015 11:32 am

Fri Mar 15, 2019 2:44 am

Hi,

Thanks for your inquiry.
Since the last row's height is less than the textbox's height, the bottom border was covered by the textbox. To correct it, please add the following code to give the latest row a height higher than the textbox's height.
Code: Select all
'give the latest row a height
tblTariffa.Rows(5).Height = 25

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Fri Mar 15, 2019 8:00 am

Hi Nina,
thank you very much,
sorry I was mixed up!

best regards,
Paola

paolagumi
 
Posts: 81
Joined: Tue Apr 21, 2015 11:32 am

Fri Mar 15, 2019 8:14 am

Hi,

Thanks for your prompt reply.
Just feel free to contact us if you need further assistance.
Wish you all the best!

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.Doc

cron