1 Attachment(s)
WebBrowser control report application
Hi Folks,
need some help to create tables, which will be displayed as webpages-HTML code, using WebBrowser control. Table will show catalogies of products (clothes), which needs to be displayed as HTML table.
Should be 4 categories of tables-reports: Women, Men, Kids, Combined, which will be chosen by hitting button: attached screenshot
Table should display separate cells: The Product name, Price, and Units In Stock. Like for example hitting "Men" button should display: Product name, Price, and Units In Stock.
The information needs to be pull out of doctext file:
Category,ProductName,Price,UnitsSold,UnitsInStock
men,shoes,20,34,6
men,boots,30,23,8
men,pants,15,51,4
men,waists,10,67,3
men,shirts,10,34,3
men,shorts,10,53,5
women,shoes,20,78,7
women,boots,30,13,8
women,pants,15,43,1
women,dresses,40,52,3
women,skirts,20,67,5
women,sweaters,30,43,1
kids,shoes,10,45,9
kids,pants,10,32,4
kids,shorts,7,87,2
kids,shirts,7,43,3
kids,sweaters,15,64,8
kids,skirts,10,23,4
Can use Mid(), Len() and Instr(), but no Split()
There is code, which is for reading one line only
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Price As Double
Dim UnitsSold As Integer
Dim UnitsInStock As Integer
Dim fileStreamReader As IO.StreamReader
Dim lineIn As String
fileStreamReader = IO.File.OpenText("../../Clothes.txt")
While Not fileStreamReader.EndOfStream
lineIn = fileStreamReader.ReadLine()
MsgBox(lineIn)
End While
fileStreamReader.Close()
End Sub
Any help would be appreciated.
Thanks.
Re: WebBrowser control report application
First, use Excel to Import and save as a TABLE, or create the DB and import the data
Re: WebBrowser control report application
Why can't you use .split? That would be the obvious choice here
Also why do you say can use Mid() Len() and Instr() all of which are old VB functions rather than VB.Net which would be .Substring .Length and .IndexOf
I would say use split on linein and that will give you your values in a string array
Personally I would not use Excel at all, I would perhaps use a database and import the data into that or if the dataset is not to large I may consider using a class and a listof
Also may consider just treating the text file as a data source for a data adapter or reader as needed.
Re: WebBrowser control report application
that's what I need to do: just treating the text file as a data source. The problem is to pull out info of it and display as HTML table
Re: WebBrowser control report application
If you treat it as a data source then that means the data will be in fields, you just need to loop through your resulting reader and build your html from the data there. Should be pretty simple.