473,395 Members | 1,637 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Publish dataset to HTML format

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
2 1662
answer for question 1:
System.AppDomain.CurrentDomain.BaseDirectory
this is the path where your exe file exist...
Nov 20 '05 #2
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Patrick Stephens | last post by:
Hi, I produce a 30 page report that has data and two charts per page, using Access 2000. My boss wants the report in WORD format. When I use the "office links" to "Publish it in Word" I get all...
10
by: andrewcw | last post by:
I read in a earlier post that I can get the column of a grid to sort by datetime if the column type was set as Date I deserialize my XML and one attribute of the XSD has type as dateTime but upon...
1
by: Jeroen Pot | last post by:
Hi, I have a dataset "Mydataset" which contains of a few fields. (lets say dept_id and dept_name) A user can select several of these, and i want to export this to an access database. I have...
7
by: Sharon | last post by:
I have successfully loaded a DataSet object with a XML schema (XSD). Now I wish to populate the tables that was created in the DataSet. I have an XML file/string that contain all the needed data...
2
by: Martin | last post by:
Hi! I'm new to ASP.NET WebApplications and wonder whether I've missed something out when programming it. I'm grateful for any hints to this problem! Thanks very much for your efforts! Martin...
1
by: chrisn | last post by:
I want to store text with HTML tags in an XML field, and to do this I plan to use a CDATA field so that malformed HTML tags don't corrupt the XML file structure (I have no control over the format...
13
by: Maxwell2006 | last post by:
Hi, We are having a debate over using DataSet as return value type for web services. The problem is that we don't know whether Java applications can use DataSet
6
by: Helpneeded | last post by:
On my web site, I want to display information about my company. I want this info to come from a doc file or any other format, so that whenever I change the contents of this file, the web site is...
15
by: Joseph Geretz | last post by:
I'm a bit puzzled by the current recommendation not to send Datasets or Datatables between application tiers. http://support.microsoft.com/kb/306134 ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.