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
Goran Bibic
474
2.9k
201.2k
Itextsharp pdf column setup c#
Jun 2 2018 1:04 PM
Some help
Sql column type is date
datagrid setup preview 19.09.2017
Datetimepicker format short value 19.09.2017
I need column date 19.09.2017 00:00:00 setup just date 19.09.2017
//Creating iTextSharp Table from the DataTable data
//Console.WriteLine(kifDataGridView.ColumnCount); test za itext sharp
PdfPTable pdfTable =
new
PdfPTable(kifDataGridView.ColumnCount);
pdfTable.DefaultCell.Padding = 3;
pdfTable.WidthPercentage = 100;
pdfTable.HorizontalAlignment = Element.ALIGN_LEFT;
pdfTable.DefaultCell.BorderWidth = 1;
float
[] sirina =
new
float
[] { 0f, 15f, 40f, 70f, 80f, 0f, 0f, 0f, 0f, 0f, 45f, 40f, 30f, 45f, 45f, 40f, 30f, 25f, 25f, 40f, 30f };
pdfTable.SetWidths(sirina);
BaseFont bfCalibri = BaseFont.CreateFont(
"c:\\windows\\fonts\\calibri.ttf"
, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
iTextSharp.text.Font calibri =
new
iTextSharp.text.Font(bfCalibri, 8);
iTextSharp.text.Font calibri2 =
new
iTextSharp.text.Font(bfCalibri, 7, iTextSharp.text.Font.NORMAL, iTextSharp.text.BaseColor.WHITE);
//Adding Header row
foreach (DataGridViewColumn column in kifDataGridView.Columns)
{
PdfPCell cell =
new
PdfPCell(
new
Phrase(column.HeaderText, calibri2));
cell.BackgroundColor =
new
iTextSharp.text.BaseColor(243,70,5);
pdfTable.AddCell(cell);
}
//Adding DataRow
foreach (DataGridViewRow row in kifDataGridView.Rows)
{
foreach (DataGridViewCell cell in row.Cells)
{
PdfPCell cell2 =
new
PdfPCell(
new
Phrase(cell.Value.ToString(), calibri));
pdfTable.AddCell(cell2);
}
}
Reply
Answers (
7
)
Usb bio-metric with c# open source
How can delete of Over write GDB