cancel
Showing results for 
Search instead for 
Did you mean: 

CR 8.5 Newbe questions on restricting records

Former Member
0 Kudos

I've been using Crystal Reports 8.5 for about six months now.

I've been reformatting and reworking some reports that were supplied by our vendor.

Now I want to create one from scratch and I seem to have a brain block.

I know that if I create a parameter, the report will prompt me for a value when I run the report.

I know how to create the Parameter, but I can't figure out where to tell the report to base the report on that values (restrict the report to that value).

The report is based on a Stored Procedure that supplies a number of fields including BranchID.

I want the user to be able to enter the branch they want the report for, and I would also like if they don't enter any value that it include all branchIDs

Can someone get me started?

Also is there a good resource on the Internet or to purchase that would help me with CR 8.5.

CR 8.5 is dictated by our Business System Vendor...

Thanks

Kelvin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kelvin,

In the select expert, click on the show formula button, then the formula editor button.

In the top-right (ish) of the window, there is a dropdown that says 'exceptions for nulls' by default. Click the drop, and selct 'default values for nulls'.

You can then use an IF statement in your select expert to detect nulls.


IF not <null condition> THEN
(
   the portion of your select expert relating to branch ID goes here. 
)

You may need to look up 'default values' in the formula help, depending on the type of field your parameter is to determine what to use in the <null condition> spot in that formula. If it's a number, you need to test for 0. (IF {?Branch ID} <> 0), if it's a string, you need to look for the null string ("")

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

- Create a parameter on the database field. Name the parameter as ex..u201D My Parameteru201D

- Click Select Expert on the Expert Tools toolbar. u2022 Choose Report > Select Expert from the menu.

- If the field you want to set record selection on is on your report, right-click that field and choose Select Expert from the shortcut menu.

- The Select Expert opens automatically for the field you select. You are not presented with a pick list of fields.

- If you have not selected a field by clicking it to make it active before using one of these methods, a dialog box opens, displaying the fields.

Tip: Your record selection criterion does not have to be based on a field in your report. You can choose any field from the database as a basis for record selection.

- Once you have indicated the field you want to set the record selection on and have clicked OK, the Select Expert opens.

- Select the filed on which your parameter is based on.

- Using the drop-down list, you can build selection criteria that meet your needs. Depending on the field you select, the available options in the drop-down list are: u201Cu2022 is equal to u201C.

- This option enables you to specify one specific value as the criteria, so that only matching records are included on the report;

In the list on the right hand side you have the option u201CMy Parameteru201D in the drop down list.

Click on ok and then refresh the report. The report will show the values in the report based on this parameter.

I hope this helps you.

Regards,

Prashant.

Former Member
0 Kudos

Thanks for the great info...

what about if BranchID is a prompt, and they can enter a branch, or if they don't enter anything they get All branches?

Or said differently, how can I get no entery to equal all branches?

Thanks for your time!

Kelvin