Quantcast
Channel: NPOI
Viewing all articles
Browse latest Browse all 1621

Created Unassigned: Create word document with CreateRun using table [13500]

$
0
0
Hello,

We used your NPOI.dll and NPOI.OOXML.dll files for creating word document using asp.net mvc 4 C# web application.

We tried to generate document using table as we need to use font style, font size from our database so we need to use CreateParagraph and CreateRun() methods(if any other methods are available for font size,style for table cell as we need to use table format)
here, We are facing one issue.
same paragraph text is display at bottom of the table as shown in following text with italic font format and also in attached image file with red square marking.

__Person name__ Name 1
__Address__ Address 1

_Person name
Name 1
Address
Address 1_


Code:

XWPFTableRow r1 = t1.CreateRow();
p = doc.CreateParagraph();
run = p.CreateRun();
run.SetText("Person name");
run.SetBold(true);
run.FontFamily = "Courier";
run.FontSize = 10;
run.SetUnderline(UnderlinePatterns.Single);
r1.CreateCell().SetParagraph(p);

p = doc.CreateParagraph();
run = p.CreateRun();
run.SetText("Name 1");
run.SetBold(false);
run.FontFamily = "Courier";
run.FontSize = 10;
run.SetUnderline(UnderlinePatterns.Single);
r1.CreateCell().SetParagraph(p);

XWPFTableRow r2 = t1.CreateRow();
p = doc.CreateParagraph();
run = p.CreateRun();
run.SetText("Address");
run.SetBold(true);
run.FontFamily = "Courier";
run.FontSize = 10;
run.SetUnderline(UnderlinePatterns.Single);
r2.GetCell(0).SetParagraph(p);

p = doc.CreateParagraph();
run = p.CreateRun();
run.SetText("Address 1");
run.SetBold(false);
run.FontFamily = "Courier";
run.FontSize = 10;
run.SetUnderline(UnderlinePatterns.Single);
r2.GetCell(1).SetParagraph(p);


Waiting for your reply.

Thanking you

Jignesh patel

Viewing all articles
Browse latest Browse all 1621

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>