|
I'd like to help, but I can't make heads or tails of your problem description.
You have a DataGridView and, I think, you want to show 2 columns of data from a database, one is a TextBox column, and the other in a ComboBox column??
|
|
|
|
|
I have program that generates a report. I'm trying to output the report as a pdf file. I can get it to save to the computer in pdf format however the document only shows half the form as the other half is cut off. I've been trying to change the layout and page types without success. Anyone have any ideas how to get the report to output as either one piece or on 2 pages? Here is my code for the outputting part.
Public Sub SavePDFReport()<br />
' gives user ability to output copy of report as PDF and choose a location to save it to<br />
MsgBox("Save file in PDF format by selecting CutePDF as printer.", MsgBoxStyle.OkOnly)<br />
Dim pd As New PrintDialog<br />
<br />
pd.ShowDialog()<br />
<br />
PrintPDFForm.PrinterSettings.PrinterName = "CutePDF Writer"<br />
PrintPDFForm.PrintAction = Printing.PrintAction.PrintToPreview<br />
PrintPDFForm.Print()<br />
<br />
<br />
<br />
End Sub
|
|
|
|
|
If you have a library to generate PDFs, your best bet is to create a screenshot of your app and turn the bitmap into a PDF.
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 )
|
|
|
|
|
|
Set FormBorderStyle to "none".
|
|
|
|
|
Java is a programming language with the feature "security". I just want to know how much vb.net is concerned with it?
Please answer this simple question....
Help mee
|
|
|
|
|
Java is a language, VB.NET is another. Neither is secure or insecure. Only the code you write in these languages is secure or otherwise.
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 )
|
|
|
|
|
I am using a DataGridView.
I will like to be able to edit the data entered by a user into the cells.
I put in a Validating procedure but when I check the contents of the cell it is Nothing.
Row = e.RowIndex : Col = e.ColumnIndex
Data = grdHSBC.Item(Col, Row).Value
Data and grdHSBC.Item(Col, Row).Value are Nothing when the procedure get control.
I do not understand this type of behavior and was hoping that someone could explain and also how do you check the validity of data if the cell returns Nothing???
|
|
|
|
|
If you are doing this validation on cell leave or any other leave event it will have this issue
Instead put this validation in end-edit event
Good luck
|
|
|
|
|
I have a client that works in security and has a program that displays all of the instances when a key card is used at one of the many locked doors they have and registers who's key was used, the door they were trying to open, the time of the attempt, and whether they were successful or not.
Now, the software they have can pull up a report based on a date range but it can't sort any other way. That is when they called me. I found that the format that the program saves a report only saves the schema of the report fields and none of the data, but I could send the report to the microsoft xps printer and got it to save me a xps file (the document printer would only save it as a tiff image).
So, now I have an xps document that I would like to load into a vb.net 2.0 app to do some searches on the document. Is there a way for vb.net to read this document as is, or do I need to convert it to another format?
|
|
|
|
|
XPS describes an image of a printed page, not the data in it, kind of like PostScript or HP's PCL. The .NET Framework, nor anything else for that matter, has no methods to turn the file back into the data that generated it. Basically, the file is useless to you.
You have to find some other way to export the data from that app or have it print in some other format that can output plain text or an XML file, or find some kind of export function in it.
|
|
|
|
|
Okay, that is what I was afraid of. Back to the drawing board.
|
|
|
|
|
I have used some data mining software in the past for just this sort of thing. Have a look at Monarch[^] by DataWatch.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
XPS is just XML compressed with zip. (If you change the file extension from .xps to .zip, you can view the contents with WinZip)
Once you figure out how to load it into VB.Net, (try looking up PrintDocument) you should be able to traverse the XML. Depending on the format of the report, you should be able to recover the data into a usable format.
But that sounds like a lot of work to avoid if possible
|
|
|
|
|
Can any1 help me.
am developing an email client that works fine behind an internet connection which is automatic and has ip address assigned by a router on the network
When i move to a different environment which uses a proxy server and port to connect to the internet, the email fails to send.Thank you.
Pete
phatkin
|
|
|
|
|
You're going to have to consult with the people who run your proxy server. Normally, you'd tell your client to connect to the proxy server, not the SMTP server. The proxy would then connect to the SMTP server for you. How you tell the proxy server which server to connection to for you is determined by the proxy.
|
|
|
|
|
Please this is my code...and our Proxy server is 192.168.1.5 with port 8080, i want to know a little about what you are telling me before i o to see the ppl at the server room. Am in school
My email class code here
............................
Imports System.Net.Mail
Imports System.Threading
Imports System.ComponentModel
Public Class Email
Dim n As newMail
'''
''' This is a class library for sending emails with attachments
''' created by PETER ANKOMAH
''' '''
''' <remarks>
Public Sender As MailAddress
Public Receipients As New MailAddressCollection
Public Subject As String
Public Body As String
Public Priority As MailPriority
Private Credentials As System.Net.NetworkCredential
Public Smtp As SmtpClient
Public email As New MailMessage
Public HtmlBody As Boolean
Public DelivNotification As New DeliveryNotificationOptions
Public ReplyTo As MailAddress
Public Cc As New MailAddressCollection
Public at As Net.Mail.AttachmentCollection
Private Attach As Net.Mail.Attachment
Public Bcc As New MailAddressCollection
'Public handler As New SendCompletedEventHandler(AddressOf SendcompleteCallBack)
Public mainsp As newMail
Public EmailName As String
Public datestamp As Date
'Public Sub SendcompleteCallBack(ByVal sender As Object, ByVal e As AsyncCompletedEventArgs)
' Dim msg = CStr(e.UserState)
' If e.Cancelled Then
' n.WLabel1.Text = "Message Cancelled"
' ElseIf Not e.Error Is Nothing Then
' n.WLabel1.Text = "Error Occurred:" & e.Error.ToString
' Else
' n.WLabel1.Text = "Message Sent Successfully"
' End If
'End Sub
Public Sub SetSMTPClient(ByVal Host As String, ByVal Port As Integer _
, ByVal EnableSSL As Boolean)
Smtp = New SmtpClient
With Smtp
.Host = Host
.Port = Port
.EnableSsl = EnableSSL
End With
End Sub
Public Sub SetCredential(ByVal Username As String _
, ByVal Password As String)
'we create new structure credential instance
Credentials = New Net.NetworkCredential
' Credentials.Domain = domain
Credentials.UserName = Username
Credentials.Password = Password
End Sub
Public Sub AddAttachment(ByVal fileName As String)
Attach = New Net.Mail.Attachment(fileName)
' at.Add(New Net.Mail.Attachment(fileName))
email.Attachments.Add(Attach)
' MsgBox("Attach added")
' Attach.Dispose()
End Sub
Public Sub SendEmail()
' AddHandler Smtp.SendCompleted, handler
Dim obj As Object
With email
.From = Sender
For Each obj In Receipients
.To.Add(obj.ToString)
Next
.Subject = Subject
If HtmlBody = Nothing Then
HtmlBody = False
End If
.IsBodyHtml = HtmlBody
.Priority = Priority
.ReplyTo = ReplyTo
For Each obj In Cc
.CC.Add(obj.ToString)
Next
For Each obj In Bcc
.Bcc.Add(obj.ToString)
Next
.Body = Body
End With
obj = Nothing
With Smtp
.Credentials = Credentials
.EnableSsl = True
End With
Try
Dim result As String = "going!!!!"
Smtp.SendAsync(email, result)
Catch ex As Net.Mail.SmtpException
MsgBox(ex.ToString)
End Try
'Smtp = Nothing
'email.Dispose()
End Sub
End Class
phatkin
|
|
|
|
|
There's nothing to change in the code other than the IP address of the server. You have to give it the IP of the proxy server, and somehow (this is where talking to the proxy people comes in!) specify the SMTP server you're going to use to send the mail. It's also entirely possible that this isn't going to work at all because the SmtpClient class doesn't really support using a proxy server.
|
|
|
|
|
Thank you sooo much. Am about to talk to the Proxy pple but i hope the visual basic team can see my problem. Am a die-hard microsoft fun and want everything possible with VB.
SMTP CLASS SHOULD SUPPORT PROXY SERVERS
phatkin
|
|
|
|
|
prubyholl wrote: Am a die-hard microsoft fun and want everything possible with VB.
Everything is possible in a definite route. When you follow the route, you can reach the destination.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
There are other 3rd party libraries that do fully support proxies. ALl you have to do is Google for ".net smtp client proxy" to find them.
|
|
|
|
|
|
I used the design view to create a datagrid connection, adapter and dataset.
I the code view i have
ResCasesDataSet2.Clear()
ResCasesSqlDataAdapter.Fill(ResCasesDataSet2)
However i get an error "Login failed for user ' '"
This worked perfectly when i used access database but not with Ms Sql Server.
jesa
|
|
|
|
|
Your SQL server has a password set. The default is user 'sa' and password 'password' (I think). You need to generate a connection string; to do that you need the password. Talk to whomever is administering your database.
|
|
|
|
|
I have a connection string with a username and password which connects, opens but still throws an error "Login failed for user ' ' "
on the code line
ResCasesSqlDataAdapter.Fill(ResCasesDataSet2)
JESA
|
|
|
|