private void btnSpread_Click(object sender, System.EventArgs e)
{
//Dimension a Workbook and add a sheet to its Sheets collection
GrapeCity.SpreadBuilder.Workbook sb = new GrapeCity.SpreadBuilder.Workbook();
sb.Sheets.AddNew();
//Set up properties and values for columns, rows and cells as desired
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;
//Header row
sb.Sheets[0].Cell(0, 0).SetValue("Company Name");
sb.Sheets[0].Cell(0, 0).FontBold = true;
sb.Sheets[0].Cell(0, 1).SetValue("Contact Name");
sb.Sheets[0].Cell(0, 1).FontBold = true;
sb.Sheets[0].Cell(0, 2).SetValue("Phone");
sb.Sheets[0].Cell(0, 2).FontBold = true;
//First row of data
sb.Sheets[0].Cell(1, 0).SetValue("GrapeCity");
sb.Sheets[0].Cell(1, 1).SetValue("Mortimer");
sb.Sheets[0].Cell(1, 2).SetValue("(614) 895-3142");
GrapeCity.SpreadBuilder.Imaging.LineInfo l = new GrapeCity.SpreadBuilder.Imaging.LineInfo();
l.ColumnLeft = 3; //starting column for the line
l.Color = System.Drawing.Color.Salmon; //color for the line
l.ColumnRight = 8; //ending column for the line
l.dxL = 50;
l.dxR = 60;
l.dyB = 80;
l.dyT = 10;
l.EndAHLength = GrapeCity.SpreadBuilder.Imaging.LineArrowHeadLengths.Long; //length of the ending arrowhead
l.EndAHStyle = GrapeCity.SpreadBuilder.Imaging.LineArrowHeadStyles.DoubleEndedOpen; //style of the ending arrowhead
l.EndAHWidth = GrapeCity.SpreadBuilder.Imaging.LineArrowHeadWidths.Wide; //width of the ending arrowhead
l.fAuto = true;
l.iQu = GrapeCity.SpreadBuilder.Imaging.ObjectDirection.UpperLeftToLowerRight; //direction of the line
l.MoveType = GrapeCity.SpreadBuilder.Imaging.SBFloatingMoveType.MoveSize; //sets whether user will be able to move and/or resize the line
l.RowBottom = 8; //bottom row for the line
l.RowTop = 1; //top row for the line
l.StartAHLength = GrapeCity.SpreadBuilder.Imaging.LineArrowHeadLengths.Long; //length of the starting arrowhead
l.StartAHStyle = GrapeCity.SpreadBuilder.Imaging.LineArrowHeadStyles.DoubleEndedOpen; //style of the starting arrowhead
l.StartAHWidth = GrapeCity.SpreadBuilder.Imaging.LineArrowHeadWidths.Wide;
l.Style = GrapeCity.SpreadBuilder.Imaging.LineStyles.Dash; //style of the line
l.Weight = 5; //thickness of the line
sb.Sheets[0].AddLine(l);
//Save the Workbook to an Excel file
sb.Save(Application.StartupPath + @"\x.xls");
MessageBox.Show("Your Spreadsheet, " + sb.Sheets[0].Columns(0).OwnerSheet.Name + ", has been saved to " + Application.StartupPath + "\\x.xls");
}