By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,319 Members | 2,115 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,319 IT Pros & Developers. It's quick & easy.

Publish dataset to HTML format

P: n/a
PK
Hi All,

i got few questions to ask regarding about publishing dataset to html format !!!

-------------------
PublishHTML("C:\Inetpub\wwwroot\Report.htm", myDataSet1.Tables("table01"))

Quesion 1 - the above is the command to run the "PublishHTML" procedures...
i want to know if the file path is dynamic change, and is changed according to the time when user install the application.
if there is a way to change to something like ".Application/Report.htm" so no matter where i install my application, i am able to retrieve that directory report.
i remember there is a way to show the application path in VB6....so no matter what directory i install the application...as long as i type XXX this will refer to the application path.

Question 2 - the above command line, I need more than 1 table, so in that case, how should i assign that table ? assign dataset instead of table ?
---------------------------

Question 3 - pls refer to the following code....The following procedure only consist of 1 table, but i need to have more than 1 table...
pls guide me how to to it....
Public Sub PublishHTML(ByVal path As String, ByVal table As DataTable)
Dim output As New StreamWriter(path, False, UnicodeEncoding.Default)
Dim iIndx, RowIndex As Integer
output.WriteLine()
output.Write("<HTML><HEAD><Title>Baroque Mobile</Title></HEAD>")
output.Write("<body bgcolor=""#FFFFFF"">")
output.Write("")
' Start Table
output.Write("<TABLE Border = 0 BGCOLOR=""#FFFFFF"" WIDTH=""90%"">")
'Start Column Header
For Each col As DataColumn In table.Columns
output.Write("<TD>")
output.Write("<font face=arial size=1><B> &nbsp")
output.Write(col.ColumnName)
output.Write("</B></font>")
output.Write("</TD>")
Next

output.Write("</TR>")
---------------------
' START COLUMNS AND ROWS
For RowIndex = 0 To table.Rows.Count - 1
output.Write("<TR>")
For iIndx = 0 To table.Columns.Count - 1
output.Write("<TD>")
output.Write("<font face=arial size=1><B> &nbsp")
output.Write(table.Rows(RowIndex).Item(iIndx).ToSt ring)
output.Write("</B></font>")
output.Write("</TD>")
Next
output.Write("</TR>")
Next
' END COLUMNS AND ROWS
'------------------------------------
output.Write("</TABLE>")
' End Table
output.Write("</BODY></HTML>")

output.Close()
End Sub
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
answer for question 1:
System.AppDomain.CurrentDomain.BaseDirectory
this is the path where your exe file exist...
Nov 20 '05 #2

P: n/a
Hi PK,

Here a sample I made once for somebody
http://www.google.com/gr************...TNGP11.phx.gbl

And not for me, however there are some who use a newsreader which gives
problems with HTML posting, they never post back, something to remember on
next time.

I hope this helps?

Cor

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.