ActiveReport for .net 出力Excel文件的问题
我用ActiveReport出力Excel文件,在rpx模板上设置的格式,但出力出来的Excel
文件看起来特别乱:
我是这样做的
这是我写的excel处理代码:
private void Form1_Load(object sender, System.EventArgs e)
{
rptExports rpt = new rptExports();
this.viewer1.Document = rpt.Document;
rpt.Run(false);
xlsExport1.AutoRowHeight = true;
xlsExport1.DisplayGridLines = true;
xlsExport1.FileFormat = DataDynamics.ActiveReports.Export.Xls.FileFormat.Xls97Plus;
xlsExport1.MinColumnWidth = 360;
xlsExport1.MinRowHeight = 250;
xlsExport1.MultiSheet = true;
xlsExport1.RemoveVerticalSpace = true;
xlsExport1.UseCellMerging = false;
xlsExport1.Export(rpt.Document, "D:\\x.xls");
}
XlsExport这个控件本身只能设置上面几种属性,我想在向让Excel出力的格式和rpx模板文件一样,而且还能设置Excel边框之类的
下面是设置Excel属性的:
private void Form1_Load(object sender, System.EventArgs e)
{
DataDynamics.SpreadBuilder.Workbook sb = new DataDynamics.SpreadBuilder.Workbook();
sb.Sheets.AddNew();
sb.Sheets[0].Name = "Customer Call List";
sb.Sheets[0].Columns(0).Width = 2 * 1440;
sb.Sheets[0].Columns(1).Width = 1440;
sb.Sheets[0].Columns(2).Width = 1440;
sb.Sheets[0].Rows(0).Height = 1440/4;
sb.Sheets[0].Cell(0,0).SetValue("会社名");
sb.Sheets[0].Cell(0,0).FontName = "MS UI Gothic";
sb.Sheets[0].Cell(0,0).FontBold = true;
sb.Sheets[0].Cell(0,1).SetValue("部署名");
sb.Sheets[0].Cell(0,1).FontName = "MS UI Gothic";
sb.Sheets[0].Cell(0,1).FontBold = true;
sb.Sheets[0].Cell(0,2).SetValue("電話番号");
sb.Sheets[0].Cell(0,2).FontName = "MS UI Gothic";
sb.Sheets[0].Cell(0,2).FontBold = true;
sb.Sheets[0].Cell(1,0).SetValue("グレープシティ");
sb.Sheets[0].Cell(1,0).FontName = "MS UI Gothic";
sb.Sheets[0].Cell(1,1).SetValue("営業部");
sb.Sheets[0].Cell(1,1).FontName = "MS UI Gothic";
sb.Sheets[0].Cell(1,2).SetValue("(022) 777-8210");
sb.Save (Application.StartupPath + @"\x.xls");
MessageBox.Show(Application.StartupPath + @"\x.xls" + "へ保存しました。");
}
怎样才能保证模板上的那一块出力到Excel哪一块,还有牵扯到跨行等问题,比如说,我在report模板上面一个textbox值,想出力到excel上,我想让它规定处理到那一行哪一列,跨几行,跨几列,等,如何解决~
这方面资料很少,还有,哪位兄弟有关于ActiveReport for .net中文帮组文档。急呀!我开始装的是中文版,在开始菜单里看不见,没有帮组文档,现在用的是日文的,看不懂,那位兄弟棒下忙 多谢了!~~~~~~~~