pyXLWriter - grid lines and if formula

Discussion in 'Python' started by Luis P. Mendes, Jul 7, 2006.

  1. Hi,

    I know that pyExelerator is the supported project now, but I can't use
    it because I'd need it to generate files from a web platform. Since I
    can not save a file to a file-like object, I have to use pyXLWriter.

    The problems are:
    1- how to turn off/on the grid lines of each sheet?
    2- I tried to build a simple 'if' formula but couldn't. Is it my
    problem or pyXLWriter's problem? If the former, is it possible to post
    an example?

    TIA
    Luis P. Mendes
    Luis P. Mendes, Jul 7, 2006
    #1
    1. Advertising

  2. On 7/7/06, Luis P. Mendes <> wrote:
    > Hi,
    >
    > I know that pyExelerator is the supported project now, but I can't use
    > it because I'd need it to generate files from a web platform. Since I
    > can not save a file to a file-like object, I have to use pyXLWriter.


    I don't really know what I'm talking about, but maybe have a Python
    script that uses pyExelerator and saves the file to Sdout, name that
    script with an .xls extension and the browser will present it to the
    user as an Excel file?

    Maybe, maybe??

    -Greg pinero
    =?ISO-8859-1?Q?Gregory_Pi=F1ero?=, Jul 7, 2006
    #2
    1. Advertising

  3. Luis P. Mendes

    John Machin Guest

    On 8/07/2006 3:43 AM, Luis P. Mendes wrote:
    > Hi,
    >
    > I know that pyExelerator is the supported project now, but I can't use
    > it because I'd need it to generate files from a web platform. Since I
    > can not save a file to a file-like object, I have to use pyXLWriter.
    >
    > The problems are:
    > 1- how to turn off/on the grid lines of each sheet?


    It is an open source project. When you went to the source directory and
    typed:

    grep def.*grid *.py

    what went wrong?

    > 2- I tried to build a simple 'if' formula but couldn't.


    What did you try, and what was the result when you opened the file with
    Oo_O Calc / Gnumeric / you-know-what? Have you had success with *any*
    formulas that have functions with more than one argument?

    > Is it my
    > problem or pyXLWriter's problem?


    Given the limited information, certainty is impossible, but I'd say it's
    your problem.

    > If the former, is it possible to post
    > an example?


    It is possible to post an example irrespective of whether it is your
    problem or not.

    It is also possible to go to the examples directory and type:

    grep -i "=if" *.py

    HTH,
    John
    John Machin, Jul 7, 2006
    #3
  4. Gregory Piñero escreveu:
    > On 7/7/06, Luis P. Mendes <> wrote:
    >> Hi,
    >>
    >> I know that pyExelerator is the supported project now, but I can't use
    >> it because I'd need it to generate files from a web platform. Since I
    >> can not save a file to a file-like object, I have to use pyXLWriter.

    >
    > I don't really know what I'm talking about, but maybe have a Python
    > script that uses pyExelerator and saves the file to Sdout, name that
    > script with an .xls extension and the browser will present it to the
    > user as an Excel file?
    >
    > Maybe, maybe??
    >
    > -Greg pinero

    I'll try that option and see what I can get.

    Still, there's an open patch at
    http://sourceforge.net/tracker/index.php?func=detail&aid=1481069&group_id=134081&atid=730645
    that says:
    """
    Summary: (?)
    pass file-like objects to write
    In a cgi script you use mosty sys.stdout to write to
    the client with this little patch this is possible.
    """
    but it has not been submitted yet.

    So, perhaps you could show me how to generate an excel file as a http
    response in django?

    Luis P. Mendes
    Luis P. Mendes, Jul 10, 2006
    #4
  5. Luis P. Mendes wrote:
    > Gregory Piñero escreveu:
    > > On 7/7/06, Luis P. Mendes <> wrote:
    > >> Hi,
    > >>
    > >> I know that pyExelerator is the supported project now, but I can't use
    > >> it because I'd need it to generate files from a web platform. Since I
    > >> can not save a file to a file-like object, I have to use pyXLWriter.


    > So, perhaps you could show me how to generate an excel file as a http
    > response in django?


    If it is a simple one sheet Workbook you can produce HTML document with
    a table and set the headers to indicate it is Excel.

    Content-Type: application/vnd.ms-excel
    Content-Disposition: attachment;filename=report.xls

    Lookup documentation on how to generate formula:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoffxml/html/ofxml2k.asp

    Waldemar
    Waldemar Osuch, Jul 10, 2006
    #5
  6. Waldemar Osuch escreveu:
    > Luis P. Mendes wrote:
    >> Gregory Piñero escreveu:
    >>> On 7/7/06, Luis P. Mendes <> wrote:
    >>>> Hi,
    >>>>
    >>>> I know that pyExelerator is the supported project now, but I can't use
    >>>> it because I'd need it to generate files from a web platform. Since I
    >>>> can not save a file to a file-like object, I have to use pyXLWriter.

    >
    >> So, perhaps you could show me how to generate an excel file as a http
    >> response in django?

    >
    > If it is a simple one sheet Workbook you can produce HTML document with
    > a table and set the headers to indicate it is Excel.
    >
    > Content-Type: application/vnd.ms-excel
    > Content-Disposition: attachment;filename=report.xls
    >
    > Lookup documentation on how to generate formula:
    > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoffxml/html/ofxml2k.asp
    >
    > Waldemar
    >

    Thanks, but it's a workbook with several sheets.

    Luis P. Mendes
    Luis P. Mendes, Jul 10, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Richard Shea

    pyXLWriter - simple example code ?

    Richard Shea, Aug 20, 2004, in forum: Python
    Replies:
    2
    Views:
    486
    Richard Shea
    Aug 23, 2004
  2. Richard Shea

    pyXLWriter - cancel previous question

    Richard Shea, Aug 20, 2004, in forum: Python
    Replies:
    0
    Views:
    302
    Richard Shea
    Aug 20, 2004
  3. pyXLwriter and jython

    , Jan 12, 2005, in forum: Python
    Replies:
    0
    Views:
    280
  4. Larry Bud

    FormView, Eval, and formula

    Larry Bud, Dec 20, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,478
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tp?=
    Dec 21, 2006
  5. Robert Singer

    pyXLWriter warnings

    Robert Singer, Sep 30, 2008, in forum: Python
    Replies:
    1
    Views:
    522
    John Machin
    Sep 30, 2008
Loading...

Share This Page