Excel spreadsheet embed

Get help developing custom BBCodes or request one.
User avatar
KYPREO
Registered User
Posts: 79
Joined: Fri Feb 02, 2018 9:56 am
Contact:

Excel spreadsheet embed

Post by KYPREO » Thu Feb 22, 2018 10:52 pm

Hi

I couldn't find a suitable Excel spreadsheet embed BBcode so I whipped up this one which looks to be working fine on 3.2.x. It is responsive to screen width and works for attachments (you have to attach the file first, then find it's URL with the filephp?id=#### format and embed that).

This could be used to easily embed tables, for example.

BBCode usage

Code: Select all

[excel]{URL}[/excel]
HTML replacement

Code: Select all

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src={URL}' width='100%' height='500px' frameborder='0'></iframe>
Usage

Code: Select all

excel: [excel]Enter URL of Excel file[/excel]
Demo post:
http://ausrotary.com/viewtopic.php?f=16 ... 64#p244364

There's probably better ways to do this, but this was my quick solution. Happy to take feedback on better options.
phpBB user since 2002
www.AusRotary.com

User avatar
JoshyPHP
Code Contributor
Posts: 963
Joined: Mon Jul 11, 2011 12:28 am

Re: Excel spreadsheet embed

Post by JoshyPHP » Fri Feb 23, 2018 12:44 am

If you add resize:vertical to the iframe's style, users will be able to make it taller on some browsers.
I wrote the thing that does BBCodes in 3.2.

User avatar
KYPREO
Registered User
Posts: 79
Joined: Fri Feb 02, 2018 9:56 am
Contact:

Re: Excel spreadsheet embed

Post by KYPREO » Fri Feb 23, 2018 1:09 am

JoshyPHP wrote:
Fri Feb 23, 2018 12:44 am
If you add resize:vertical to the iframe's style, users will be able to make it taller on some browsers.
PERFECT! Thank you very much

Got it working. I expressed it as:

Code: Select all

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src={URL}' width='100%' height='500px' frameborder='0' style='resize: vertical'></iframe>
Not sure if this is what you meant, but it works.

I am going to do the same to my PDF embed BBcode. EDIT: It works for my PDF embed as well - brilliant, thanks again! 8-)
phpBB user since 2002
www.AusRotary.com

User avatar
dr.house
Registered User
Posts: 17
Joined: Mon Jun 05, 2017 6:46 pm
Location: Italy (UE)
Name: Mimmo
Contact:

Re: Excel spreadsheet embed

Post by dr.house » Sat Mar 17, 2018 11:40 pm

hi,
and if I wanted to use the file with the function attachments instead of using url? It's possible? ;)
Best regards.

User avatar
KYPREO
Registered User
Posts: 79
Joined: Fri Feb 02, 2018 9:56 am
Contact:

Re: Excel spreadsheet embed

Post by KYPREO » Sat Mar 17, 2018 11:56 pm

dr.house wrote:
Sat Mar 17, 2018 11:40 pm
hi,
and if I wanted to use the file with the function attachments instead of using url? It's possible? ;)
Best regards.
Yes. You need to use the direct file.php? URL instead of the attachment file name. The quickest way I've found to grab that is to attach the file, then click post preview then right click on the attachment URL then include that within the bbcode where you want the preview to add.

Note: that attachment file name link will still appear at the end of the post unless you place it inline.
phpBB user since 2002
www.AusRotary.com

User avatar
dr.house
Registered User
Posts: 17
Joined: Mon Jun 05, 2017 6:46 pm
Location: Italy (UE)
Name: Mimmo
Contact:

Re: Excel spreadsheet embed

Post by dr.house » Sun Mar 18, 2018 6:10 pm

thanks for the quick reply. Is there a simpler solution? ;)
Best regards.

User avatar
Mick
Support Team Member
Support Team Member
Posts: 20237
Joined: Fri Aug 29, 2008 9:49 am
Location: Cardiff

Re: Excel spreadsheet embed

Post by Mick » Mon Mar 19, 2018 10:12 am

dr.house wrote:
Sun Mar 18, 2018 6:10 pm
Is there a simpler solution?
If the above isn’t suitable for your needs I suggest you start a new topic.
"The more connected we get the more alone we become" - Kyle Broflovski

There are no ‘threads’ in phpBB, they are topics.

User avatar
ViolaF
Registered User
Posts: 1416
Joined: Tue Aug 14, 2012 11:52 pm

Re: Excel spreadsheet embed

Post by ViolaF » Mon Mar 19, 2018 10:56 am

