Showing posts with label parameter. Show all posts
Showing posts with label parameter. Show all posts

Monday, March 26, 2012

Error Passing Paramater

Hello Babu,

I am trying to open a crystal report from VB. Everything works fine.
When I am trying to assign a date parameter value, I get the error "Type Mismatch".

ie. txtdate="14/06/2004"
Report.ParameterFields(1).AddCurrentValue txtdate

where txtdate is a date variable.

I also tried cdate(txtdate)

when I try to pass variables other than type date it works fine.

Regards ,
SatishHi,

I passed a value from a DTPicker control. It works fine. Check the datatype which you have set while parameter creation. It'll work.

And try DTPicker. I used the same code as yours.

Report.ParameterFields(1).AddCurrentValue DTP1.Value

Regards,
harmonycitra|||Hi,
When passing the date make sure that the date is of the format of the system date.

Madhivanan

Thursday, March 22, 2012

Error on Passing parameter to stored procedure

Hi,

I have a procedure that will save to table in sql server 200 via stored procedure. When I hit the save button it alwasy give me an error saying "Procedure 'sp_AddBoard' expects parameter '@.dtmWarrantyStart', which was not supplied" even though I supplied it in the code

which is

Dim ParamdtmWarrantyStart As SqlParameter = New SqlParameter("@.dtmWarrantyStart", SqlDbType.datetime, 8)
ParamdtmWarrantyStart.Value = dtmWarrantyStart
myCommand.Parameters.Add(ParamdtmWarrantyStart)

below is the stored procedure.

create Proc sp_AddBoard(@.BrandID int,
@.strPcName varchar(50),
@.bitAccounted bit,
@.dtmAccounted datetime,
@.dtmWarrantyStart datetime,
@.dtmWarrantyEnd datetime,
-- @.strDescription varchar(500),
@.intStatus int,
@.ModelNo varchar(50),
@.intMemorySlots int,
@.intMemSlotTaken int,
@.intAgpSlots int,
@.intPCI int,
@.bitWSound bit,
@.bitWLan bit,
@.bitWVideo bit,
@.dtmAcquired datetime,
@.stat bit output,
@.intFSB int) as
if not exists(select strPcName from tblBoards where strPcName=@.strPcName)
begin
insert into tblBoards
(BrandID, strPcName, bitAccounted,
dtmAccounted, dtmWarrantyStart,
dtmWarrantyEnd, --strDescription,
intStatus,
ModelNo, intMemorySlots, intMemSlotTaken,
intAgpSlots, intPCI, bitWLan,
bitWVideo, dtmAcquired,intFSB,bitWSound)

values

(@.BrandID,@.strPcName,@.bitAccounted,
@.dtmAccounted,@.dtmWarrantyStart,
@.dtmWarrantyEnd,--@.strDescription,
@.intStatus,
@.ModelNo,@.intMemorySlots,@.intMemSlotTaken,
@.intAgpSlots,@.intPCI,@.bitWLan,
@.bitWVideo,@.dtmAcquired,@.intFSB,@.bitWSound)
end
else
begin
set @.stat=1
end

The table is also designed to accept nulls on that field but still same error occured.

Please helpjust check if there is any value in the parameter value. the way i normally do is :


myCommand.Parameters.Add(New SqlParameter("@.cusbday",SqlDbType.datetime))
If len(trim(bday.Text)) = 0 Then
myCommand.Parameters("@.cusbday").Value = SqlDateTime.null
Else
myCommand.Parameters("@.cusbday").Value = DateTime.Parse(bday.Text)
End If

also you need to import the namespace System.Data.SqlTypes to use sqldatetime.null

<%@. import Namespace="System.Data.SqlTypes" %>

hthsql

Friday, March 9, 2012

error msg when using parameters

