Displaying Winform.Spread data saved as xml in Farpoint.Mvc.Spread

Posted by: anamika on 1 July 2019, 6:51 pm EST

  • Posted 1 July 2019, 6:51 pm EST

    Hello,

    We are creating a web version of existing desktop application. In desktop version we have save WinForm spread data as xml files and would like to open these files in the web version using Mvc.Spread. Trying to load directly fails with invalid mapping. Exporting the winform.spread to excel using saveexcel and trying to open in web using OpenExcel do not throw any error but fails to load the data.
    Any help is appreciated how to convert the desktop xml file to be web compatible.
    Thanks

    Anamika
  • Replied 2 July 2019, 10:24 pm EST

    Hello Anamika,
    There are lots of differences between Win and Web xml files. Hence the XML file exported from Spread Winform application can't be open in SpreadWeb.

    As a resolution, please export Excel file in "xls" format from WinForm application and load in Spread Web application.

    Please find the attached sample where the Files "SpreadData.xml" and "SpreadData1.xls" is exported from Spread Win application.
    In the application, the xls file gets loaded in the Spread successfully.

    Regards,
    Manish Gupta

    Spread-LoadExcel File.zip
  • Replied 3 July 2019, 5:46 pm EST

    Hello Manish,

    Thank you for getting back to me with the solution. Looks like the simple excel file you generated in spread.winform also gets loaded in my MVC application. But i am attaching a sample of xml (excelfile.s3a) and i save it in desktop app as excelfile_desk.xls using
    fpSpread1.SaveExcel("C:\\temp\\excelfile_desk.xls", FarPoint.Win.Spread.Model.IncludeHeaders.BothCustomOnly);

    And now this resulting excel when i load in my MVC application
    FpSpread1.OpenExcel("c:\\temp\\excelfile_desk.xls");
    FpSpread1.ActiveSheetView.PageSize = FpSpread1.Rows.Count;

    surprisingly it does not load any data, my spread is empty with 30 rows .

    Could you please try to see what could be the problem. We have more complex data saved in xml which needs to be exported to be able to open in MVC application.

    Thanks

    Anamika
    excelfile_desk.zip
  • Replied 5 July 2019, 12:55 am EST

    Hi Anamika,
    We opened the xls file edit a cell and save again. After this, we tried to load the file in Spread, it gets imported successfully.

    For now, please try with the above steps. We will ask to the developers if there is any better way to migrate data from the Win to Web projects.

    Regards,
    Manish Gupta
  • Replied 7 July 2019, 7:44 pm EST

    Hello Manish,

    That will not be an option as we will write a parser which will load all Spread Winform xml file and convert it to excel using SaveExcel method. Any preogrammatic approach will be required here without human interaction. Could you please consult the development team and let me know if their is a way around manually saving excel file again.


    Thanks

    Anamika
  • Replied 8 July 2019, 6:24 pm EST

    Hi Anamika,
    We are sorry for the inconvenience, we have forwarded this query to the concerned team with following internal tracking id: SPNET-9.

    We will let you know as we get an update on this.

    Regards,
    Manish Gupta
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels