回复 22楼study1990的帖子
可以在导出时设置列宽:
- protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- return;
- this.FpSpread1.CommandBar.ShowPDFButton = true;
- this.FpSpread1.Sheets[0].PageSize = 10;
- this.FpSpread1.Sheets[0].ColumnCount = 20;
- this.FpSpread1.Sheets[0].RowCount = 30;
- for (int i = 0; i < 20; i++)
- {
- for (int j = 0; j < 20; j++)
- {
- this.FpSpread1.Sheets[0].Cells[j, i].Text = i.ToString() + "列" + j.ToString() + "行";
- }
- }
- }
- protected void FpSpread1_PrintPDF(object sender, FarPoint.Web.Spread.PrintPDFEventArgs e)
- {
- for (int i = 0; i < this.FpSpread1.Sheets[0].ColumnCount; i++)
- {
- this.FpSpread1.Sheets[0].Columns[i].Width = 20;
- }
- }
复制代码 |