Publish dataset to HTML format

P

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).ToString)
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
 
Y

Yalcomania

answer for question 1:
System.AppDomain.CurrentDomain.BaseDirectory
this is the path where your exe file exist...
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top