In addition to what @bvdputte already mentioned: The spreadsheet example is only about reading data, not writing. To actually edit data from a spreadsheet in the Panel and update the spreadsheet, you would need a library that can write to spreadsheets.
Have you tried to mix the examples or are you actually reading from a database?