how to send layout (color, bold ..) to a excel cell using objStreamWriter?

Discussion in 'ASP .Net' started by Luc, Dec 29, 2009.

  1. Luc

    Luc Guest

    Hi,

    i use objStreamWriter for writing data to an excel sheet.

    objStreamWriter = New StreamWriter(objFileStream)
    objStreamWriter.WriteLine("title" & chr(9) & "name")
    etc ...
    This works perfect.
    But is it also possible to give a cell a color, or to make the text sent to
    a cell bold?
    Thanks
    Luc
    Luc, Dec 29, 2009
    #1
    1. Advertising

  2. Luc

    Patrice Guest

    Hi,

    Which format do you use ?

    For now it seems you are using CSV which allows only to import data. If you
    want to use formatting you could use HTML (Excel is able to import HTML
    tables), XML (either the old xml format or what is now the native format),
    use automation to control Excel (if client side)) or use a third party
    product such as Aspose.Cells...

    Basically it seems you'll have to redesign how data are exported...

    --
    Patrice

    "Luc" <> a écrit dans le message de
    news:...
    > Hi,
    >
    > i use objStreamWriter for writing data to an excel sheet.
    >
    > objStreamWriter = New StreamWriter(objFileStream)
    > objStreamWriter.WriteLine("title" & chr(9) & "name")
    > etc ...
    > This works perfect.
    > But is it also possible to give a cell a color, or to make the text sent
    > to a cell bold?
    > Thanks
    > Luc
    >
    Patrice, Dec 29, 2009
    #2
    1. Advertising

  3. Luc

    Luc Guest

    thanks for replying.

    Imagine all i want is to send "ok" but in bold.
    what do i have actually to change to this code for that?
    objStreamWriter = New StreamWriter(objFileStream)
    objStreamWriter.WriteLine("ok" )
    ....
    that's all i want to know.
    Thanks


    "Patrice" <http://scribe-en.blogspot.com/> schreef in bericht
    news:OnY$...
    > Hi,
    >
    > Which format do you use ?
    >
    > For now it seems you are using CSV which allows only to import data. If
    > you want to use formatting you could use HTML (Excel is able to import
    > HTML tables), XML (either the old xml format or what is now the native
    > format), use automation to control Excel (if client side)) or use a third
    > party product such as Aspose.Cells...
    >
    > Basically it seems you'll have to redesign how data are exported...
    >
    > --
    > Patrice
    >
    > "Luc" <> a écrit dans le message de
    > news:...
    >> Hi,
    >>
    >> i use objStreamWriter for writing data to an excel sheet.
    >>
    >> objStreamWriter = New StreamWriter(objFileStream)
    >> objStreamWriter.WriteLine("title" & chr(9) & "name")
    >> etc ...
    >> This works perfect.
    >> But is it also possible to give a cell a color, or to make the text sent
    >> to a cell bold?
    >> Thanks
    >> Luc
    >>

    >
    Luc, Dec 29, 2009
    #3
  4. Luc

    Patrice Guest

    Because for now it seems you are using a CSV likeformat
    (http://en.wikipedia.org/wiki/Comma-separated_values) wiht tab rather than
    comma as a delimiter.

    If yes, this format only allows to define values to be imported and not how
    the font or the cell should look like (so you'll have either to do this as
    another step or use a format that allows to define both data and
    appearance)...

    --
    Patrice


    "Luc" <> a écrit dans le message de
    news:...
    > thanks for replying.
    >
    > Imagine all i want is to send "ok" but in bold.
    > what do i have actually to change to this code for that?
    > objStreamWriter = New StreamWriter(objFileStream)
    > objStreamWriter.WriteLine("ok" )
    > ...
    > that's all i want to know.
    > Thanks
    >
    >
    > "Patrice" <http://scribe-en.blogspot.com/> schreef in bericht
    > news:OnY$...
    >> Hi,
    >>
    >> Which format do you use ?
    >>
    >> For now it seems you are using CSV which allows only to import data. If
    >> you want to use formatting you could use HTML (Excel is able to import
    >> HTML tables), XML (either the old xml format or what is now the native
    >> format), use automation to control Excel (if client side)) or use a third
    >> party product such as Aspose.Cells...
    >>
    >> Basically it seems you'll have to redesign how data are exported...
    >>
    >> --
    >> Patrice
    >>
    >> "Luc" <> a écrit dans le message de
    >> news:...
    >>> Hi,
    >>>
    >>> i use objStreamWriter for writing data to an excel sheet.
    >>>
    >>> objStreamWriter = New StreamWriter(objFileStream)
    >>> objStreamWriter.WriteLine("title" & chr(9) & "name")
    >>> etc ...
    >>> This works perfect.
    >>> But is it also possible to give a cell a color, or to make the text sent
    >>> to a cell bold?
    >>> Thanks
    >>> Luc
    >>>

    >>

    >
    >
    Patrice, Dec 30, 2009
    #4
    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. Replies:
    1
    Views:
    572
    John Timney \(MVP\)
    Jun 19, 2006
  2. Kamaljeet Saini
    Replies:
    0
    Views:
    412
    Kamaljeet Saini
    Feb 13, 2009
  3. sed_y
    Replies:
    0
    Views:
    1,013
    sed_y
    Feb 15, 2012
  4. Jonathan N. Little
    Replies:
    7
    Views:
    487
  5. Hot-Text
    Replies:
    1
    Views:
    436
    Hot-Text
    Oct 5, 2012
Loading...

Share This Page