Anybody can tell me how to add Cell Border?

Technical support for Spire.XLS

Moderators: iceblue support, Flash, Manager

Anybody can tell me how to add Cell Border?

Postby justinx1016 » Fri Dec 31, 2010 9:33 am

Hello, i was just wondering if someone knew the code to put a border around a range of cells

Thanks very much

Justin~
justinx1016
 
Posts: 4
Joined: Fri Dec 24, 2010 1:21 am

Re: Anybody can tell me how to add Cell Border?

Postby iceblue support » Fri Dec 31, 2010 10:09 am

Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[0];
sheet.Range["B2"].Text = "Home page";
sheet.Range["B2"].Borders.LineStyle = LineStyleType.Thin;
sheet.Range["B2"].Borders[BordersLineType.DiagonalDown].LineStyle = LineStyleType.None;
sheet.Range["B2"].Borders[BordersLineType.DiagonalUp].LineStyle = LineStyleType.None;
sheet.AutoFitColumn(2);
workbook.SaveToFile("Sample.xls");
System.Diagnostics.Process.Start("Sample.xls");


8)
e-iceblue support
User avatar
iceblue support
 
Posts: 244
Joined: Tue Dec 21, 2010 2:56 am


Return to Spire.XLS

Who is online

Users browsing this forum: No registered users and 1 guest

cron