|
|
In .net 2005,pass the parameter fields to Crystal Report through vb.net
is successfully running.
But in .net 2003,i don't know How to pass the parameter fields to Crystal Report through vb.net.so can any body teach me how to pass the parameter fields to Crystal Report through vb.net in .net 2003.i want in windows application.
|
|
|
|
|
Hi,
In regard to your query I would suggest you to take a look at the following code snippet in the following code snippet I have explained how to pass Date parameter to Crystal report.
first you have to import thease name spaces:
-------------------------------------------------------------------------------------
BEGIN CODE
Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalReports.Engine
Dim myReport as new CrystalReport1()
myReport.Load()
Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldDefinition As ParameterFieldDefinition
'ParameterValues and ParameterDiscreteValue are off the CrystalDecisions.Shared
'namespace
Dim crParameterValues As New ParameterValues()
Dim crParameterDiscreteValue As New ParameterDiscreteValue()
crParameterDiscreteValue.Value = "09/14/2005"
crParameterFieldDefinitions = myreport.DataDefinition.ParameterFields
crParameterFieldDefinition = crParameterFieldDefinitions.Item("Your Crystal Report Parameter name")
crParameterValues = crParameterFieldDefinition.CurrentValues
crParameterValues.Clear()
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)
CrystalReportViewer1.ReportSource = myreport
END CODE
-------------------------------------------------------------------------------------
I hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
hi,
can u help for me..
how to pass more then one paramter field at run time?
thanks n advanc..
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
Mail To : foreverkans@gmail.com
|
|
|
|
|
Hello every one,
I am having a VB.net application with postgresSQL as the Database
I want to store images in the database. Following is the code I am using
Dim inputFileStream As New FileStream("C:\test.gif", FileMode.Open, FileAccess.Read)
Dim reader As New BinaryReader(inputFileStream)
Dim bytes() As Byte
'Dim par As NpgsqlParameter
bytes = reader.ReadBytes(CInt(inputFileStream.Length))
inputFileStream.Close()
Dim Sql As String = "INSERT INTO im_prescription_image VALUES (@st_image_name, @im_image)"
Dim Cmd As New Npgsql.NpgsqlCommand(Sql, cnn)
Cmd.Parameters.Add("@st_image_name", NpgsqlTypes.NpgsqlDbType.Varchar).Value = "as10000000000000"
Cmd.Parameters.Add("@im_image", bytes)
Cmd.ExecuteNonQuery()
cnn.Close()
I am getting this error
Npgsql.NpgsqlException was unhandled
BaseMessage="invalid input syntax for type oid: "\107\111\106\070\071\141\363\002\140\004\367\000\000\000\000\000\200\000\000\000\200\000\200\200\000\000\000\200\200\000\200\270\233\273\272\273\273\274\333\273\276\373\273\300\033\274\302\073\274\304\133\274\306\173\274\135\033\020\000\073""
Code="22P02"
Detail=""
ErrorSql="INSERT INTO im_prescription_image VALUES ('as10000000000000', '\\107\\111\\106\\070\\071\\141\\363\\002\\140\\004\\367\\000\\000\\000\\000\\000\\200\\000\\000\\000\\200\\000\\200\\200\\000\\133\\274\\306\\173\\274\\135\\033\\020\\000\\073')"
File="oid.c"
Hint=""
Line="64"
Message="ERROR: 22P02: invalid input syntax for type oid: "\107\111\106\070\071\141\363\002\140\004\367\000\000\000\000\000\200\000\000\000\200\000\200\200\000\000\000\200\200\000\200\302\073\274\304\133\274\306\173\274\135\033\020\000\073""
Position=""
Routine="oidin_subr"
Severity="ERROR"
Source="Npgsql"
Where=""
Can any one please help me with it.
|
|
|
|
|
nishkarsh_k wrote: Cmd.Parameters.Add("@st_image_name", NpgsqlTypes.NpgsqlDbType.Varchar).Value = "as10000000000000"
Cmd.Parameters.Add("@im_image", bytes)
I would venture to guess that you didn't specify a database type for the second parameter. So the parameter is guessing at the type bytes is supposed to be and getting it wrong. You specified it for the first parameter, but you left that out when you created the second parameter. Why?
|
|
|
|
|
Well, that's at least a different error to the one he was getting yesterday
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 )
|
|
|
|
|
True. I get the feeling this is cut'n'paste code though. Probably modified without knowing what's really going on. Stay tuned for scenes from next week's episode!
|
|
|
|
|
Hello
Dave & Christian
For the new week's episode
Yes this was a majority copy and past code, but i understood it before trying to implement.
As you had pointed out that i had not defined the type of second parameter, i was not able to figure out which type to use. I used
Cmd.Parameters.Add("@im_image", NpgsqlTypes.NpgsqlDbType.Bytea).Value = bytes
It gave me the same error
"Invalid input syntax for type oid"
So I tried the different available syntax
Any idea of what to be done?
Regards
Nishkarsh
|
|
|
|
|
I have no idea since I've never used Postgres, and don't plan on it ever either, but a Binary type should work. Better yet, check the docs on it here[^].
|
|
|
|
|
Hi
I have developed an application which is using a MS ACCESS 2007 database, while the app is only retrieving data so i added that database in My.Resources (I also want to hide the database from other Power Users) so that it wud be compiled into the app itself but then how to resolve it into working access file n start processing data.
Please help me in this regard asap.
Thanks
MAP Tiger
Tiger Softwares
Software Designer and Developer
VB.NET, ASP.NET, VFP
|
|
|
|
|
That won't work. An Access database has to be in file form in order to be of any use. An alternative would be to use an XML file, if the dataset isn't too large.
|
|
|
|
|
Thanks buddy, i m using XML alternative n it is working absolutely fine.
Thanks again.
MAP Tiger
Tiger Softwares
Software Designer and Developer
VB.NET, ASP.NET, VFP
|
|
|
|
|
please can anybody privide me with a complete list of runtime files for crystal report 10 to deploy with visual basic 6 application. i am using RDC for the report and using OLEDB/ADO for data acess.
raamay
|
|
|
|
|
A better place to ask this would be BusinessObjects[^] and their Support Forums. After all, they wrote Crystal Reports.
|
|
|
|
|
Hi friends
i am creating a mobile application.. i created a dataset through the Wizard.. i had given a parameter in the select statement.
Now i want to pass the value of the parameter
my query in wizard is:
SELECT reg_Id, PatientRegId, pat_name, DOB, Age, Gender FROM PatientRegistration
WHERE (PatientRegId = @PatID)
in normal applications i use to pass like
sqldataadapter.selectcommand.parameter("@PatId").value=10
but in mobile application its not accepting the above format..
i tried in many ways finally i got the below code
PatientRegistrationTableAdapter.FillBy(MobilehealthcareDataSet1.Tables("Pat", "PatientRegistration"), Val(TextBox1.Text))
Note: PatientRegistration is table name
but i am getting the error like: "Null Refernece Exception"
when i debug and go inside the above method in .designer.vb (below code)
Public Overloads Overridable Function FillBy(ByVal dataTable As mobilehealthcareDataSet6.PatientRegistrationDataTable, ByVal PatID As Integer) As Integer
Me.Adapter.SelectCommand = Me.CommandCollection(1)
Me.Adapter.SelectCommand.Parameters(0).Value = PatID
If (Me.ClearBeforeFill = true) Then
' dataTable.Clear
End If
<b>Dim returnValue As Integer = Me.Adapter.Fill(dataTable)
</b>Return returnValue
End Function
now i got the error like " "Value can not be null. Parameter name: dataTable "
if anyone knows please help me..
|
|
|
|
|
Usharva wrote: Public Overloads Overridable Function FillBy(ByVal dataTable As mobilehealthcareDataSet6.PatientRegistrationDataTable, ByVal PatID As Integer) As Integer
Me.Adapter.SelectCommand = Me.CommandCollection(1)
Me.Adapter.SelectCommand.Parameters(0).Value = PatID
If (Me.ClearBeforeFill = true) Then
' dataTable.Clear
End If
Dim returnValue As Integer = Me.Adapter.Fill(dataTable)
Return returnValue
End Function
This is simple. The code that calls this method isn't passing in an INSTANTIATED PatientRegistrationDataTable object. The code is passing in a Nothing .
|
|
|
|
|
I am developing the windows application
In that i used the TabControl
In that Tabcontrol on one tabpage i choose DOB when user selects the DOB
then on another tab in the textbox age is calculated accordingly
Please Suggest.....
|
|
|
|
|
Arr You Using VB6 or Visual Basic .net
but in both cases there is only a single form so no matter you are working on which ever tab of tab control you could use the datetimepicker's value change to calculate the age. and store into the textbox you required.
With Regards
Yogesh Agarwal
modified on Friday, February 29, 2008 5:45 AM
|
|
|
|
|
hi all,
currently i am working on desktop application in vb.net, and facing problem to handle two form at the same time.
like i want to input some values on form1 say textbox1.text=500 and textbox2.text=600
now i want to show another form and also want to input some values like
textbox3.text=600
i declared a public variable like public var1 as double on form2
now i want to use this variable on form1
thanks in advance
rmshah
Developer
|
|
|
|
|
Hi
You could use the code like this.
<br />
form1.textbox3.text=form2.textbox1.text<br />
form1.show<br />
Here i assume that form1 is the object for form1 but there i sno requirement to use form2 here i just use it to make understandable.
Or you could create the static public variable so that you could use it directly without static you have to call using obj name and new object will distroy the value you store in you public variable so use static variable concept
Hope the solution will help you
With Regards
Yogesh Agarwal
|
|
|
|
|
One simple way to implement it is like a folder browser dialog. You can pass in the initial folder to the dialog via the exposed Path property, the dialog will be defaulted with the folder when shown, the user can select another folder, then click OK. The system reads the DialogResult.OK result, and get the user selected folder via Path. If the result is DialogResult.Cancel, ignore the result.
|
|
|
|
|
Try this example:
No need to change any control properties in this example. Coding follows after the explanation.
Create a new solution with 2 forms, Form1.vb and Form2.vb.
Create a text box and a button on Form1.
Create a text box on Form2.
On the code view for Form1.vb, create code for a public share textbox. In the load function, assign the public share to TextBox1. Create code for Button1 click event to open Form2.vb.
On the code view for Form2.vb, create code in the ChangeText event of TextBox1 to access the shared textbox control from Form1.vb.
Compile and DeBug.
Click on Button1 to open Form2
Type text into TextBox1 on Form2 and it will automatically show in TextBox1 on Form1. No other variables to hold data are necessary. After closing Form2, data can be processed on Form1 as needed.
Below is the code (name your variables appropriately):
***Form1.vb************************************
Public Shared tb1 As TextBox
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
tb1 = TextBox1
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim newForm = New Form2()
newForm.show()
End Sub
***Form2.vb*************************************
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Form1.tb1.Text = TextBox1.Text
End Sub
************************************************
************************************************
To use this method, the shared controls need to be in the first form opened (not necessarily the first form in your program) and accessed by the second form. The shared controls need to be initiated and assigned values before the they can be used by another form.
This method can be used for any type of control you want accessed by another form.
I use this type of setup in most of my programs. Easier than keeping track of too many public variables, especially in programs with a lot of forms that require user input. You will need to experiment to see how to use this in your forms.
|
|
|
|
|
Hi there,
I was wondering if anyone was able to send a web request successfully to a lighttpd server. I am using RoR on the lighttpd side and when I send a request, I want the RoR code to save the request. If you're familiar with RoR, the code works fine in WEBrick. Is there something I'm missing? The final solution I would like is the .net app to communicate with the https portion of lighttpd.
RoR code:
def foo
if @testhash == params[:check]
@r= Timecard.new
@r.people_id = params[:id]
@r.card_id = params[:cd]
@r.day_in = checkinday
@r.time_in = checkin
@r.save
end
end
VB.net
Dim request As HttpWebRequest
System.Net.ServicePointManager.CertificatePolicy = New MyPolicy
request = CType(WebRequest.Create("http://127.0.0.1:3000/people/foo?"), HttpWebRequest)
request.ContentType = "application/x-www-form-urlencoded"
request.ContentLength = data.Length
request.Method = "POST"
request.AllowAutoRedirect = False
Dim requestStream As IO.Stream = request.GetRequestStream()
Dim postBytes As Byte() = Encoding.ASCII.GetBytes(data)
requestStream.Write(postBytes, 0, postBytes.Length)
requestStream.Flush()
requestStream.Close()
Thanks for your help everyone.
d
|
|
|
|
|
hi guys, i am using menu strip 2 in my vb.net application, in the image property i set image , but it is not shown clearly , the size of the image is reduced and its appearance gets dull,,
can u tell me how to i show image in the munuetrip so that it persist its appearance in the menustrip....
hello
|
|
|
|