|
CodingYoshi wrote: Dim emp1 As New Employee()
That will declare the reference variable emp1, then it will create a new instance of the Emplyee class and assign it's reference to the variable.
CodingYoshi wrote: Dim emp2 as Employee = emp1
That will declare the reference variable emp2 and assign to it the reference from the varaible emp1. The result is two reference variables that are referencing the same object.
CodingYoshi wrote: Dim emp2 as New Employee = emp1
That doesn't compile at all, does it? You probably mean:
Dim emp2 as New Employee()<br />
emp2 = emp1
That will declare the reference variable emp2, create a new instance of the Employee class and assign it to the variable. Then it will throw away that instance and instead copy the reference from the emp1 variable. The result is two reference variables that are referencing the same object.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Suppose I have an application that takes orders and save them in an Access databse. And after taking each order I need to print a summary of that order. The summary should contain the items, prices, order number... I need to automatically print this summary right after I save the order. Can this be done in VB.net?
I tried to save the orders in a table called Order1 & the summary in a table called Summary. And I retrieved the need information from Summary to a new form. But this form is being only printed at run time, which I want to avoid?
So is there any way to automatically print the summary for each order, right after the order itself?
I am using a VB.Net application with an Access database.
Thank you in advance.
John,
|
|
|
|
|
It is not clear to me what you mean by wanting to avoid printing at run time but...
If you want to print via .NET you will need to work with the PrintDocument class (System.Drawing.Printing namespace). I am certain you can find some articles on this site and/or via an internet google that provide examples of working with the PrintDocument class.
Good luck with your project.
|
|
|
|
|
The only function I found & worked with me was a function that prints a form at run time. Which means to print the desired form I should open the form, and with a button click on that form the pritings is intiated. Otherwise, The print function will print me the background & not te summary of th order I want.
You get my point now? It is kinda complicated actually. I just can't find the correct printing function.
John,
|
|
|
|
|
You can definitely do what you want to do via the PrintDocument class/object when the order is received, as opposed to just using some function that automatically prints a form with a button click sometime after the order. With the PrintDocument class you would programitically do the formatting (output lines, fonts, etc.) and tell the object what printer to use. It is a little complicated but, once again, there are article examples floating around on this site and elsewhere on the web.
|
|
|
|
|
Here's a thought ...
1) Create your report with MS-Acess
2) Create a macro in MS-Access that Opens the report and uses the default view of Print, then quits Access; call it myMacro
3) From the command line you could use this syntax to have the report automatically generated: "msaccess c:\temp\db1.mdb /x myMacro"
The idea is that from your VB.net program, you issue the above command line and have MS-Access do the report for you.
|
|
|
|
|
You may generate html document from the same database, and run javascript for printing this page, this page may blink for a while and also write close window command in javascript.
May this help.
Happy Programming.
|
|
|
|
|
Hi,
Im working with Reporting services. I can create the report, but i want the user to:
get a page where he can input things in textboxes and the report is generated according to that... in vb.net code....
can you please help me with this..any help!
|
|
|
|
|
Here is a stub of code that I used in an application to launch a report from a command button.
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Dim myReport As New ReportDocument()<br />
Dim rptConnection As IConnectionInfo<br />
<br />
Dim paramFields As New ParameterFields()<br />
Dim paramField As New ParameterField()<br />
Dim discreteVal As New ParameterDiscreteValue()<br />
Dim rangeVal As New ParameterRangeValue()<br />
Dim ActiveEmpDR As TCDataSet.qry_ActiveEmpsRow<br />
Dim i As Integer<br />
<br />
Dim sGlobalDBname As String<br />
'Dim myTableLogOnInfos As TableLogOnInfos<br />
<br />
Me.CrystalReportViewer1.ReportSource = Nothing<br />
<br />
<br />
sGlobalDBname = Mid(My.Settings.dbConnectionString, InStr(My.Settings.dbConnectionString, "Source") + 7)<br />
'Debug.Print("rptPath=" + My.Resources.rptPath)<br />
<br />
myReport.Load(My.Settings.rptPath.ToString + "\rptTime.rpt")<br />
<br />
For Each rptConnection In myReport.DataSourceConnections<br />
rptConnection.SetConnection(sGlobalDBname, sGlobalDBname, False)<br />
Next<br />
'myTableLogOnInfos = Me.CrystalReportViewer1.LogOnInfo()<br />
<br />
'For Each myTableLogOnInfo As TableLogOnInfo In myTableLogOnInfos<br />
'myTableLogOnInfo.ConnectionInfo.ServerName = sGlobalDBname<br />
'myTableLogOnInfo.ConnectionInfo.DatabaseName = sGlobalDBname<br />
'Next<br />
<br />
paramField.ParameterFieldName = "LoDate"<br />
discreteVal = New ParameterDiscreteValue()<br />
discreteVal.Value = Me.MonthCalendar1.SelectionStart<br />
<br />
paramField.CurrentValues.Add(discreteVal)<br />
paramFields.Add(paramField)<br />
<br />
paramField = New ParameterField()<br />
paramField.ParameterFieldName = "HiDate"<br />
discreteVal = New ParameterDiscreteValue()<br />
discreteVal.Value = Me.MonthCalendar1.SelectionEnd<br />
paramField.CurrentValues.Add(discreteVal)<br />
paramFields.Add(paramField)<br />
<br />
paramField = New ParameterField()<br />
paramField.ParameterFieldName = "myEmpID"<br />
<br />
If (Me.but_All.Checked) Then<br />
Me.QryActiveEmpsBindingSource.MoveFirst()<br />
For i = 1 To Me.QryActiveEmpsBindingSource.Count<br />
ActiveEmpDR = CType(CType(Me.QryActiveEmpsBindingSource.Current, DataRowView).Row, TCDataSet.qry_ActiveEmpsRow)<br />
' Debug.Print(ActiveEmpDR.EmpID + " " + ActiveEmpDR.Full_Name)<br />
<br />
discreteVal = New ParameterDiscreteValue()<br />
discreteVal.Value = ActiveEmpDR.EmpID.ToString<br />
paramField.CurrentValues.Add(discreteVal)<br />
<br />
Me.QryActiveEmpsBindingSource.MoveNext()<br />
Next<br />
Else<br />
discreteVal = New ParameterDiscreteValue()<br />
discreteVal.Value = Me.ComboBox1.SelectedValue.ToString<br />
paramField.CurrentValues.Add(discreteVal)<br />
End If<br />
'Finalize the EmpID field and all of its values.<br />
paramFields.Add(paramField)<br />
<br />
'myReport.SetParameterValue()<br />
<br />
CrystalReportViewer1.ParameterFieldInfo = paramFields<br />
<br />
<br />
Me.CrystalReportViewer1.ReportSource = myReport<br />
Me.CrystalReportViewer1.Visible = True<br />
<br />
End Sub<br />
|
|
|
|
|
Hi to all,
I need source code for scanning an image in format of bmp or tif from vb.net windows based application directly and possible to perform operation on that image like rotating...
So if anyone knows it then reply me as soon as possible.
Its urgent.
|
|
|
|
|
krinaljariwala wrote: I need source code
This is not a code shop
krinaljariwala wrote: vb.net windows based application directly and possible to perform operation on that image like rotating...
You need to use some library/component which supports the scanning of the documents.
There after, you can easily implement(find examples on Google) for operation like rotatiing, cropping etc...
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
|
Ex: convert from dat to 3gb
|
|
|
|
|
farouk gaber wrote: you have convert porgraming in vb.net2008 ?
farouk gaber wrote: convert from dat to 3gb
Well, there is no inbuilt support ofr that in .Net (or in any other language).
You will need to do this your self or find some already developed component/library which does it.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
What the heck are you asking?
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
Once again, I fail to understand the question either because I have left my telepathic head at home, or more likely, you have simply written a load of rubbish.
How do you expect anyone to help if you don't ask a question?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi,
someone has a working code of this control. I already found some in C but I can't convert them into VB.net
Thanks Jan
PS: I work with 2008
|
|
|
|
|
jan212r wrote: someone has a working code of this control
Which Control? You didn't even find time to write your question poperly and expect someone to give you cooked code.
jan212r wrote: PS: I work with 2008
So what?
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Ditto............didn't even provide the link so we could even look at what he is talking about.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
I beleave that the title speaks for itself
So i'm looking for a multiline listview
Even that on the codeproject there are several articels Ex:
[^]
Jan
|
|
|
|
|
I need the following format: @@-@@@@-@@
I know you do the following with something that is a numeric value:
microsoft.VisualBasic.Format(12345678, "##-####-##")
What do you do if you have an alphanumeric string and you want the same format? Is there a way to do this without parsing the string? I realize I'm probably missing something simple here.....
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
Not pretty, but it works...
microsoft.VisualBasic.Format(cdbl("12345678"), "##-####-##")
|
|
|
|
|
Thanks for the reply,
I should have been more specific in my example. The VB.Format function will work with numeric values like you pointed out, but what do you do with alphanumeric values.
Suppose I want to format: "AB1234Z7" in the same format (@@-@@@@-@@)?
Is there a built in way to accomplish that or do you need to manually parse the string and build a new one?
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
Any of C.P.s finest have an answer for poor ol' me?
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
The most efficient way, I think, is to use a StringBuilder:
Dim formatted As String = New StringBuilder(10) _
.Append(alphaNumeric.Chars(0)) _
.Append(alphaNumeric.Chars(1)) _
.Append('-') _
.Append(alphaNumeric.Chars(2)) _
.Append(alphaNumeric.Chars(3)) _
.Append(alphaNumeric.Chars(4)) _
.Append(alphaNumeric.Chars(5)) _
.Append('-') _
.Append(alphaNumeric.Chars(6)) _
.Append(alphaNumeric.Chars(7)) _
.ToString()
The StringBuilder uses an internal string buffer, and the ToString method will return that buffer as a regular string, so there is no extra copying going on. As you define the correct size when creating the StringBuilder, there will be no reallocation of the buffer or unused overhead at the end of the string.
Another method is to use a regular expression. It's not as efficient, but fairly short:
Dim formatted As String = Regex.Replace(alphaNumeric, "(.{2})(.{4})(.{2})", "$1-$2-$3")
Despite everything, the person most likely to be fooling you next is yourself.
modified on Thursday, August 28, 2008 5:15 PM
|
|
|
|