|
hi
you can create 2 formula field in report and set their values from code like this
report.fielddefinition.formulafields(fDateindex).text = "Date (yy, MM, dd)"
report.fielddefinition.formulafields(tDateindex).text = "Date (yy, MM, dd)"
the other is you can create 2 parameters in report and set their values form code like this
report.fielddefinition.parameterfields(fDateindex) = "Date (yy, MM, dd)"
report.fielddefinition.parameterfields(tDateindex) = "Date (yy, MM, dd)"
best of luck
Salman Sheikh
|
|
|
|
|
Hello,
I think u using the datetimepicker from the form means. We will send the datetimepicker's value as argument to the Report.
Consider
Dim objcrpdetail As New CryReprot
objcrpdetail.SummaryInfo.ReportTitle = "'"& DateTimePicker1.value &"'
objcrpdetail.SummaryInfo.ReportComments = "'"& DateTimePicker2.value &"'
objcrpdetail.SetDataSource(Dset.Tables(0))
CrystalReportViewer1.ReportSource = objcrpdetail
Here objcrpdetail is Report name as object instant.Then We passing Crystal Report's ReportTitle as DateTimePicker1.value and ReportComments = DateTimePicker2.value as argument to the report called CryReprot. And iam using Dset for data sending to the report.
In the crystal report -> Special Fields -> ReportTitle, ReportComments are available. Click n drag n use it in ur report..
Pls send me ur opinions to me.......
Senthil S
Software Engineer
|
|
|
|
|
hi frnds,
i want to enter only numeric values in a textbox, how can i ?.. like 123.256 or -123.456 ...
cheers..
|
|
|
|
|
use the textchanged event of the textbox and check if it is numeric with isnumeric function (returns a boolean)
|
|
|
|
|
Hello,
I think this is the solution for ur qustion. Pls reply wat ever u got, Ok
If (Asc(e.KeyChar)) = 46 Or (Asc(e.KeyChar)) = 45 Or (Asc(e.KeyChar)) = 8 Then
e.Handled = False
ElseIf e.Handled = Char.IsNumber(e.KeyChar) = True Then
e.Handled = True
End If
Senthil S
Software Engineer
|
|
|
|
|
Senthil S wrote: (Asc(e.KeyChar))
What is this ?
Senthil S wrote: ElseIf e.Handled = Char.IsNumber(e.KeyChar) = True Then
What does this do ?
The solution is to check Char.IsNumber and Char.IsControl, if both fail, then e.Handled should be true.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello,
I got the out put without any exception. I checked n then only i displayed this msg...
(Asc(e.KeyChar))
is return to check the "." n "-" key. If the user may not need to find the entered value to be number.
ElseIf e.Handled = Char.IsNumber(e.KeyChar) = True Then
if both condition fails then it return nothing in that textbox.
Use that code n check in vb.net 2005. N blame me....
Senthil S
Software Engineer
|
|
|
|
|
in keypress event you can write as follows
If Not Char.IsNumber(e.KeyChar) And Not Char.IsControl(e.KeyChar) And Not e.KeyChar = "." Then
e.Handled = True
ElseIf e.KeyChar = "." Then
If Me.Text.IndexOf(e.KeyChar) > 0 Then
e.Handled = True
End If
End If
Salman Sheikh
|
|
|
|
|
check out my article from the link in my signature on a self validating textbox...the numeric field doesn't handle negative but it wouldn't be hard to change that.
|
|
|
|
|
pretty sure this is the way to do it:
on key press:
if char.isdigit(e.keychar) = false then
if e.keychar = cchar("-") or e.keychar = cchar(".") then
e.handled = false
else
e.handled = true
end if
else
e.handled = false
end if
|
|
|
|
|
You need to make sure only one . or - is entered, and that a - is at the very front of the string.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Ah yes an oversight on my part. Thankyou.
|
|
|
|
|
A correction to my previous post:
if char.isdigit(e.keychar) = false then 'check if it's a number if its not do below:
if e.keychar = cchar("-") then ' if its a minus
if me.textbox1.selectionstart = 0 then 'check if the cursor is at the start
if me.textbox1.text.contains("-") = false then 'check if there is one already
e.handled = false 'allow it if its at the start and the only one
else
e.handled = true 'otherwise don't allow it
end if
else
e.handled = true 'if its not at start don't allow it
end if
elseif e.keychar = cchar(".") then ' if its a decimal place
if me.textbox1.text.contains(".") = false then 'check if there is one already
e.handled = false 'allow it if there is not one already
else
e.handled = true 'if there is one already don't allow it
end if
else
e.handled = true 'if its not a number, a minus or a decimal point, don't allow it
end if
end if
|
|
|
|
|
That is still not exact for several reasons:
- you may have different symbols for decimal point (see regional settings);
- you may want to allow a plus sign;
- you may want to allow thousands separators;
- you may want to allow floating-point notation as in -1,234,567e-23
My conclusion is it is not really worthwhile trying to predict the result of TryParse;
except for a sole minus sign, a sole plus sign, and a partially entered floating-point
number, all partially entered valid numbers are valid numbers on their own.
So I suggest you take care of those exceptions, and work with textchanged event only.
BTW: IMO there is no need to set e.handled=false, it is false to start with.
this seems a good place if any to use multiple exits.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
yes i agree, in my article and my textbox control i take much of this into consideration except for floating point and i understand the internationalisation requirements but i just gave him what he asked for, nothing more, its up to him if he want it to be more complex...i don't know what his user require.
|
|
|
|
|
An alternate approach would be to let the user enter whatever they wanted and then validate it by attempting to cast it to a decimal value:
Try
Dim i As Decimal = CDec(TextBox1.Text)
TextBox2.Text = i
MsgBox("Ok!")
Catch ex As Exception
MsgBox("Doh!")
End Try
If you are in ASP.NET then you could also use a CompareValidator (Set the operator to DataTypeCheck and the Type to Double). When the textbox loses focus the validator will fire.
=======================================
There are 10 type of people in the world....
those who understand Binary, and those who don't!
=======================================
|
|
|
|
|
hello boss,
Dim con As New SqlConnection("database=deltadatabase;user id=sa;pwd=sa;server=localhost")
con.Open()
Dim cmd As New SqlCommand("select * from tbl_adminlogin", con)
DataGridView1.DataSource = cmd.ExecuteReader,
i am using the above code.
there is no error execution
but not binding the data
is there anything that is missing?
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
try this plse
Dim con as new sqlConnection("server=local;database=me;user=sa;pwd=sa;")
dim cmd as new sqlcommand("select * from tbl",con)
dim objds as new dataset
objds=cmd.executenonquery()
datagrid.datasource=objds.table(0)
happy.....
cooollll...
|
|
|
|
|
dataset is necessary in the code
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
May be there is no data in table
Please try assigning cmd.ExecuteReafder to a DataReader and binding the DataReader to the grid. I think this may help.
|
|
|
|
|
Hello madam,
Dim con As New SqlConnection("database=deltadatabase;user id=sa;pwd=sa;server=localhost")
con.Open()
Dim cmd As New SqlCommand("select * from tbl_adminlogin", con)
DataGridView1.DataSource = cmd.ExecuteReader,
There is a problem in 4th line of ur code. Because ExecuteReader is need to open always upto the end. And the important thing is reader need to read continusly. but u did only one time ExecuteReader. To upload the value to datgrid the following code is enough...
Dim con As New SqlConnection("database=deltadatabase;user id=sa;pwd=sa;server=localhost")
Dim cmd As New sqldataadapter("select * from tbl_adminlogin", con)
dim dset as new dataset
cmd.fill(dset,"Tbl")
DataGridView1.DataSource =dset.table(0)
Pls reply wat ever u go...............
Senthil S
Software Engineer
|
|
|
|
|
data is there in the table
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Then try assinging it to dataset and then binding
|
|
|
|
|
Is it a WinForms or a ASP.NET application?
In ASP.NET you have to call DataGridView1.DataBind(); after setting the DataSource.
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
can we do gprs connection programaticly by vb.net
@h3aR
|
|
|
|