cancel
Showing results for 
Search instead for 
Did you mean: 

Display certain fields in report based on parameter selection

Former Member
0 Kudos

Good Day!

I have a lot of fields in my table and cannot show them all on my report because the report is not long enough. I only want the few displayed in my details section based on my parameters selection. For example:

I have "Amount" fields ranging from November 2004 till August 2008 in my table, I have two parameter fields "Start Amount Date" and "End Amount Date" and only want to display the fields on the report between those field selection. This report will be used to show YTD(Year To Date) amounts but user wants to see the months values that makes up the ytd value.

Help much appreciated!

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I have found a another solution, done it on DB side.

Former Member
0 Kudos

Hi Shaun

If you have created parameter fields for Start date and end date, you need to just apply them in the Select expert, records selection.

Click on Report menu->Select expert->Record-> Select the date field based on which you have created the parameter and select "is between" and the parameters for the value.

For more information please refer to Crystal Reports help.

Hope this helps!!!!!

Regards

Sourashree

Former Member
0 Kudos

Hi there,

I think you understand the question wrong. the actual amount fields does not exists ON the report but in my table. Only when I select the data parameters then those fields must display ON the report.

Former Member
0 Kudos

Hi Shaun

The fields that you place on the report shows data according to the record selection criteria that you have applied.

Suppose I have placed the last year's sales field on the details section of the report and I have applied a parameter for Country. When I refresh the report and choose certain countries from the parameter, I get data for last year's sales only for those countries those I have selected from the parameter.

And if I want to see the data for last years sales only when I select the country USA, I would apply a conditional formatting on the last years sales field or the details section for that

Hope this explains!!!

Regards

Sourashree

Former Member
0 Kudos

I understand.....so this means if I do not put the fields on the report itself I cannot display it otherwise?

Former Member
0 Kudos

Hello,

just to clarify what Sourashree Gosh said in his/her last message and what you realized:

1. You first have to put the Amount field where you want it to show on the report by dragging and dropping it.

2. If you don't want it to print depending on your parameters, right-click on the amount field. Select "Format Field". In the "Common" tab click on the "X-2" button to the right of "Suppress". In the formula editor enter something like

datefield < Minimum({parameterdate}) or datefield > maximum({parameterdate})

.

This will cause the amount field to print only when the date field from your table is between the parameter dates. If it's not between the dates it will be suppressed.

Former Member
0 Kudos

Hi Shaun

Crystal reports is just a tool to fetch data from the database and display them in the desired manner.

The datafields that you want to display on to your report, you need to drag them to the particular report section(report header, page header, details etc) based on the requirement

If you need information on various sections available in crystal reports, please open crystal reports help and search for the keyword "design tab areas".

Hope this explains!!!!!

Regards

Sourashree

Former Member
0 Kudos

I do understand all of this BUT what I am asking is this:

I have 36 Amount fields that has 36 months....I cannot add all of those fields on the report cause there is no space....so the suppress formula will not work. I wanted to find out if there is another crystal thing I can do to display the fields on the report based on my parameter selection without dragging 36 fields on the report.

Hope it is more clear now.....sorry if my explanation is not up to standard.

Former Member
0 Kudos

Ok. I have a solution but you may not like it and hopefully someone else can think of something better!

1. Create a formula field in your report.

2. In the formula field write this code:

select  Minimum({dateparameterfield})
CASE  >= TOTEXT('01/01/08', 'MM/dd/yy') and <= TOTEXT('12/31/08', 'MM/dd/yy') :  TOTEXT(fieldAmount1) + TOTEXT(fieldAmount3) + TOTEXT() whichever amount fields you want from the table
CASE >= TOTEXT('01/01/07', 'MM/dd/yy') and <= TOTEXT('12/31/07', 'MM/dd/yy') : TOTEXT(fieldAmount2) + TOTEXT(fieldAmount4) + etc...
CASE ...

I hope this helps somewhat...