TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
skanoko siame
NA
25
575
whats missing im using itext sharp to export wpf grid to pdf
Mar 22 2019 5:34 AM
PdfPTable table = new PdfPTable(dataGridCst.Columns.Count);
//Table header
BaseFont btnColumnHeader = BaseFont.CreateFont(BaseFont.TIMES_ROMAN, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
iTextSharp.text.Font fntColumnHeader = new iTextSharp.text.Font(btnColumnHeader, 10, 1, BaseColor.WHITE);
for (int i = 0; i < dataGridCst.Columns.Count; i++)
{
PdfPCell cell = new PdfPCell();
cell.BackgroundColor = BaseColor.GRAY;
cell.AddElement(new Chunk(dataGridCst.Columns[i], fntColumnHeader));// <<<< keeps showing a red line
table.AddCell(cell);
}
//table Data
for (int i = 0; i < dataGridCst.Items.Count; i++)
{
for (int j = 0; j < dataGridCst.Columns.Count; j++)
{
table.AddCell(dataGridCst.Items.ToString());
}
}
Reply
Answers (
1
)
save my string connection
Reading textbox value of third party application in c#