Formatting output

Discussion in 'ASP General' started by Tom Petersen, Mar 30, 2005.

  1. Tom Petersen

    Tom Petersen Guest

    I am using a response.write to test the formatting of the output. I am
    supposed to get this:
    BEGIN:VCALENDAR
    VERSION:1.0
    BEGIN:VEVENT
    DTSTART:20051022T090000Z
    DTEND:20051022T090000Z
    LOCATION;ENCODING=QUOTED-PRINTABLE:Library
    UID:20051022T090000ZI-request
    DESCRIPTION;ENCODING=QUOTED-PRINTABLE:test
    SUMMARY;ENCODING=QUOTED-PRINTABLE:I-request
    PRIORITY:3
    END:VEVENT
    END:VCALENDAR

    But instead I get this:
    BEGIN:VCALENDAR VERSION:1.0 BEGIN:VEVENT DTSTART:20051022T090000Z
    DTEND:20051022T090000Z LOCATION;ENCODING=QUOTED-PRINTABLE:Library
    UID:20051022T090000ZI-request DESCRIPTION;ENCODING=QUOTED-PRINTABLE:test
    SUMMARY;ENCODING=QUOTED-PRINTABLE:I-request PRIORITY:3 END:VEVENT
    END:VCALENDAR

    I am sure I am missing something very simple, but I can't figure out what I
    am doing wrong. Here is the code:
    strvCalendar = "BEGIN:VCALENDAR" & vbCrLf & _
    "VERSION:1.0" & vbCrLf & _
    "BEGIN:VEVENT" & vbCrLf & _
    "DTSTART:" & strStart & vbCrLf & _
    "DTEND:" & strStart & vbCrLf & _
    "LOCATION;ENCODING=QUOTED-PRINTABLE:" & strLocation & vbCrLf & _
    "UID:" & strStart & strSubject & vbCrLf & _
    "DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" & strDescription & vbCrLf & _
    "SUMMARY;ENCODING=QUOTED-PRINTABLE:" & strSubject & vbCrLf & _
    "PRIORITY:3" & vbCrLf & _
    "END:VEVENT" & vbCrLf & _
    "END:VCALENDAR" & vbCrLf

    Any ideas?
    TIA!!!
    Tom Petersen, Mar 30, 2005
    #1
    1. Advertising

  2. If you do a view-source, you'll see the format you're after. Remember
    though, HTML doesn't care about line breaks in the source. If you want a
    line break to appear in your browser, you have to use the <br> tag or a
    block level tag like <div> or <p> or something.

    Ray at work

    "Tom Petersen" <> wrote in message
    news:...
    > I am using a response.write to test the formatting of the output. I am
    > supposed to get this:
    > BEGIN:VCALENDAR
    > VERSION:1.0
    > BEGIN:VEVENT
    > DTSTART:20051022T090000Z
    > DTEND:20051022T090000Z
    > LOCATION;ENCODING=QUOTED-PRINTABLE:Library
    > UID:20051022T090000ZI-request
    > DESCRIPTION;ENCODING=QUOTED-PRINTABLE:test
    > SUMMARY;ENCODING=QUOTED-PRINTABLE:I-request
    > PRIORITY:3
    > END:VEVENT
    > END:VCALENDAR
    >
    > But instead I get this:
    > BEGIN:VCALENDAR VERSION:1.0 BEGIN:VEVENT DTSTART:20051022T090000Z
    > DTEND:20051022T090000Z LOCATION;ENCODING=QUOTED-PRINTABLE:Library
    > UID:20051022T090000ZI-request DESCRIPTION;ENCODING=QUOTED-PRINTABLE:test
    > SUMMARY;ENCODING=QUOTED-PRINTABLE:I-request PRIORITY:3 END:VEVENT
    > END:VCALENDAR
    >
    > I am sure I am missing something very simple, but I can't figure out what

    I
    > am doing wrong. Here is the code:
    > strvCalendar = "BEGIN:VCALENDAR" & vbCrLf & _
    > "VERSION:1.0" & vbCrLf & _
    > "BEGIN:VEVENT" & vbCrLf & _
    > "DTSTART:" & strStart & vbCrLf & _
    > "DTEND:" & strStart & vbCrLf & _
    > "LOCATION;ENCODING=QUOTED-PRINTABLE:" & strLocation & vbCrLf & _
    > "UID:" & strStart & strSubject & vbCrLf & _
    > "DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" & strDescription & vbCrLf &

    _
    > "SUMMARY;ENCODING=QUOTED-PRINTABLE:" & strSubject & vbCrLf & _
    > "PRIORITY:3" & vbCrLf & _
    > "END:VEVENT" & vbCrLf & _
    > "END:VCALENDAR" & vbCrLf
    >
    > Any ideas?
    > TIA!!!
    >
    >
    Ray Costanzo [MVP], Mar 30, 2005
    #2
    1. Advertising

  3. Tom Petersen

    McKirahan Guest

    "Tom Petersen" <> wrote in message
    news:...
    > I am using a response.write to test the formatting of the output. I am
    > supposed to get this:
    > BEGIN:VCALENDAR
    > VERSION:1.0
    > BEGIN:VEVENT
    > DTSTART:20051022T090000Z
    > DTEND:20051022T090000Z
    > LOCATION;ENCODING=QUOTED-PRINTABLE:Library
    > UID:20051022T090000ZI-request
    > DESCRIPTION;ENCODING=QUOTED-PRINTABLE:test
    > SUMMARY;ENCODING=QUOTED-PRINTABLE:I-request
    > PRIORITY:3
    > END:VEVENT
    > END:VCALENDAR
    >
    > But instead I get this:
    > BEGIN:VCALENDAR VERSION:1.0 BEGIN:VEVENT DTSTART:20051022T090000Z
    > DTEND:20051022T090000Z LOCATION;ENCODING=QUOTED-PRINTABLE:Library
    > UID:20051022T090000ZI-request DESCRIPTION;ENCODING=QUOTED-PRINTABLE:test
    > SUMMARY;ENCODING=QUOTED-PRINTABLE:I-request PRIORITY:3 END:VEVENT
    > END:VCALENDAR
    >
    > I am sure I am missing something very simple, but I can't figure out what

    I
    > am doing wrong. Here is the code:
    > strvCalendar = "BEGIN:VCALENDAR" & vbCrLf & _
    > "VERSION:1.0" & vbCrLf & _
    > "BEGIN:VEVENT" & vbCrLf & _
    > "DTSTART:" & strStart & vbCrLf & _
    > "DTEND:" & strStart & vbCrLf & _
    > "LOCATION;ENCODING=QUOTED-PRINTABLE:" & strLocation & vbCrLf & _
    > "UID:" & strStart & strSubject & vbCrLf & _
    > "DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" & strDescription & vbCrLf &

    _
    > "SUMMARY;ENCODING=QUOTED-PRINTABLE:" & strSubject & vbCrLf & _
    > "PRIORITY:3" & vbCrLf & _
    > "END:VEVENT" & vbCrLf & _
    > "END:VCALENDAR" & vbCrLf
    >
    > Any ideas?
    > TIA!!!


    strvCalendar = Replace(strvCalendar ,vbCrLf,"<br>")
    McKirahan, Mar 30, 2005
    #3
  4. Tom Petersen

    Jeff Cochran Guest

    >I am sure I am missing something very simple, but I can't figure out what I
    >am doing wrong. Here is the code:
    >strvCalendar = "BEGIN:VCALENDAR" & vbCrLf & _


    VbCrLf isn't recognized in HTML. Use HTML tags, such as <p></p> or
    <br> to format HTML code.

    Or... Use a <pre></pre> tag to deliver the text as formatted.

    Check an HTML group for details if you're unfamiliar with these tags.

    Jeff
    Jeff Cochran, Mar 31, 2005
    #4
  5. Tom Petersen

    Tom Petersen Guest

    re: Formatting output - more info

    Here is a little more info, sorry should have explained what my final goal
    was. I am creating a .vcs file from a form to import into Outlook. I was
    just testing the output on screen then pasting that into a file, after
    removing the extra white space, and inserting line breaks. The data is
    valid, but the formatting into the file isn't working. Was I doing the
    formatting right if I was generating a file? Here is the code again, and
    the bit to generate the file:

    strvCalendar = "BEGIN:VCALENDAR" & vbCrLf & _
    "VERSION:1.0" & vbCrLf & _
    "BEGIN:VEVENT" & vbCrLf & _
    "DTSTART:" & strStart & vbCrLf & _
    "DTEND:" & strStart & vbCrLf & _
    "LOCATION;ENCODING=QUOTED-PRINTABLE:" & strLocation & vbCrLf & _
    "UID:" & strStart & strSubject & vbCrLf & _
    "DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" & strDescription & vbCrLf & _
    "SUMMARY;ENCODING=QUOTED-PRINTABLE:" & strSubject & vbCrLf & _
    "PRIORITY:3" & vbCrLf & _
    "END:VEVENT" & vbCrLf & _
    "END:VCALENDAR" & vbCrLf

    Response.ContentType = "text/x-vCalendar"
    Response.AddHeader "Content-Disposition", _
    "filename=Event" & "cal.vcs"
    Response.Write strvCalendar
    Response.End

    This gernerates an error message in Outlook stating it can't import the
    calendar file. But, again, if I paste the data into a text file with a .vcs
    extension, and delete white space and insert line breaks I can double click
    the file and it imports into Outlook fine, this is why I think I just don't
    know how to format the 'output' correctly.

    I appreciate the help!!!
    Tom Petersen, Mar 31, 2005
    #5
  6. Tom Petersen

    Roland Hall Guest

    Re: Formatting output - more info

    "Tom Petersen" wrote in message
    news:%...
    : Here is a little more info, sorry should have explained what my final goal
    : was. I am creating a .vcs file from a form to import into Outlook. I was
    : just testing the output on screen then pasting that into a file, after
    : removing the extra white space, and inserting line breaks. The data is
    : valid, but the formatting into the file isn't working. Was I doing the
    : formatting right if I was generating a file? Here is the code again, and
    : the bit to generate the file:
    :
    : strvCalendar = "BEGIN:VCALENDAR" & vbCrLf & _
    : "VERSION:1.0" & vbCrLf & _
    : "BEGIN:VEVENT" & vbCrLf & _
    : "DTSTART:" & strStart & vbCrLf & _
    : "DTEND:" & strStart & vbCrLf & _
    : "LOCATION;ENCODING=QUOTED-PRINTABLE:" & strLocation & vbCrLf & _
    : "UID:" & strStart & strSubject & vbCrLf & _
    : "DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" & strDescription & vbCrLf & _
    : "SUMMARY;ENCODING=QUOTED-PRINTABLE:" & strSubject & vbCrLf & _
    : "PRIORITY:3" & vbCrLf & _
    : "END:VEVENT" & vbCrLf & _
    : "END:VCALENDAR" & vbCrLf
    :
    : Response.ContentType = "text/x-vCalendar"
    : Response.AddHeader "Content-Disposition", _
    : "filename=Event" & "cal.vcs"
    : Response.Write strvCalendar
    : Response.End
    :
    : This gernerates an error message in Outlook stating it can't import the
    : calendar file. But, again, if I paste the data into a text file with a
    ..vcs
    : extension, and delete white space and insert line breaks I can double
    click
    : the file and it imports into Outlook fine, this is why I think I just
    don't
    : know how to format the 'output' correctly.
    :
    : I appreciate the help!!!

    Hi Tom...

    Does the order matter? Yours is different than the one on this page.

    http://www.devx.com/getHelpOn/10MinuteSolution/20508/0/page/4

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
    Roland Hall, Apr 1, 2005
    #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. =?Utf-8?B?UGl0Y2Fpcm5pYQ==?=

    Formatting Repeater oontrol output

    =?Utf-8?B?UGl0Y2Fpcm5pYQ==?=, Feb 15, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    547
    Bubba Earl JimBob Joe
    Feb 17, 2005
  2. D. Shane Fowlkes
    Replies:
    1
    Views:
    411
    Marina
    May 19, 2005
  3. lemmchen
    Replies:
    4
    Views:
    359
    lemmchen
    Oct 13, 2005
  4. mark
    Replies:
    1
    Views:
    276
    Victor Bazarov
    Jun 15, 2004
  5. Steve
    Replies:
    1
    Views:
    348
    Victor Bazarov
    Sep 8, 2004
Loading...

Share This Page