Hello,
Sorry for late reply as weekend.
Thanks for your feedback. Sorry for inconvenience, we will correct the codes in our site. And for your requirement, please download the
Spire.xls7.4 product and refer the following codes.
- Code: Select all
DataTable table = new DataTable();
foreach (ListViewItem item in listView1.Items)
{
table.Columns.Add(item.ToString());
foreach (var it in item.SubItems)
table.Rows.Add(it.ToString());
}
Workbook book = new Workbook();
Worksheet sheet = book.Worksheets[0];
sheet.InsertDataTable(table, true, 1, 1);
sheet.Range.BorderAround();
sheet.Range.BorderInside();
book.SaveToFile("result.pdf",FileFormat.PDF);
If there are any questions, welcome to get it back to us.
Sincerely,
Gary
E-iceblue support team