Recent

Author Topic: How to create on cell combobox  (Read 823 times)

Packs

  • Sr. Member
  • ****
  • Posts: 410
How to create on cell combobox
« on: October 22, 2024, 04:35:55 am »
How to create on cell combobox

wp

  • Hero Member
  • *****
  • Posts: 12527
Re: How to create on cell combobox
« Reply #1 on: October 22, 2024, 12:30:58 pm »
Contributions are welcome. A possible patch should
- create the infrastructure within fpspreadsheet for cell combobox
- provide a reader/writer for at least xlsx and ods files.

Packs

  • Sr. Member
  • ****
  • Posts: 410
Re: How to create on cell combobox
« Reply #2 on: October 22, 2024, 02:12:08 pm »
according to you this is possible

Packs

  • Sr. Member
  • ****
  • Posts: 410
Re: How to create on cell combobox
« Reply #3 on: October 23, 2024, 08:04:58 pm »
How to embed combobox or picklist inside excel cell

wp

  • Hero Member
  • *****
  • Posts: 12527
Re: How to create on cell combobox
« Reply #4 on: October 24, 2024, 11:18:13 am »
First study how Excel achieves this (I never used comboboxes inside Excel, so I don't know it by heart - but I guess you must provide some cells which contain the combobox items). Then use Excel to create a simple xlsx file with such a combobox. xlsx is a zip file containing several xml files, unzip it and look at the file xl/worksheets/sheet1.xml. Find out which xml nodes excel writes into this file to create the combobox.

Next step is to simulate the same in FPSpreadsheet. Study the source code of this library (sorry, I cannot give you a lengthy description here, there is a documentation of usage in http://wiki.lazarus.freepascal.org/FPSpreadsheet, but not of internal details). Find a way how to extend the TsWorksheet class such that the the combobox items and the information that a cell contains a combobox can be incorporated.

Then extend the xlsx reader unit xlsxoosml.pas such that it can detect the embedded combobox and move it into the internal fpspreadsheet structures. Likewise, extend the xlsx writer (also in xlsxooxml) such that it can write the information for the combobox into the xml file so that excel understands it.

Packs

  • Sr. Member
  • ****
  • Posts: 410
Re: How to create on cell combobox
« Reply #5 on: October 24, 2024, 12:40:42 pm »
Thank you so much.

For detailed explanation.

 

TinyPortal © 2005-2018