Anyone know how to fix this error?
Error 1 [rsInvalidReportParameterDependency]
The report parameter 'district' has a DefaultValue or a ValidValue
that depends on the report parameter "district". Forward
dependencies are not valid.
Thanks!try adding a new dataset, just to be used for the parameter values and then
put them as your default or available values, what ever you are using them
for.
"aggiechick717" <mhoppe@.chkenergy.com> wrote in message
news:1156436830.792903.191820@.b28g2000cwb.googlegroups.com...
> Anyone know how to fix this error?
> Error 1 [rsInvalidReportParameterDependency]
> The report parameter 'district' has a DefaultValue or a ValidValue
> that depends on the report parameter "district". Forward
> dependencies are not valid.
> Thanks!
>|||Normally forward dependencies occur when you are trying to populate the
default value, or valid values of one parameter based on another parameter
that hasn't been set yet.
E.g. If you wanted users to select a region first, and then have a dropdown
which only allowed them to select districts in that region, you would need to
ensure that that region parameter appeared above the district parameter in
the list on the report parameters page (from the layout tab of visual studio).
In your case however, a parameter called district seems to have a forward
dependency on another parameter also called distict... have you got two
parameters with the same name?
"aggiechick717" wrote:
> Anyone know how to fix this error?
> Error 1 [rsInvalidReportParameterDependency]
> The report parameter 'district' has a DefaultValue or a ValidValue
> that depends on the report parameter "district". Forward
> dependencies are not valid.
> Thanks!
>

Sunday, February 26, 2012

Error Message:

What does the following error message mean?
I have removed all reference(s) to parameter @.Individual from report.
ERROR:
[rsParameterReference] The Value expression for the query parameter
â'@.Individualâ' refers to a non-existing report parameter â'IndividualResolved!
Had to change/update XML file with new values as follows:
<QueryParameter Name="@.Individual">
<Value>=Parameters!Individual.Value</Value>
</QueryParameter>
"Terry" wrote:
> What does the following error message mean?
> I have removed all reference(s) to parameter @.Individual from report.
> ERROR:
> [rsParameterReference] The Value expression for the query parameter
> â'@.Individualâ' refers to a non-existing report parameter â'Individual|||There is a mapping that occurs from the query parameter to the report
Parameter. Go to the dataset where the query is defined and see if you have
a query parameter. If not, click on the ..., parameters tab and remove the
mapping.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Terry" <Terry@.discussions.microsoft.com> wrote in message
news:3FF16775-6566-463E-A1D4-529A6F21C626@.microsoft.com...
> What does the following error message mean?
> I have removed all reference(s) to parameter @.Individual from report.
> ERROR:
> [rsParameterReference] The Value expression for the query parameter
> '@.Individual' refers to a non-existing report parameter 'Individual|||Thank you!
"Bruce L-C [MVP]" wrote:
> There is a mapping that occurs from the query parameter to the report
> Parameter. Go to the dataset where the query is defined and see if you have
> a query parameter. If not, click on the ..., parameters tab and remove the
> mapping.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Terry" <Terry@.discussions.microsoft.com> wrote in message
> news:3FF16775-6566-463E-A1D4-529A6F21C626@.microsoft.com...
> > What does the following error message mean?
> >
> > I have removed all reference(s) to parameter @.Individual from report.
> >
> > ERROR:
> >
> > [rsParameterReference] The Value expression for the query parameter
> > '@.Individual' refers to a non-existing report parameter 'Individual
>
>

Sunday, February 19, 2012

Error message help

I have a report parameter called @.OffenseCode and it is just a string
and also allows null values.
For some reason, I am getting the below error message, which I don't
know how to decipher. Any ideas?
"The value expression for the query parameter '@.OffenseCode'
contains an error: [BC30456] 'OffenseCode' is not a member of
'Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.Parameters'."
Thank you!!!To access a Parameter value from an expression you will need to use the
following snytax.
=Parameters!@.OffenseCode.Value
if your parameter name is @.OffenseCode it may simply be OffenseCode in
which case you would need to use
=Parameters!OffenseCode.Value
You can check by going to the Report Menu, Report Parameters, this will
list all your parameters for the report and their names