You can use the Spread 8 COM control in Microsoft Visual Studio 2015 with Microsoft Windows 10. Spread Windows Forms is a .NET control and is a better option; however, you may have older code or projects where you need to use Spread 8 COM. Use the following steps to create a new project in Visual Studio 2015 and add the Spread 8 COM control.
- Select File, New, and then Project in Visual Studio 2015. New Project
- Select Windows under the Visual C# or Visual Basic sections. Then select Windows Forms Application. Specify a name and location and then select OK. Windows Forms Application
- Right click on the Toolbox and select Choose Items… Add Item
- Select Farpoint Spread 8.0 from the COM Components tab. Then select OK. Components
- Select Spread and drag it to the form from the Toolbox. Toolbox Form with Spread Control
- Select MSDATASRC and stdole references in the Solution Explorer and set Embed Interop Types to False. Reference Reference
- Select Project and Properties. Project Properties
- Verify that the Prefer 32-bit option is checked under the Build menu. Build Options
- Add code and run the project. This code creates multiple headers and adds header text.
C#
axfpSpread1.MaxCols = 8;
axfpSpread1.MaxRows = 12;
axfpSpread1.ColHeaderRows = 3;
axfpSpread1.RowHeaderCols = 2;
axfpSpread1.AddCellSpan(1, -1000, 8, 1);
axfpSpread1.SetText(1, -1000, "Fiscal Year 2015");
axfpSpread1.AddCellSpan(1, -999, 2, 1);
axfpSpread1.SetText(1, -999, "1st Quarter");
axfpSpread1.AddCellSpan(3, -999, 2, 1);
axfpSpread1.SetText(3, -999, "2nd Quarter");
axfpSpread1.AddCellSpan(5, -999, 2, 1);
axfpSpread1.SetText(5, -999, "3rd Quarter");
axfpSpread1.AddCellSpan(7, -999, 2, 1);
axfpSpread1.SetText(7, -999, "4th Quarter");
axfpSpread1.SetText(1, -998, "East");
axfpSpread1.SetText(2, -998, "West");
axfpSpread1.SetText(3, -998, "East");
axfpSpread1.SetText(4, -998, "West");
axfpSpread1.SetText(5, -998, "East");
axfpSpread1.SetText(6, -998, "West");
axfpSpread1.SetText(7, -998, "East");
axfpSpread1.SetText(8, -998, "West");
axfpSpread1.AddCellSpan(-1000, 1, 1, 12);
axfpSpread1.SetText(-1000, 1, "Store #");