|
Hi all,
I want to save a webpage that contains tables into an excel file
using VB or VB.Net
thanks in advance
Priya
|
|
|
|
|
What's the question?? What part of this are you having problems with??
You can't save the table directly to Excel. You have to parse it out of the HTML data and put it into the cells you want, one cell at a time.
|
|
|
|
|
Hello every one
I have a Vb 2005 Express application.
I am using a label over a picture box (it has a scroll bar).
I want to have the background color of the label as transparent so that whenever the picture box is scrolled in the background of the label, every thing can be seen
But when I do this the back color of the label is of the color it first gets..
What should be done??
|
|
|
|
|
A Transparent background is NOT transparent. You cannot see the other controls on a form through a transparent background. Transparent means that the label control will use the background color or image properties of the parent form. If the background of the parent form is yellow, you're label's background will be yellow.
You'll have to create your own version of the label control, providing the painting code to create the effect you want. You can find an example of such here[^], or here[^], or the entire list of Yahoo search results for ".net transparent label control[^]".
|
|
|
|
|
hi guys
i have installed framework 2 on my system but there was framework 1 already installed,
now i am facing a problem that in control panel, admin tools, framework2 configuration icon is not seen , it is only previously installed framework 1 configuration, why is that ?
thanks in advance
hello
|
|
|
|
|
That's because, starting with .NET 2.0, the security tools have been moved to the .NET Framework SDK. They don't ship with the redistributable version.
Read here...[^]
|
|
|
|
|
so how do we configure framework 2.0 security except using caspol ?
thanks in advance
hello
|
|
|
|
|
You didn't actually read the link I posted, did you? Perhaps followed the links on that page to the place where you can probably download the SDK version and grab the security tools from it, maybe...
|
|
|
|
|
Hi all,
I have created a COM wrapper component in c#.net. I generated .tlb file out of it. Also I added reference to tlb file in VB 6.0 application and can able to call functions of COM wrapper.
In C#, i have declared a stringcollection to collect all the errors.But while mapping,this String collection is converted to Unknown in VB 6.0 and becoz of that i got mismatch error.
so i changed the stringcollection to Arraylist in C#.
This Arraylist is converted to String in VB 6.0 while mapping.
and i got error while i tried to retrive the string.
Plz give me suggestions on how to call a Stringcollection/arraylist in VB 6.0.
Thanks in Advance,
cheers
sangeet
|
|
|
|
|
You cannot pass any System.Collection objects back to VB6. You'll have to convert this collection to an array of strings to send it back to VB6.
|
|
|
|
|
I can abke to write data from Dataset to XML File but the problem now i am facing is... i am getting the XML file like this
- <NewDataSet>
- <PatientID>
<patientRegId>NH0000412006</patientRegId>
<pat_name>SNI dsen dev1</pat_name>
<DOB>1980-06-22T00:00:00+05:30</DOB>
<gender>Male</gender>
<MaritalStatus>Married</MaritalStatus>
<Religion>Christian</Religion>
<presentAddress />
<city>Chennai</city>
<presentPIN>500013</presentPIN>
<Nationaity>Indian</Nationaity>
<patientRegId1>NH0000412006</patientRegId1>
<episodeNo>1</episodeNo>
<visitNo>2</visitNo>
<consultantId>5</consultantId>
</PatientID>
</NewDataSet>
but i want the same data in this format
<NewDataSet>
- <PatientID>
<patientRegId>NH0000412006</patientRegId>
<pat_name>SNI dsen dev1</pat_name>
<DOB>1980-06-22T00:00:00+05:30</DOB>
<gender>Male</gender>
<MaritalStatus>Married</MaritalStatus>
<Religion>Christian</Religion>
<presentAddress />
<city>Chennai</city>
<presentPIN>500013</presentPIN>
<Nationaity>Indian</Nationaity>
<patientRegId1>NH0000412006</patientRegId1>
- <episodeNo No="1">
<visitNo>2</visitNo>
<consultantId>5</consultantId>
</episodeNo>
</PatientID>
</NewDataSet>
this is my code
Dim SqlDataAdapter2 As New SqlDataAdapter(qry, sqlCon)
Dim ds As New DataSet
SqlDataAdapter2.Fill(ds, "PatientID")
ds.WriteXml("E:\\ss.xml")
Thanks in Advance
modified on Thursday, January 03, 2008 2:29:20 AM
|
|
|
|
|
What are the differences?
|
|
|
|
|
I need to crete child Nodes
|
|
|
|
|
I am guessing that you have more than one episode per patient and more than one visit per episode. You can always write your own filter to create the XmlDocument you need by iterating through the rows and adding the appropriate nodes to the XmlDocument. Then you can call the Write() method of the XmlDocument.
Volker Weichert
|
|
|
|
|
Yes you are right... but i dont know how to write node by node using Dataset.. pelase can u help me
|
|
|
|
|
Try something like this:
Dim doc As XmlDocument = New XmlDocument()
Dim tableName As String = "myTable"
Dim node, attrib As XmlNode
Dim parentNode As XmlNode = doc.DocumentElement
For Each row As DataRow In ds.Tables(tableName).rows
node = doc.CreateNode(XmlNodeType.Element, "myElement", myNameSpaceURI)
attrib = doc.CreateAttribute("myAttribute")
attrib.Value = row("myAttributeColumn").ToString()
node.Attributes.Append(attrib)
parentNode.AppendChild(node)
Next
You just need to adjust this to fit your own table.
Volker Weichert
|
|
|
|
|
i just wanna ask about how to code listview checkbox..i have two tables, one is for courses and the other one is for student information...all the courses will be shown at the listview and the admin will click any courses that students have to attend..and my question are.
1. how to code the listview checkbox at the button save coding?
2. If one student is registered to many courses, where should put all the courses data that been registered to that particular student,do i have to create another table?
|
|
|
|
|
lembayung wrote: 1. how to code the listview checkbox at the button save coding?
Why don't you use Gridview with checkedboxes?
lembayung wrote: do i have to create another table?
Yeah.. there will be three tables like Students, StudentCourse, Courses.
|
|
|
|
|
im new in vb so i dont much....regarding to ur reply, are you referring to vb.net?do we have gridview in visual basic?
|
|
|
|
|
Wow.
If you're that new to VB, you should be buying a book on winforms and reading it. Yes, VB.NET has a gridview control.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
This is what ive done....there's no error when i compile the codes but...all the data is not saved to studentcourse table...why is it so?
For i = 1 To ListView3.ListItems.Count<br />
If ListView3.ListItems(i).Tag = "" And ListView3.ListItems(i).Checked = True Then<br />
<br />
sql = "insert into studentcourse( peid, pengkod, bioid) " & _<br />
"values ( " & _<br />
"'" & ListView3.SelectedItem.SubItems(1) & "', " & _<br />
"'" & holdPENG & "', " & _<br />
"'" & holdBIO & "')"<br />
<br />
db.Execute sql<br />
<br />
ElseIf ListView3.ListItems(i).Tag <> "" And ListView3.ListItems(i).Checked = True Then<br />
<br />
sql = "update studentcourse set " & _<br />
"peid = '" & ListView3.SelectedItem.SubItems(1) & "', " & _<br />
"pengkod = '" & holdPENG & "', " & _<br />
"biod = '" & holdBIO & "' " & _<br />
"where peid= " & ListView3.ListItems(i).Tag
|
|
|
|
|
I'm running into a bit of a snag here;
I'm loading an excel spreadsheet using the following code
Dim Ole_connection As System.Data.OleDb.OleDbConnection
Dim Ole_command As System.Data.OleDb.OleDbDataAdapter
Dim Ole_dataset As New System.Data.DataSet()
Ole_connection = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;" & _
"data source=" & Str_filename & ";Extended Properties=Excel 8.0;")
Ole_command = New System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1$]", Ole_connection)
Ole_dataset.Clear()
Ole_connection.Open()
Ole_command.Fill(Ole_dataset)
Ole_connection.Close()
I have no control over the data that I receive (the excel spreadsheet)
it's generated by a pbx system at midnight.
The problem is the spreadsheet is not as flat as I was lead to believe, the first sample data I was given was 9 column of data;
in the real version most of the spreadsheet is like that except for the first 7 rows of the spreadsheet which is branding and titles and one or two pieces of info that I do need (dates and a group name)
Is there any way for me to figuratively force the square peg into the round hole? forcing the dataset to be 9 columns large(this is never going to change) and just shoving the 7 first rows of un-flat data wherever it may fall?
|
|
|
|
|
Would using p/invoke to open the Excel sheet as a COM object work as an alternate option for you?
|
|
|
|
|
I'm not certain, never used that before, so I am googleing it as type this;
Maybe a bit of background on what I'm doing will help
Every day our phone system gives us an excel spreadsheet of over 2000 rows, other then the aforementioned un-flat data in the 7 lines, the sheet contains;
this wont show up properly here but
-A small header
Workgroup: WG-NBA-Montreal (continued)
Username: username (Active)
Agent Name: Testing, The fish
-Titles for every column:
" Logged-in Time Frame or Reason Unavailable""Logged-in Time or Time Unavailable" | Begin Time | End Time | Originated
Logged-in Time Frame 11/5/2007 12:04:17 11/5/2007 20:25:54 08:21:37 23
Pre-Shift Unavailable 11/5/2007 12:04:17 11/5/2007 12:08:30 00:04:13
Initializing Unavailable 11/5/2007 12:04:17 11/5/2007 12:04:17 00:00:00
Break Unavailable 11/5/2007 14:44:15 11/5/2007 14:44:15 00:00:00
-several more rows for one agent
- then the header portion for the next agent and row of data for him, and so on and so forth.
This is from the sample I was given so the data is fake. but the format is right
anyway what my application does is load the sheet into a table and then I parse for each agent the various states they are in during the day and build a report that says when they are late, when they take breaks that are too short or too long based on bounds that are configured.
right now this is done manually so I'm just automating the process to shave a few hours of aggravation for the person who has to read those 2000 lines
everything was working fine with the sample data, but once those 7 lines of header came in everything got scrapped and most of what was there before is now null.
|
|
|
|
|
Since you will be opening the Excel file not as a recordset, but as a spreadsheet, you will be able to write your parser anyway you want, so I imagine your requirement should not be so difficult to implement.
Hope you got the information you needed on p/invoke?
|
|
|
|