Posted 7 February 2021, 12:26 pm EST
Hello forum, I am about to integrate SpreadJS into an existing Blazor Webassembly app created using the Visual Studio 2019 templates. I have passed the sanity test of downloading a XLSX blob from a web service and loading and displaying the workbook in a SpreadJS component in a page.
The Workbooks are created by data analysts in Excel and contain attractive dashboard style charts that are driven by ranges of numbers. There is a special sheet called “_config” which lists pairs of web service endpoints and cell ranges. In the next stage I must call each endpoint to get a matrix of numbers which are placed in a corresponding cell ranges to update the dashboard charts. In other words, the workbook contains instructions on how to update itself.
Before I start on the next stage, I want to be sure I am following the best coding conventions for interacting with the SpreadJS component from C# code-behind. I need some general guidance.
C# can only communicate with SpreadJS via JS-Interop, so I was prepared to create a suite of JS functions through which my C# code communicates with SpreadJS. This is rather verbose and fragile and I was wondering if there is some more robust or strongly-typed way of C# to SpreadJS communication.
Any general advice on best practices would be most welcome.
Thanks, Greg