ok,

Bernie got me going on this, and made me try some new stuff.  Some of the 
code I posted earlier was not quite right, but this code will work in any 
version of r:base and demonstrates how to easily build an HTML file with 
lots of stuff.  While the HTML flag on select is convient, don't let it 
limit what you can do.  You need to replace [ with <.  This code has 
actually been tested.

out t.htm
write '[html>'
write '[body>'
write '[H1>This is my test HTML report[/h1>'
write '[h3>Generated on', .#date, .#time, '[/h3>'
write 'This builds file t.thm [br>'
write '[br>'
write '[table border=2 bgcolor=silver>'
write '[tr>'
write '[th bgcolor=yellow width=100>Table ID[/th>'
write '[th bgcolor=green  widht=300>Table Name[/th>'
write '[/tr>
set headings off; set lines 0
select '[tr>[td>', sys_table_id,  +
       '[/td>[td>', sys_table_name,   +
       '[/td>[/tr>' +
       from sys_tables where limit = 10

write '[/table>'
write '[br>'
write 'This is the end of my report.  Finished at', .#date, .#time, '[br>'
write '[/body>'
write '[/html>'


Have fun,

Troy


===== Original Message from Bernie Corrigan <[EMAIL PROTECTED]> at 3/22/02 
4:01 pm
>Thanks for the pointer.  Turns out you can set colors and widths for the
>columns.  The color range could be better but it works.
>
>>or use www.rsyntax.com   - html select
>
>I think you mean "Select HTML" under rsyntax.
>
>=======================================
>At 03:40 PM 3/22/2002 -0700, you wrote:
>>I just did:
>>
>>R> help html select
>>
>>or use www.rsyntax.com   - html select
>>
>>I didn't realize the title was required.
>>
>>----------------------------
>>SELECT...HTML
>>Use the SELECT...HTML command to output data in HTML format.
>>
>>Syntax
>>
>>
>>Options
>>=backcolor
>>Is currently not supported; it must be set to: =default.
>>
>>colname
>>Specifies a 1 to 18 character column name.
>>
>>=forecolor
>>Specifies the text color for the data in the column.
>>
>>=h =w
>>Specifies height and width parameters. For both, the keywords LEFT, RIGHT,
>>and CENTER can be used. For width, the range is from 0 - 255 pixels. 0 is no
>>width specification. The height is the addition of the following values, one
>>value from each item:
>>
>>data justification: 0=default, 1=left, 2=center, 3=right
>>
>>heading justification: 0=default, 4=left, 8=center, 12=right
>>
>>vertical alignment: 0=default, 16=top, 32=middle, 48=bottom
>>
>>HTML format flag: 0=no, 64=yes
>>
>>HTML
>>Converts the data to HTML code.
>>
>>'title'
>>This is the text that appears in the caption at the top of the Web Browser
>>window. Adding 'title' creates the beginning and ending table tag as well as
>>putting the text you enter in the caption. Without 'title', a partial HTML
>>file with the selected data in table row format is generated.
>>
>>About the SELECT...HTML Command
>>The SELECT...HTML command is a modification of the SELECT command to output
>>data in HTML format. If a title is specified, a full HTML file will be
>>generated. Otherwise, a partial HTML file with the selected data in table
>>row format will be generated.
>>
>>Troy
>>
>>===== Original Message from Bernie Corrigan <[EMAIL PROTECTED]> at 3/22/02
>>3:11 pm
>>>Troy,
>>>
>>>Thanks for the offer.  Richard Kahl solved the problem.  Apparently you have
>>>to include a title in the select statement to get properly formatted html
>>>output.  Do you happen to know where any of this is documented?
>>>
>>>Bernie
>>>
>>>
>>>
>>>At 09:24 AM 3/22/2002 -0700, you wrote:
>>>>Bernie,
>>>>
>>>>Send me provatly the html file attached to an e-mail.  [EMAIL PROTECTED]
>>>>
>>>>This will work in any version of R:base going back to maybee 2.1
>>>>Change the [ brackets to < brackets.
>>>>
>>>>out t.html
>>>>write '[html>'
>>>>write '[body>'
>>>>write '[table>'
>>>>write '[TH>'
>>>>write '[td width=100>Number[/td> [td width=200>Make[/td>[/TH>'
>>>>set lines 0, set headings off
>>>>select '[tr>[td>', number, '[/td> [td>', make, '[/td>[/tr>' from cars order
>>>>by number
>>>>write '[/table>'
>>>>out screen
>>>>
>>>>Troy
>>>>
>>>>
>>>>===== Original Message from [EMAIL PROTECTED] at 3/22/02 12:58 am
>>>>>Troy -
>>>>>
>>>>>        Thanks for the response but it isn't relevant.  That's exactly what
>>>>>I did.  To repeat: "Everything is there but it isn't formatted properly."
>>>>>There seem to be no end of line markers or whatever tells the browser to
>>>>>skip to the next display line in the html file.  Is there something I can do
>>>>>to make the display look right.  For example I get:
>>>>>
>>>>>NumberMake1Ford2Chevrolet3Dodge
>>>>>
>>>>>instead of:
>>>>>
>>>>> Number   Make
>>>>>    1     Ford
>>>>>    2     Chevrolet
>>>>>    3     Dodge
>>>>>
>>>>>I've seen this feature demonstrated and the browser displayed nicely
>>>>>formatted information.  I'm having this problem with both Windows and DOS.
>>>>>
>>>>>Bernie
>>>>>
>>>>>========================================
>>>>>At 09:37 PM 3/21/2002 -0700, you wrote:
>>>>>>In the windows version, just use
>>>>>>
>>>>>>Launch file.htm
>>>>>>
>>>>>>and then windows should start your default browser and pull up your file.
>>>>>>
>>>>>>Troy
>>>>>>
>>>>>>
>>>>>>>===== Original Message From [EMAIL PROTECTED] =====
>>>>>>>Troy -
>>>>>>>
>>>>>>>        I just tried this in RBW 1.851 and it doesn't work very well.
>>>>>>>Everything is there but it isn't formatted properly.
>>>>>>>
>>>>>>>        Under RBD 1.850 and W2K the command ZIP COMMAND /C START file.htm
>>>>>>>comes up with a "Bad command or file name" error message.  Under W2K one
>>>>>>>should use ZIP CMD /C START file.htm.  Once again the information is all
>>>>>>>there but the presentation format is confused.
>>>>>>>
>>>>>>>Bernie
>>>>>>>
>>>>>>>
>>>>>>>At 03:48 PM 3/21/2002 -0700, you wrote:
>>>>>>>>ok, I did a little testing, and this is about the easiest way to
>generat an
>>>>>>>>html report and pull it up in a browser window.  This code works for
>R:base
>>>>>>>>for DOS on Win 98.  The zip command will need to be tweeked a little
>>>>>>>>depending on what OS you have.  If you are using RBwin, you could
>just use
>>>>>>>>LAUNCH t.htm instead.
>>>>>>>>
>>>>>>>>out t.htm
>>>>>>>>select * from tablename HTML
>>>>>>>>out screen
>>>>>>>>
>>>>>>>>zip command /c start t.htm
>>>>>>>>
>>>>>>>>Troy
>>>>>>>>
>>>>>>>>================================================
>>>>>>>>TO SEE MESSAGE POSTING GUIDELINES:
>>>>>>>>Send a plain text email to [EMAIL PROTECTED]
>>>>>>>>In the message body, put just two words: INTRO rbase-l
>>>>>>>>================================================
>>>>>>>>TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
>>>>>>>>In the message body, put just two words: UNSUBSCRIBE rbase-l
>>>>>>>>================================================
>>>>>>>>TO SEARCH ARCHIVES:
>>>>>>>>http://www.mail-archive.com/rbase-l%40sonetmail.com/
>>>>>>>>
>>>>>>>
>>>>>>>================================================
>>>>>>>TO SEE MESSAGE POSTING GUIDELINES:
>>>>>>>Send a plain text email to [EMAIL PROTECTED]
>>>>>>>In the message body, put just two words: INTRO rbase-l
>>>>>>>================================================
>>>>>>>TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
>>>>>>>In the message body, put just two words: UNSUBSCRIBE rbase-l
>>>>>>>================================================
>>>>>>>TO SEARCH ARCHIVES:
>>>>>>>http://www.mail-archive.com/rbase-l%40sonetmail.com/
>>>>>>
>>>>>>Troy Sosamon
>>>>>>Denver Co
>>>>>>[EMAIL PROTECTED]
>>>>>>
>>>>>>================================================
>>>>>>TO SEE MESSAGE POSTING GUIDELINES:
>>>>>>Send a plain text email to [EMAIL PROTECTED]
>>>>>>In the message body, put just two words: INTRO rbase-l
>>>>>>================================================
>>>>>>TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
>>>>>>In the message body, put just two words: UNSUBSCRIBE rbase-l
>>>>>>================================================
>>>>>>TO SEARCH ARCHIVES:
>>>>>>http://www.mail-archive.com/rbase-l%40sonetmail.com/
>>>>>>
>>>>>
>>>>>================================================
>>>>>TO SEE MESSAGE POSTING GUIDELINES:
>>>>>Send a plain text email to [EMAIL PROTECTED]
>>>>>In the message body, put just two words: INTRO rbase-l
>>>>>================================================
>>>>>TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
>>>>>In the message body, put just two words: UNSUBSCRIBE rbase-l
>>>>>================================================
>>>>>TO SEARCH ARCHIVES:
>>>>>http://www.mail-archive.com/rbase-l%40sonetmail.com/
>>>>
>>>>================================================
>>>>TO SEE MESSAGE POSTING GUIDELINES:
>>>>Send a plain text email to [EMAIL PROTECTED]
>>>>In the message body, put just two words: INTRO rbase-l
>>>>================================================
>>>>TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
>>>>In the message body, put just two words: UNSUBSCRIBE rbase-l
>>>>================================================
>>>>TO SEARCH ARCHIVES:
>>>>http://www.mail-archive.com/rbase-l%40sonetmail.com/
>>>>
>>
>>

================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/

Reply via email to