PHPOffice / PHPWord

A pure PHP library for reading and writing word processing documents
https://phpoffice.github.io/PHPWord/
Other
7.22k stars 2.68k forks source link

form radio buttons #297

Open pallikiran opened 10 years ago

pallikiran commented 10 years ago

Is it possible to show form radio button in .docx file like cehckbox?

Thanks, Kiran

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/2890349-form-radio-buttons?utm_campaign=plugin&utm_content=tracker%2F323108&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F323108&utm_medium=issues&utm_source=github).
ivanlanin commented 10 years ago

The only way we can add radio button to OOXML is by using ActiveX control. I'm not sure this is what we want because it's too specific. What do you think, @Progi1984?

Progi1984 commented 10 years ago

ActiveX is not a solution.

Is there not any radio button or option (like in HTML) for OOXML ?

ivanlanin commented 10 years ago

I don't think there's an alternative for this. See: http://www.personal.psu.edu/yxc165/blogs/comm_-_support/2010/08/adding-raido-buttons-to-ms-word-2010.html

Progi1984 commented 10 years ago

@PHPOffice/phpword-team What do you think about that ?

ghost commented 10 years ago

Simple question, @pallikiran: what for?

By the way, guys, according to paragraph 17.16.5.21 of the OOXML spec, there is FORMDROPDOWN field which, I guess, could be used instead of radios. If want radios, there is no luck.

pallikiran commented 10 years ago

@RomanSyroeshko I need to create offline form with checkbox, dropdown and radio buttons in docx file.

Right now i am using dropdown for radio buttons. I am asking is there any possibility to show radio buttons.

ghost commented 10 years ago

Right now i am using dropdown for radio buttons. I am asking is there any possibility to show radio buttons.

As I mentioned earlier, I didn't see any support of radios in OOXML standard (except drop-downs). You may try to do your own research or/and ask someone from Microsoft. Maybe you will have to use ActiveX.

I need to create offline form with checkbox, dropdown and radio buttons in docx file.

By the way, automating MS Word or MS Excel files in that way is a wrong way. You will have to rewrite your solution in case of file format change. That's the overhead which German government has when performed migration from MS Office to Open Office. Details on this history you my find using search engines. So, if you want to easy change file formats, use files for output only, don't automate them by their specific tools.

Good luck.