cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure a default parameter

Former Member
0 Kudos

hi,

I'm working with Crystal Reports for Visual Studio .NET 2005.

I created a DateTime parameter for a report. I'm having difficulty to affected it a default value coming from a Datasource (ADO.NET dataSource).

I created a DataTable "OtherInfo.DateBegin" to pass its value to the parameter of my report.

And tried to configure it by the Crystal window "Define Default Value" that you can see here ( p96) :

http://books.google.fr/books?id=j-RW7iA_qF4C&pg=PT75&lpg=PT75&dq=Crystalparam%C3%A8tre%22S%C3%A9lectionnerdanslabasede+donn%C3%A9es%22&source=bl&ots=6c-OalBnc8&sig=1vDLC6zi_60NVN5sJCf71vJRjJc&hl=fr&ei=ZCN1S9GqCJTE4gbpsNizCg&sa=X&oi=book_result&ct=result&resnum=1&ved=0CAcQ6AEwAA#v=onepage&q=&f=false

my problem is after selecting the table and it's field, the value of the field doesn't show in the list box below so i can't select the value to affected it as a default value.

I hope i was clear enough. Could you please help me to make it work or find a nother solution?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thanks David,

I'm actually trying to find my way through by passing by the code but it's much more complicated because it's not a direct relation between the report and the code. In the part of the code that retreive the parameters wee don't know for witch report it will be applicated because it's generic.

Don't bother, i'll find something. Thank you for your help!

former_member208657
Active Contributor
0 Kudos

I think I understand what you are trying to do. Crystal Reports for Visual Studio .NET 2005 doesn't have the capability to update its list of default values automatically. That feature, dynamic and cascading parameters, was added to Crystal Reports 2008.

Even with the new features in Crystal Reports 2008, you may have some issues with the feature. I don't think it works well with ADO.NET DataSets. I would still recommend modifying the list of default values using the SDK.

Answers (2)

Answers (2)

Former Member
0 Kudos

You've got it right, i'm trying to have ONE VALUE that comes from .NET DataSet.it's not a list, just one value but that's not a problem for me.

and yes, the default param can be different when the report runs.

I know the link is in french but it show exactly what i'm trying to achive but in my case the value of the table doesn't appear...

former_member208657
Active Contributor
0 Kudos

I'm not familiar with the book you've referenced. However, you can manipulate the default parameters in a Crystal Report using the .NET SDK by accessing the ReportDocument.ParameterFields collection. Each ParameterField contains a collection of DefaultValues. I would suggest add/deleting items from the DefaultValues.

A related Note can be found by searching for 1201926.

http://www.sdn.sap.com/irj/sdn/crystal-xcelsius-notes

former_member208657
Active Contributor
0 Kudos

Are you trying to have the list of default parameters come from your .NET DataSet? Such that the list of default params could be different each time your report runs?