Opening Excel on client side

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Djim

    Opening Excel on client side

    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.shee t");
    # $wkb = $ex->application->Workbooks->Open($workbook ) or Die ("File do
    not open");
    # $ex->application->ActiveWorkbo ok->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

    #2
    Re: Opening Excel on client side

    jean-michel.mir@prov ince-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

    Comment

    • Djim

      #3
      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.

      Comment

      • cross at php net

        #4
        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..

        Comment

        • Djim

          #5
          Re: Opening Excel on client side

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

          Comment

          • Colin Fine

            #6
            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.shee t");
            > # $wkb = $ex->application->Workbooks->Open($workbook ) or Die ("File do
            > not open");
            > # $ex->application->ActiveWorkbo ok->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.

            Comment

            • Iván Sánchez Ortega

              #7
              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)

              iD8DBQFDqLn43jc Q2mg3Pc8RApSuAJ 9wUeEEHFvJF3rNz EBciBfx7zg/egCeJ8P+
              Qi6aIAJNxmIn5J6 zJF6hNCk=
              =c10+
              -----END PGP SIGNATURE-----

              Comment

              • Chung Leong

                #8
                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!

                Comment

                • Djim

                  #9
                  Re: Opening Excel on client side

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

                  Comment

                  Working...