我的代码将生成这样的 excel 文档
|id | Name | Address | company_Name | Destination|
|----|-------|----------|--------------|------------|
|##1 | xxx | xxxx | xxx | xxxxx |
但是我想要这样...
-----------------------------------------------------
| Personal Information | Working INFO |
-----------------------------------------------------
|id | Name | Address | company_Name | Destination|
|----|-------|----------|--------------|------------|
|##1 | xxx | xxxx | xxx | xxxxx |
-----------------------------------------------------
我从 API 获取数据,我将使用SaveFileDialog
SaveFileDialog dialog = new SaveFileDialog();
dialog.Title = "Save file as...";
dialog.Filter = "Text files (*.csv)|*.csv";
dialog.RestoreDirectory = true;
if (dialog.ShowDialog() == DialogResult.OK)
{
System.IO.StreamWriter writer = new System.IO.StreamWriter(dialog.FileName); //open the file for writing.
writer.Write(report); //write the current date to the file. change this with your date or something.
writer.Close(); //remember to close the file again.
writer.Dispose(); //remember to dispose it from the memory.
program.ShowInformationMessage("File Save successfully");
}
没有问题。
我想让标题像内联一样。