Migrating ActiveX FarPoint Spread Grid Designer
by Olman Quesada, on Oct 15, 2021 2:30:25 PM
FarPoint Spread ActiveX grid control was a very popular component for VB6 applications. However, because it stores design information in a proprietary, migrating can be difficult. The VBUC doesn't understand how to deal with this proprietary binary format. Let's discuss how to address this issue.
In this blog, we'll demonstrate a way to import the designer for ActiveX FarPoint grids into Mobilize FpSpread Helper component.
Exporting the ActiveX Designer
First of all, use the FarPoint Spread functionality in VB6 to export the design information: right click on the grid, open the designer, and then select the File.Save As option)
This generate a file in a propietary binary format with extension ".ss2".
Importing Designer in .Net
As FarPoint components are migrated to a FpSpread component that inherits from FarPoint.Win.Spread.FpSpread. This component is a Mobilize helper class that provides functionality no longer present in the .NET version of the FarPoint control, but was provided by the ActiveX version.
.NET FarPoint component offers a Designer that allows importing "old" designer files (like the stored in .ss2 files), but this feature is not available for inherited controls. So we can't use that as a workaround.
Since we can't import the original designer files, how can we migrate our component?
Converting a FarPoint Designer to XML
Open the ss2 file format using the GrapeCity Spread designer. This EXE file is located under the bin folder where the SreadNET component is installed.
The new designer lets see how the grid looked in VB6:
Now, go to File->Save As and choose a new file name for the file where you want to save the new format of the grid designer file. Be sure to save this as an XML file type.
In the migrated code you can use FarPoint.Win.Spread.Model.SpreadSerializer.OpenXml static method to load the XML generated in the previous step and load the designer in the migrated FPSpread control:FarPoint.Win.Spread.Model.SpreadSerializer.OpenXml(fpSpread1, @"C:\Temp\grid.xml");
When the code is executed, it loads and displays the grid designer in the upgraded FPSpread control.
And there it is! You've updated the grid control without the need to start from scratch building a new one.