Connecting Tech Pros Worldwide Help | Site Map

Opening Excel on client side

Djim
Guest
 
Posts: n/a
#1: Dec 20 '05
Hello,

i am starting PHP, and after 2 days of search, i am posting.

MY PURPOSE : opening a XLS files (in MS Excel) on the client side, the
user can update anything, then it will be automaticly saved on the
server again (when client use save button or close Excel).

MY TESTS : I had coded that (in php) :
echo "<FORM METHOD=post TARGET=_blank> ";
echo "<INPUT TYPE='button' VALUE=Open the file'
onClick='ouvrir(\"myfileexcel.xls\")'>";
echo "</FORM>";
---------------------------------------------------------------------------*-----

Actualy that doesn't work, my button is here but do nothing when you
clic it.
---------------------------------------------------------------------------*-----


function ouvrir($nomfic)
{
# test to check the call :
echo "COUCOU";
# $workbook = "docs/".$nomfic;
# $sheet = "myshet";
# $ex = new COM("Excel.sheet");
# $wkb = $ex->application->Workbooks->Open($workbook) or Die ("File do
not open");
# $ex->application->ActiveWorkbook->Close("False");
# unset ($ex);
}


MY QUESTION : Anyone know how to do this (with code example plz) ?



PS : i am french so sorry for my bad english.

Geoff Muldoon
Guest
 
Posts: n/a
#2: Dec 20 '05

re: Opening Excel on client side


jean-michel.mir@province-sud.nc says...
[color=blue]
> MY PURPOSE : opening a XLS files (in MS Excel) on the client side, the
> user can update anything, then it will be automaticly saved on the
> server again (when client use save button or close Excel).[/color]

Impossible to be able to do if the client has even the smallest ideas
about security of their own computer. I will NEVER allow a web site to
spawn an executable program on my client, let alone know to where on my
file system I may choose to save it as a download.

You are using the wrong application methodology, trying to hammer a nail
with a screwdriver. What you need to achieve this is MS Terminal Server
or Citrix.

Geoff M

Djim
Guest
 
Posts: n/a
#3: Dec 20 '05

re: Opening Excel on client side


it's an intranet (not internet) so security isn't my problem.
Plus i already hammered a nail with a screwdriver....several times,
it's painfull (specialy for my fingers) but can be done.. ;-))

Djim.

cross at php net
Guest
 
Posts: n/a
#4: Dec 20 '05

re: Opening Excel on client side


If you pass the browser an xls file, it will auto open most client's
excel (or an excel plugin) to read the doc..

Djim
Guest
 
Posts: n/a
#5: Dec 21 '05

re: Opening Excel on client side


Yes it open my file, but user can't save it back directly on the server.

Colin Fine
Guest
 
Posts: n/a
#6: Dec 21 '05

re: Opening Excel on client side


Djim wrote:[color=blue]
> Hello,
>
> i am starting PHP, and after 2 days of search, i am posting.
>
> MY PURPOSE : opening a XLS files (in MS Excel) on the client side, the
> user can update anything, then it will be automaticly saved on the
> server again (when client use save button or close Excel).
>
> MY TESTS : I had coded that (in php) :
> echo "<FORM METHOD=post TARGET=_blank> ";
> echo "<INPUT TYPE='button' VALUE=Open the file'
> onClick='ouvrir(\"myfileexcel.xls\")'>";
> echo "</FORM>";
> ---------------------------------------------------------------------------*-----
>
> Actualy that doesn't work, my button is here but do nothing when you
> clic it.
> ---------------------------------------------------------------------------*-----
>
>
> function ouvrir($nomfic)
> {
> # test to check the call :
> echo "COUCOU";
> # $workbook = "docs/".$nomfic;
> # $sheet = "myshet";
> # $ex = new COM("Excel.sheet");
> # $wkb = $ex->application->Workbooks->Open($workbook) or Die ("File do
> not open");
> # $ex->application->ActiveWorkbook->Close("False");
> # unset ($ex);
> }
>
>
> MY QUESTION : Anyone know how to do this (with code example plz) ?
>
>
>
> PS : i am french so sorry for my bad english.
>[/color]
PHP se lance chez le serveur. Lorsque l'utilisateur voit le bouton, PHP
s'est évanoué.
Seulement un système au client, p.e. Javascript, peut se lancer par
onClick - mais il n'aura pas accès aux fichiers sur le serveur.

Si l'utilisateur demande une nouvelle page ( par submit ou par un lien )
le PHP de cette page pourra ouvrir et afficher un fichier. Mais ça ne
permettra pas que l'utilisateur y puisse faire des changements au
fichier. Le script peut l'envoyé comme download, puis l'utilisateur
pourra lancer son propre Excel s'il y en a, mais il n'y aura aucun
methode de rentre le fichier changé au serveur.

Je ne sais aucun moyen d'arriver à ce que vous voulez.

Colin

Désolé pour ma mauvaise français.
Iván Sánchez Ortega
Guest
 
Posts: n/a
#7: Dec 21 '05

re: Opening Excel on client side


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Djim wrote:
[color=blue]
> Yes it open my file, but user can't save it back directly on the server.[/color]

Use a PUT-enabled webserver (webdav-like), and make sure that the client app
(i.e. excel) is able to save to http:// URLs.

At least, any KDE app can do it...

- --
- ----------------------------------
Iván Sánchez Ortega -i-punto-sanchez--arroba-mirame-punto-net

Give a man a fish, he owes you one fish.
Teach a man to fish, you give up your monopoly on fisheries.
(read on slashdot.org)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFDqLn43jcQ2mg3Pc8RApSuAJ9wUeEEHFvJF3rNzEBciB fx7zg/egCeJ8P+
Qi6aIAJNxmIn5J6zJF6hNCk=
=c10+
-----END PGP SIGNATURE-----
Chung Leong
Guest
 
Posts: n/a
#8: Dec 21 '05

re: Opening Excel on client side


For the level of integration you desire, you will probably need to use
an ActiveX control, that in turn hosts the Excel ActiveX control. With
a RAD tool like Borland Delphi or VB, you can do it fairly easily. Drag
an Excel control and a web access component, add a few lines of code,
then bingo!

Djim
Guest
 
Posts: n/a
#9: Dec 21 '05

re: Opening Excel on client side


Ok thx all for the tips, and specialy Colin with nice french ;-))

Closed Thread