rohini_pb29
asked on
assign parameters in crystal report VB.net
how do i use date parameters in crystal report VB.net ? i am new to this so i need step by step instructions .
kindly assist
kindly assist
ASKER
in the selection expert i have given the formula as
{A.NAM}='Ro' and
{B.DATE} >={?DateParam}
and under page_load function after connection to the database code , i have pasted the code given by u.
here is the error i got ...
Server Error in '/test1' Application.
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
Missing parameter field current value.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: CrystalDecisions.CrystalRe ports.Engi ne.Paramet erFieldCur rentValueE xception: Missing parameter field current value.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ParameterFieldCurrentValu eException : Missing parameter field current value.]
.F(String , EngineExceptionErrorID
) +574
CrystalDecisions.CrystalRe ports.Engi ne.FormatE ngine.inte rnalSetRep ortInfo(Re questConte xt reqContext) +1293
CrystalDecisions.CrystalRe ports.Engi ne.FormatE ngine.inte rnalGetVie wContext(R eportPageR equestCont ext reqContext, * viewContext) +217
CrystalDecisions.CrystalRe ports.Engi ne.FormatE ngine.GetP age(PageRe questConte xt reqContext) +280
CrystalDecisions.ReportSou rce.LocalR eportSourc eBase.GetP age(PageRe questConte xt pageReqContext) +189
CrystalDecisions.Web.Repor tAgent.u(B oolean N) +164
CrystalDecisions.Web.Cryst alReportVi ewer.OnPre Render(Eve ntArgs e) +108
System.Web.UI.Control.PreR enderRecur siveIntern al() +62
System.Web.UI.Control.PreR enderRecur siveIntern al() +125
System.Web.UI.Control.PreR enderRecur siveIntern al() +125
System.Web.UI.Page.Process RequestMai n() +1489
-------------------------- ----------
there is another line of code in the page_load fn. given as
CrystalReportViewer1.Repor tSource = crpt
CrystalReportViewer1.Repor tSource = Server.MapPath("all_benj.r pt")
crystalreport1 in the report name generated by VS.net and i have added all_benj. rpt which has date parameter.
should this b crystalreport1.rpt or all_benj? i tried both but the error remained the same.
any clue ?
Thanx,
{A.NAM}='Ro' and
{B.DATE} >={?DateParam}
and under page_load function after connection to the database code , i have pasted the code given by u.
here is the error i got ...
Server Error in '/test1' Application.
--------------------------
Missing parameter field current value.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: CrystalDecisions.CrystalRe
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ParameterFieldCurrentValu
.F(String , EngineExceptionErrorID
) +574
CrystalDecisions.CrystalRe
CrystalDecisions.CrystalRe
CrystalDecisions.CrystalRe
CrystalDecisions.ReportSou
CrystalDecisions.Web.Repor
CrystalDecisions.Web.Cryst
System.Web.UI.Control.PreR
System.Web.UI.Control.PreR
System.Web.UI.Control.PreR
System.Web.UI.Page.Process
--------------------------
there is another line of code in the page_load fn. given as
CrystalReportViewer1.Repor
CrystalReportViewer1.Repor
crystalreport1 in the report name generated by VS.net and i have added all_benj. rpt which has date parameter.
should this b crystalreport1.rpt or all_benj? i tried both but the error remained the same.
any clue ?
Thanx,
Can you paste the code that you put in (copied from here) - I suspect something minor prior to this line:
' Add parameter value
crParameterValues = crParameterFieldDefinition .CurrentVa lues
frodoman
' Add parameter value
crParameterValues = crParameterFieldDefinition
frodoman
ASKER
this is webform1.aspx.vb
Imports CrystalDecisions.CrystalRe ports.Engi ne
Imports CrystalDecisions.Shared
Public Class WebForm1
Inherits System.Web.UI.Page
Dim crReport As New CrystalReport1
'ParameterFieldDefinitions and ParameterFieldDefinition are off the
'CrystalDecisions.CrystalR eports.Eng ine Namespace
Dim crParameterFieldDefinition s 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
#Region " Web Form Designer Generated Code "
Dim crpt As CrystalReport1
Dim myTable As CrystalDecisions.CrystalRe ports.Engi ne.Table
Dim myLogin As CrystalDecisions.Shared.Ta bleLogOnIn fo
'This call is required by the Web Form Designer.
<System.Diagnostics.Debugg erStepThro ugh()> Private Sub InitializeComponent()
End Sub
Protected WithEvents CrystalReportViewer1 As CrystalDecisions.Web.Cryst alReportVi ewer
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclara tion As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
crpt = New CrystalReport1
For Each myTable In crpt.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo.Pas sword = "abcdef"
myLogin.ConnectionInfo.Use rID = "usedId"
myTable.ApplyLogOnInfo(myL ogin)
Next
CrystalReportViewer1.Repor tSource = crpt
CrystalReportViewer1.Repor tSource = Server.MapPath("all_benj.r pt")
Dim crReport As New CrystalReport1
'Set Date Parameter
'Set discrete value
crParameterDiscreteValue.V alue = CDate("8/04/2004")
'Access first parameter field definition
crParameterFieldDefinition s = crReport.DataDefinition.Pa rameterFie lds
crParameterFieldDefinition = crParameterFieldDefinition s.Item("Da teParam")
' Add parameter value
crParameterValues = crParameterFieldDefinition .CurrentVa lues
crParameterValues.Add(crPa rameterDis creteValue )
' Apply the current value to the parameter definition
crParameterFieldDefinition .ApplyCurr entValues( crParamete rValues)
End Sub
End Class
thanx,
Imports CrystalDecisions.CrystalRe
Imports CrystalDecisions.Shared
Public Class WebForm1
Inherits System.Web.UI.Page
Dim crReport As New CrystalReport1
'ParameterFieldDefinitions
'CrystalDecisions.CrystalR
Dim crParameterFieldDefinition
Dim crParameterFieldDefinition
'ParameterValues and ParameterDiscreteValue are off the CrystalDecisions.Shared
'namespace
Dim crParameterValues As New ParameterValues
Dim crParameterDiscreteValue As New ParameterDiscreteValue
#Region " Web Form Designer Generated Code "
Dim crpt As CrystalReport1
Dim myTable As CrystalDecisions.CrystalRe
Dim myLogin As CrystalDecisions.Shared.Ta
'This call is required by the Web Form Designer.
<System.Diagnostics.Debugg
End Sub
Protected WithEvents CrystalReportViewer1 As CrystalDecisions.Web.Cryst
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclara
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
crpt = New CrystalReport1
For Each myTable In crpt.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo.Pas
myLogin.ConnectionInfo.Use
myTable.ApplyLogOnInfo(myL
Next
CrystalReportViewer1.Repor
CrystalReportViewer1.Repor
Dim crReport As New CrystalReport1
'Set Date Parameter
'Set discrete value
crParameterDiscreteValue.V
'Access first parameter field definition
crParameterFieldDefinition
crParameterFieldDefinition
' Add parameter value
crParameterValues = crParameterFieldDefinition
crParameterValues.Add(crPa
' Apply the current value to the parameter definition
crParameterFieldDefinition
End Sub
End Class
thanx,
At the beginning of your page load section you have:
crpt = New CrystalReport1
And then you apply login info and set the viewer to use crpt.
Then you have:
Dim crReport As New CrystalReport1
And from this point on you use crReport to set your parameter values.
So as far as I can tell it looks like you're doing half the work to the crpt object and half the work to the crReport object. Use one or the other throughout and I think you'll be okay.
frodoman
crpt = New CrystalReport1
And then you apply login info and set the viewer to use crpt.
Then you have:
Dim crReport As New CrystalReport1
And from this point on you use crReport to set your parameter values.
So as far as I can tell it looks like you're doing half the work to the crpt object and half the work to the crReport object. Use one or the other throughout and I think you'll be okay.
frodoman
ASKER
i did as u said.
Imports CrystalDecisions.CrystalRe ports.Engi ne
Imports CrystalDecisions.Shared
Public Class WebForm1
Inherits System.Web.UI.Page
' Dim crReport As New CrystalReport1
'ParameterFieldDefinitions and ParameterFieldDefinition are off the
'CrystalDecisions.CrystalR eports.Eng ine Namespace
Dim crParameterFieldDefinition s 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
#Region " Web Form Designer Generated Code "
Dim crpt As CrystalReport1
Dim myTable As CrystalDecisions.CrystalRe ports.Engi ne.Table
Dim myLogin As CrystalDecisions.Shared.Ta bleLogOnIn fo
'This call is required by the Web Form Designer.
<System.Diagnostics.Debugg erStepThro ugh()> Private Sub InitializeComponent()
End Sub
Protected WithEvents CrystalReportViewer1 As CrystalDecisions.Web.Cryst alReportVi ewer
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclara tion As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
crpt = New CrystalReport1
' Dim crReport As New CrystalReport1
For Each myTable In crpt.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo.Pas sword = "abcdef"
myLogin.ConnectionInfo.Use rID = "usedId"
myTable.ApplyLogOnInfo(myL ogin)
Next
CrystalReportViewer1.Repor tSource = crpt
CrystalReportViewer1.Repor tSource = Server.MapPath("all_benj.r pt")
'Set Date Parameter
'Set discrete value
crParameterDiscreteValue.V alue = CDate("8/04/2004")
'Access first parameter field definition
crParameterFieldDefinition s = crpt.DataDefinition.Parame terFields
crParameterFieldDefinition = crParameterFieldDefinition s.Item("Da teParam")
' Add parameter value
crParameterValues = crParameterFieldDefinition .CurrentVa lues
crParameterValues.Add(crPa rameterDis creteValue )
' Apply the current value to the parameter definition
crParameterFieldDefinition .ApplyCurr entValues( crParamete rValues)
End Sub
End Class
but again :(
here is the error
Server Error in '/test1' Application.
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
Missing parameter field current value.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: CrystalDecisions.CrystalRe ports.Engi ne.Paramet erFieldCur rentValueE xception: Missing parameter field current value.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ParameterFieldCurrentValu eException : Missing parameter field current value.]
.F(String , EngineExceptionErrorID
) +574
CrystalDecisions.CrystalRe ports.Engi ne.FormatE ngine.inte rnalSetRep ortInfo(Re questConte xt reqContext) +1293
CrystalDecisions.CrystalRe ports.Engi ne.FormatE ngine.inte rnalGetVie wContext(R eportPageR equestCont ext reqContext, * viewContext) +217
CrystalDecisions.CrystalRe ports.Engi ne.FormatE ngine.GetP age(PageRe questConte xt reqContext) +280
CrystalDecisions.ReportSou rce.LocalR eportSourc eBase.GetP age(PageRe questConte xt pageReqContext) +189
CrystalDecisions.Web.Repor tAgent.u(B oolean N) +164
CrystalDecisions.Web.Cryst alReportVi ewer.OnPre Render(Eve ntArgs e) +108
System.Web.UI.Control.PreR enderRecur siveIntern al() +62
System.Web.UI.Control.PreR enderRecur siveIntern al() +125
System.Web.UI.Control.PreR enderRecur siveIntern al() +125
System.Web.UI.Page.Process RequestMai n() +1489
hope there is a solution soon .... i am left with only today...
thanx,
Imports CrystalDecisions.CrystalRe
Imports CrystalDecisions.Shared
Public Class WebForm1
Inherits System.Web.UI.Page
' Dim crReport As New CrystalReport1
'ParameterFieldDefinitions
'CrystalDecisions.CrystalR
Dim crParameterFieldDefinition
Dim crParameterFieldDefinition
'ParameterValues and ParameterDiscreteValue are off the CrystalDecisions.Shared
'namespace
Dim crParameterValues As New ParameterValues
Dim crParameterDiscreteValue As New ParameterDiscreteValue
#Region " Web Form Designer Generated Code "
Dim crpt As CrystalReport1
Dim myTable As CrystalDecisions.CrystalRe
Dim myLogin As CrystalDecisions.Shared.Ta
'This call is required by the Web Form Designer.
<System.Diagnostics.Debugg
End Sub
Protected WithEvents CrystalReportViewer1 As CrystalDecisions.Web.Cryst
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclara
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
crpt = New CrystalReport1
' Dim crReport As New CrystalReport1
For Each myTable In crpt.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo.Pas
myLogin.ConnectionInfo.Use
myTable.ApplyLogOnInfo(myL
Next
CrystalReportViewer1.Repor
CrystalReportViewer1.Repor
'Set Date Parameter
'Set discrete value
crParameterDiscreteValue.V
'Access first parameter field definition
crParameterFieldDefinition
crParameterFieldDefinition
' Add parameter value
crParameterValues = crParameterFieldDefinition
crParameterValues.Add(crPa
' Apply the current value to the parameter definition
crParameterFieldDefinition
End Sub
End Class
but again :(
here is the error
Server Error in '/test1' Application.
--------------------------
Missing parameter field current value.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: CrystalDecisions.CrystalRe
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ParameterFieldCurrentValu
.F(String , EngineExceptionErrorID
) +574
CrystalDecisions.CrystalRe
CrystalDecisions.CrystalRe
CrystalDecisions.CrystalRe
CrystalDecisions.ReportSou
CrystalDecisions.Web.Repor
CrystalDecisions.Web.Cryst
System.Web.UI.Control.PreR
System.Web.UI.Control.PreR
System.Web.UI.Control.PreR
System.Web.UI.Page.Process
hope there is a solution soon .... i am left with only today...
thanx,
Is your CR parameter a Date or a DateTime? If it's DateTime you'll need to include a time in your CDate() function.
ASKER
i am sorry if this sounds like a silly qiestion...
i gave
crParameterDiscreteValue.V alue = CDate("8/04/2004 00:00:00")
but i got error:
Missing parameter field current value.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: CrystalDecisions.CrystalRe ports.Engi ne.Paramet erFieldCur rentValueE xception: Missing parameter field current value.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
as server error.
but i had one question.
in database the date is in the form of date time.
but in the report (with out .net just run locally) it just takes date.like 08/03/2004
in parameter i changed it to date time , (it was date before when i used to run the same report locally without.net, it works fine.)
making parameter as date time i tried crParameterDiscreteValue.V alue = CDate("8/04/2004 00:00:00")
and
crParameterDiscreteValue.V alue = CDate("8/04/2004") both gave the same error
thanx,
i gave
crParameterDiscreteValue.V
but i got error:
Missing parameter field current value.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: CrystalDecisions.CrystalRe
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
as server error.
but i had one question.
in database the date is in the form of date time.
but in the report (with out .net just run locally) it just takes date.like 08/03/2004
in parameter i changed it to date time , (it was date before when i used to run the same report locally without.net, it works fine.)
making parameter as date time i tried crParameterDiscreteValue.V
and
crParameterDiscreteValue.V
thanx,
ASKER
could there be any problem with the permissions given for the browser ???
i could open a normal report with out having a parameter in the browser though....
thanx,
i could open a normal report with out having a parameter in the browser though....
thanx,
Do you have subreports in this report? I'm thinking that this error may be because there's a parameter in a subreport that isn't being set. If this is possible look at subreports and make sure any parameters are linked to main report or you'll have to pass in those parameters as well.
If no subreports then I'll keep digging. I don't think this has anything to do w/ the browser.
frodoman
If no subreports then I'll keep digging. I don't think this has anything to do w/ the browser.
frodoman
ASKER
yes there is a subreport.
i am sorry for not giving the full detail.
in subreport also there is same date but in my report it goes this way
{A.ACC_NUM} = {?Pm-A.ACC_NUM}
and
{B.DATE} >= {?Pm-?Start Date}
and in the main report it is this way as i told u before
{A.NAM}='Ro' and
{B.DATE} >={?DateParam}
should i just rename start Date as DateParam ?
thanx, u r giving me hopes!! and i am sorry again...
i am sorry for not giving the full detail.
in subreport also there is same date but in my report it goes this way
{A.ACC_NUM} = {?Pm-A.ACC_NUM}
and
{B.DATE} >= {?Pm-?Start Date}
and in the main report it is this way as i told u before
{A.NAM}='Ro' and
{B.DATE} >={?DateParam}
should i just rename start Date as DateParam ?
thanx, u r giving me hopes!! and i am sorry again...
Good news - I think we're on the right track...
Okay, in your main report you have {?DateParam} and this is the value that must be passed to the subreport, right? Is {?StartDate} the parameter in your subreport? If so then you should be linked to {?StartDate} not to {?pm-StartDate}...
Best way to do this (in my humble opinion) is in your subreport create a parameter named "SubDateParam" (I always append a 'sub' prefix to the same parameter name - helps me keep it straight). Rt-click the subreport and 'change links'. In the "Container Report Fields to Link To" box you should have {?DateParam} and in the "Subreport Parameter field to use" you should have {?SubDateParam}.
Let me know if that does it.
frodoman
Okay, in your main report you have {?DateParam} and this is the value that must be passed to the subreport, right? Is {?StartDate} the parameter in your subreport? If so then you should be linked to {?StartDate} not to {?pm-StartDate}...
Best way to do this (in my humble opinion) is in your subreport create a parameter named "SubDateParam" (I always append a 'sub' prefix to the same parameter name - helps me keep it straight). Rt-click the subreport and 'change links'. In the "Container Report Fields to Link To" box you should have {?DateParam} and in the "Subreport Parameter field to use" you should have {?SubDateParam}.
Let me know if that does it.
frodoman
ASKER
no it dint work,
i just made a quick report which has no subreport
in the main report select expert it has a simple formula
{B.DATE} >={?DateParam}
it works fine with out .net environment.
so i added this report as myname.rpt
dint work !!!
gave server error as :
Server Error in '/test1' Application.
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
Missing parameter field current value.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: CrystalDecisions.CrystalRe ports.Engi ne.Paramet erFieldCur rentValueE xception: Missing parameter field current value.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ParameterFieldCurrentValu eException : Missing parameter field current value.]
.F(String , EngineExceptionErrorID
) +574
CrystalDecisions.CrystalRe ports.Engi ne.FormatE ngine.inte rnalSetRep ortInfo(Re questConte xt reqContext) +1293
CrystalDecisions.CrystalRe ports.Engi ne.FormatE ngine.inte rnalGetVie wContext(R eportPageR equestCont ext reqContext, * viewContext) +217
CrystalDecisions.CrystalRe ports.Engi ne.FormatE ngine.GetP age(PageRe questConte xt reqContext) +280
CrystalDecisions.ReportSou rce.LocalR eportSourc eBase.GetP age(PageRe questConte xt pageReqContext) +189
CrystalDecisions.Web.Repor tAgent.u(B oolean N) +164
CrystalDecisions.Web.Cryst alReportVi ewer.OnPre Render(Eve ntArgs e) +108
System.Web.UI.Control.PreR enderRecur siveIntern al() +62
System.Web.UI.Control.PreR enderRecur siveIntern al() +125
System.Web.UI.Control.PreR enderRecur siveIntern al() +125
System.Web.UI.Page.Process RequestMai n() +1489
-------------------------- ---------- ---------- --
i want to know y this is not working so i took the previous report which is complex and has subreport.
i expected this simple report to work.
i have 2 question...
CDate("8/04/2004") ' is different from CDate ("2004,08,01") ?
i dont think so but asking just to clarify.
DateParam parameter field i gave it as Date Time .
and
CrystalReportViewer1.Repor tSource = Server.MapPath("CrystalRep ort1.rpt")
should it be myname.rpt or CrystalReport1.rpt and what is the difference ?
and what do u think is the problem ??
now how ever long it takes i need to find out the problem.. so plz help me...
i just made a quick report which has no subreport
in the main report select expert it has a simple formula
{B.DATE} >={?DateParam}
it works fine with out .net environment.
so i added this report as myname.rpt
dint work !!!
gave server error as :
Server Error in '/test1' Application.
--------------------------
Missing parameter field current value.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: CrystalDecisions.CrystalRe
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ParameterFieldCurrentValu
.F(String , EngineExceptionErrorID
) +574
CrystalDecisions.CrystalRe
CrystalDecisions.CrystalRe
CrystalDecisions.CrystalRe
CrystalDecisions.ReportSou
CrystalDecisions.Web.Repor
CrystalDecisions.Web.Cryst
System.Web.UI.Control.PreR
System.Web.UI.Control.PreR
System.Web.UI.Control.PreR
System.Web.UI.Page.Process
--------------------------
i want to know y this is not working so i took the previous report which is complex and has subreport.
i expected this simple report to work.
i have 2 question...
CDate("8/04/2004") ' is different from CDate ("2004,08,01") ?
i dont think so but asking just to clarify.
DateParam parameter field i gave it as Date Time .
and
CrystalReportViewer1.Repor
should it be myname.rpt or CrystalReport1.rpt and what is the difference ?
and what do u think is the problem ??
now how ever long it takes i need to find out the problem.. so plz help me...
ASKER
???
i am trying and trying and tryin...
no use all the time i see the same error :(
u tooo ????
i am trying and trying and tryin...
no use all the time i see the same error :(
u tooo ????
ASKER
hi,
any luck from your side ?
any luck from your side ?
Sorry rohini - I'm in the middle of something here at work and haven't been able to look at this again. I'll try to get to it tonight if I can. - frodoman
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
1) Add a report to your project.
2) Add a date parameter to the report. Call it "DateParam".
3) Add the following lines of code to the top of the code page to import the relevant namespaces:
'Import namespaces in general declarations
Imports CrystalDecisions.CrystalRe
Imports CrystalDecisions.Shared
4) Add the following code to pass a date parameter to a Report at runtime using VB.net
Dim crReport As New CrystalReport1()
'ParameterFieldDefinitions
'CrystalDecisions.CrystalR
Dim crParameterFieldDefinition
Dim crParameterFieldDefinition
'ParameterValues and ParameterDiscreteValue are off the CrystalDecisions.Shared
'namespace
Dim crParameterValues As New ParameterValues()
Dim crParameterDiscreteValue As New ParameterDiscreteValue()
'Set Date Parameter
'Set discrete value
crParameterDiscreteValue.V
'Access first parameter field definition
crParameterFieldDefinition
crParameterFieldDefinition
' Add parameter value
crParameterValues = crParameterFieldDefinition
crParameterValues.Add(crPa
' Apply the current value to the parameter definition
crParameterFieldDefinition
5) Pass the report object to the WinForm or WebForm viewer and run the application
--------------------------
[ Above copied from: http://support.businessobjects.com/library/kbase/articles/c2010247.asp ]
HTH
frodoman