Keep font style when adding row to a table

Technical support for Spire.Doc

Moderator: iceblue support

Keep font style when adding row to a table

Postby catalin » Fri Jun 22, 2012 8:52 am

Hello,
as the title of the topic suggests, im trying to add new rows to a table.
I managed to identify the table in this way:
Code: Select all
dim t as Table = document.Bookmarks("something").BookmarkEnd.Owner.Owner.Owner.Owner


Is there a more elegant way to do it? I tried to do it with t.TableDescription or t.Title, but it didn't seem to work.
Anyway...
I already have a table header, and a first row inserted. So now i want to add new rows. I do it this way:
Code: Select all
Dim row As Spire.Doc.TableRow = t.LastRow.Clone
t.Rows.Add(row)


So now i have a new row, where i can insert text values in it's cells. The problem is, that the cloned row doesn't keep it's font style, the new row will have allways Arial 10 or something. So i have to set it manually for each row:
Code: Select all
Dim txtRange As Spire.Doc.Fields.TextRange = t.LastRow.Cells(0).Paragraphs(0).AppendText(value1)
txtRange.CharacterFormat.FontName = "Tahoma"
txtRange.CharacterFormat.FontSize = 10


Is there a way so that i can add new rows, and the font style to remain the same?

Thank you very much.
catalin
 
Posts: 48
Joined: Wed Mar 14, 2012 12:56 pm

Re: Keep font style when adding row to a table

Postby amy.zhao » Wed Jun 27, 2012 9:19 am

Hi catalin,

Thanks for evaluating Spire.Doc.

As the issue you reported, we have created a research on it, but we need some more time to fix it. I can not provide you any reliable estimate regarding it's complexity. However, you will be surely informed once we fix it.

Thanks for your understanding and cooperation.

Have a nice day.
-----------------------------------------------------
Amy.Zhao
e-iceblue support
User avatar
amy.zhao
 
Posts: 2251
Joined: Wed Jun 27, 2012 8:50 am

Re: Keep font style when adding row to a table

Postby amy.zhao » Fri Jun 29, 2012 6:14 am

Hi, catalin

About your problem, I have written a demo and attched here. You can refer to it. If you still have any problems, please contact me!
You do not have the required permissions to view the files attached to this post.
User avatar
amy.zhao
 
Posts: 2251
Joined: Wed Jun 27, 2012 8:50 am

Re: Keep font style when adding row to a table

Postby catalin » Thu Jul 12, 2012 7:13 am

Well, got it, still my first question remained unanswered.

I have a word document template, and inside 3 tables. I put a bookmark into a table, "something".

The question is, is there another way to identify my table, other than: document.Bookmarks(bookmark).BookmarkEnd.Owner.Owner.Owner.Owner ?
Thank you.
catalin
 
Posts: 48
Joined: Wed Mar 14, 2012 12:56 pm

Re: Keep font style when adding row to a table

Postby amy.zhao » Thu Jul 12, 2012 7:57 am

Hi, catalin

Thanks for your feedback and so sorry for the inconvenience caused by us.
About your problem, we will send you a demo as soon as possible. Thank you for your cooperation and understanding.

Have a nice day.
........................................................................................................................................................................................................
Amy
e-iceblue support

welcome to contact us!
amy.zhao@e-iceblue.com
support@e-iceblue.com
User avatar
amy.zhao
 
Posts: 2251
Joined: Wed Jun 27, 2012 8:50 am

Re: Keep font style when adding row to a table

Postby amy.zhao » Thu Jul 12, 2012 8:27 am

Hi, catalin

Thanks for your patience.
About your problem, we have done a lot of research. So sorry that there is no other ways to identify the table in Spire.Doc.

Have a gerat day!

.....................................................................................................................................................................
Amy
e-iceblue support

welcome to contact us!
amy.zhao@e-iceblue.com
support@e-iceblue.com
User avatar
amy.zhao
 
Posts: 2251
Joined: Wed Jun 27, 2012 8:50 am

Re: Keep font style when adding row to a table

Postby catalin » Thu Jul 12, 2012 8:33 am

Ok, thank you very much for your research & support. After all, my method is not so bad :)
catalin
 
Posts: 48
Joined: Wed Mar 14, 2012 12:56 pm

Re: Keep font style when adding row to a table

Postby amy.zhao » Thu Jul 12, 2012 8:48 am

Hi, catalin

You are welcome! :lol:
..........................................................................................................................................................................................................
Amy
e-iceblue support

welcome to contact us!
amy.zhao@e-iceblue.com
support@e-iceblue.com
User avatar
amy.zhao
 
Posts: 2251
Joined: Wed Jun 27, 2012 8:50 am


Return to Spire.Doc

Who is online

Users browsing this forum: No registered users and 0 guests

cron