dr.house wrote:
Sun Mar 18, 2018 6:10 pm
thanks for the quick reply. Is there a simpler solution? ;)
Best regards.
For each, who wants to transform this to an ext, can go here:

http://bit.ly/2poewnP

menz01
Registered User
Posts: 116
Joined: Thu Oct 27, 2016 4:45 pm

Re: Excel spreadsheet embed

Post by menz01 » Tue Mar 27, 2018 4:43 pm

i am trying to make this work and cannot get it to fully work but i am closer. i attached a file, grabbed its URL and now i see a big blank box saying "file not found The URL of the original file is not valid or the document is not publicly accessible.
Verify the URL is correct, then contact the document owner.

what did i forget to do now?

User avatar
Lumpy Burgertushie
Registered User
Posts: 65192
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Excel spreadsheet embed

Post by Lumpy Burgertushie » Tue Mar 27, 2018 5:53 pm

If you are talking about using the system mentioined in the post by viola above then you have to get support for it from wherev er you got it. we have no way of knowing what it is or how it works etc.


robert
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

OK, so what's the speed of dark?

menz01
Registered User
Posts: 116
Joined: Thu Oct 27, 2016 4:45 pm

Re: Excel spreadsheet embed

Post by menz01 » Tue Mar 27, 2018 7:02 pm

Lumpy Burgertushie wrote:
Tue Mar 27, 2018 5:53 pm
If you are talking about using the system mentioined in the post by viola above then you have to get support for it from wherev er you got it. we have no way of knowing what it is or how it works etc.


robert
no, i am asking about the procedure done in the OP and posts 2 and 3

User avatar
ViolaF
Registered User
Posts: 1416
Joined: Tue Aug 14, 2012 11:52 pm

Re: Excel spreadsheet embed

Post by ViolaF » Tue Mar 27, 2018 8:38 pm

It seems, that https://view.officeapps.live.com/op/view.aspx?src=
dont work with attachments, so upload a xls via ftp and make a test:

https://view.officeapps.live.com/op/view.aspx?src=http://www.yourforum.com/forum/test/test.xls

menz01
Registered User
Posts: 116
Joined: Thu Oct 27, 2016 4:45 pm

Re: Excel spreadsheet embed

Post by menz01 » Tue Mar 27, 2018 8:56 pm

ViolaF wrote:
Tue Mar 27, 2018 8:38 pm
It seems, that https://view.officeapps.live.com/op/view.aspx?src=
dont work with attachments, so upload a xls via ftp and make a test:

https://view.officeapps.live.com/op/view.aspx?src=http://www.yourforum.com/forum/test/test.xls
that didn't work for me either. still getting the iframed whitebox that says File not found: the URL of the original file is not valid or the document is not publicly accessible. Verify the url is correct, then contact the document owner

this is exactly what i am seeing doing the steps in the OP and posts 2 and 3 after. sure wish KYPREO would explain in more detail what he did

***if i open a seperate browser window and put in the address bar https://view.officeapps.live.com/op/vie ... t/test.xls that actually works. not sure why it wont do it in a post on my forums

User avatar
ViolaF
Registered User
Posts: 1416
Joined: Tue Aug 14, 2012 11:52 pm

Re: Excel spreadsheet embed

Post by ViolaF » Tue Mar 27, 2018 9:04 pm

May you generate and test the xls links here before:

https://products.office.com/en-US/offic ... nts-online

*this comes after you click the button > [Create URL]

*(Check that the link works—preview in a new window)

menz01
Registered User
Posts: 116
Joined: Thu Oct 27, 2016 4:45 pm

Re: Excel spreadsheet embed

Post by menz01 » Tue Mar 27, 2018 9:14 pm

ViolaF wrote:
Tue Mar 27, 2018 8:38 pm
It seems, that https://view.officeapps.live.com/op/view.aspx?src=
dont work with attachments, so upload a xls via ftp and make a test:

https://view.officeapps.live.com/op/view.aspx?src=http://www.yourforum.com/forum/test/test.xls
ok.... i went back to this post and figured out what i did wrong. so to recap... if i FTP the file test.xls to my backend and create a folder called test and put test.xls inside it then do the above, i can show my spreadsheet in a post. this is good but the person that needs to do this does not have access to FTP nor does he understand how to. i can't do it all the time for him.

so going back to the OP and posts, 2 and 3.... why does this not work with attachments like it did in the OP?

Post Reply

Return to “Custom BBCode Development and Requests”

Who is online

Users browsing this forum: No registered users and 4 guests