|
If you put the code I have provided behind a button on the form, and change the GridView1.RenderControl(htmlWrite) to the name of your grid, it does exactly what you want.
Protected Sub Button69_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button69.Click
Response.Clear()
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls")
Response.Charset = ""
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.ContentType = "application/vnd.xls"
Dim stringWrite As New System.IO.StringWriter()
Dim htmlWrite As New HtmlTextWriter(stringWrite)
GridView1.RenderControl(htmlWrite)
Response.Write(stringWrite.ToString)
Response.End()
End Sub
|
|
|
|
|
Hi chilly,
i'm getting the error as "Name 'Response' not declared"?.
i tried to add the namespace system.web,
but of no use..can u pls guide me.it is an windows applicatio using vb.net
sorry for late reply & thank u very much.
|
|
|
|
|
Hi,
I want to store the result of crystal report sum formula value in the vb.net global variable. so please suggest how i do this.
Thanks
~Khatri Mitesh
khatrimitesh@hotmail.com
Bikaner (Rajasthan)
INDIA
|
|
|
|
|
i have to add items in list view from a string variable 'filename'
how can i add this to a list view??
purvas
|
|
|
|
|
In 1994 i used think how will the Computing world be in 2010. I lived in times of VS2002, VS2003, VS2005, VS2008 and there is VS2010 Comming and to my suprise there are still people using VB6.
VB6 is dead wake up
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
Try this MSDN article out. ListView Class[^]It has some sample code in it for you. Pretty straight forward stuff.
|
|
|
|
|
Yeah, but he's using VB6, not VB.NET.
|
|
|
|
|
saprva wrote: i have to add items in list view from a string variable 'filename'
You mean, you have a variable FileName, and this variable contain one value like
FileName = "Somthing"
and you want to add the content of FileName which is 1 word to list view?
Me.ListView1.ListItems.Add , , FileName
Try to get a book or Press F1 or Search google.
Samir R. Ibrahim
|
|
|
|
|
Hi!!
Im tryingo to make a transparent video, i mean i want to add the fade effect to a panel where im playing a video with directx.
its like a video mixer or mix two videos with some kind of effect.
Im working on Vb.net. Thanks.
|
|
|
|
|
Is there a tool or application to spell check a vb.net application
|
|
|
|
|
Copy and paste it into word lol?
|
|
|
|
|
Yes[^].
Although you can make one of your own.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
जय हिंद
|
|
|
|
|
I'm pretty new to coding to the Win32 API, so this may be a newbie question:
I've got an application writen in VB6 that opens a PDF document in Adobe Acrobat Reader with the /p switch, so that it shows the print dialog window. When the user clicks "ok", I want the document to print and Acrobat Reader to close.
I open Acrobat Reader using the Shell command, and I close it by sending WM_CLOSE messages to the process (following examples I found online).
This all worked fine when I was using Acrobat Reader version 7, but I recently upgraded to version 9, and now I'm finding that the task manager shows AcroRd32 running even after all the windows have closed. This is a problem, since if the user tries to print a second document, a new window doesn't open and no print dialog window appears.
I can get the process id, and I've tried using TerminateProcess to end it, using code:
lngResult = TerminateProcess(lngProcessId, 0&)
This returns a zero, which I understand means that an error has occurred, but GetLastError also returns a zero, which seems to mean no error was trapped.
Can anyone help me understand what's going on, or what I'm missing here? Thanks very much for your help!
|
|
|
|
|
see this
http://www.dotnetfunda.com/articles/article191.aspx[^][^]
Hope it Helps
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
Thanks Vuyiswa, but that solution uses dot net, and I'm using VB6.
For those interested, I did find a solution:
Private Const PROCESS_TERMINATE = 1
Dim lProcessHandle As Long, lResult As Long, lMyProcessID as Long
lProcessHandle = OpenProcess(PROCESS_TERMINATE, True, lMyProcessID )
lResult = TerminateProcess(lProcessHandle, 0&)
which seems to work. I think my problem was that I was trying to send TerminateProcess lMyProcessID instead of lProcessHandle ...
|
|
|
|
|
Welcome, Did you consider moving to .NET ?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
I have considered it, but I am not primarily a VB programmer. I spend most of my time in the Notes/Domino web world -- LotusScript, JavaScript, HTML, and some of the rest on the iSeries (RPG). The VB apps we have are just oddball little things -- this one prints a PDF file automatically from an RPG program -- and since I'm reasonably comfortable in VB6 that's what I did it in.
I've heard that moving to .NET is a big learning curve, so up to now I've stayed away from it ...
|
|
|
|
|
Then when you get Stuck you wont get help
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
Hello once again guys.
I used this coding for the showing of date and time. this is supposed to appear when i press a command button named "new record".
text1=date
text2=time
But this doesn't work! Any better one for time and date?
ST
|
|
|
|
|
How about DateTime.Now()?
Dim currentTime As DateTime = DateTime.Now()
TextBox1.Text = currentTime.ToShortDateString()
TextBox2.Text = currentTime.ToShortTimeString()
|
|
|
|
|
Well, i don't know much but does this show the current time on your computer in a textbox?
Thankyou
ST
|
|
|
|
|
|
Well, i tried it but it is giving a compile error: syntax error and this gets highlighted
Dim currentTime As DateTime = DateTime.Now()
What could the problem be?
Thankyou!
ST
|
|
|
|
|
I think you're using VB6, that is the problem.
|
|
|
|
|
you are right. i am using vb6. is there any better way of doing this?
Regards
ST
|
|
|
|