How To Pass Parameter Through a TierButton by icf1n7h

VIEWS: 1 PAGES: 4

									             How To Pass Parameter Through a TierButton
Run a Report on One Record

Introduction      This document explains how to run a report on one document (one record) by
                  passing the parameter for a Crystal Report through the button.


When To Use It    Use this method when you want to run a report on one record.


Overview          These are the overall steps:

                    Step                                   Action
                     1       Create the Crystal Report with a parameter
                     2       Add a TierEdit and TierButton to the form.
                     3       Create the FD table by saving the form as a document.
                     4       Create a new report category if needed.
                     5       Create the report.
                     6       Set the params property for the button.


1. Form           Place the following controls on the form:
Controls

                     Control       Property on Object                         Value
                                        Inspector
                   TierEdit   FieldName                          test
                              Name                               test
                              Calculation                        :tier_docid
                              Fieldtype                          Integer
                              Fieldsize                          0
                   TierButton Params                             Parameter name=:test
                              Action                             baReport


Note on           In Design View, on the Object Inspector for the button, click on the params
TierButton        property. Click on the ellipsis and add the parameter name=:control name
                  here. Parameter name is the name of the parameter in Crystal Reports
                  without the “?” preceding it. There are no spaces before or after the equal sign
                  in Params.

                                                                                 Continued on next page




825e4560-9080-4c3c-ae93-2fdf29774109.doc                                            Page 1 of 4
Revision 2 – 3/10/05
              How To Pass a Parameter Through a TierButton
Run a Report on One Record, Continued

2. FD table       Once the controls are on the form, save it as a document in a cabinet to create
                  the FD table.


3. Report Icon       If needed, create a new report category by right clicking on the report icon
                      and selecting New Report Category.
                     Create a new report by right clicking on the report category and selecting
                      New Report.
                          o Fill in name.
                          o Click on run Tool to open Crystal Reports.


4. Create            Insert the fields on the report.
Report               Create and insert the parameter.
                     Select the parameter in Select expert.
                     Save the report in the report directory on the server.
                     Close the report.
                     Click Browse to select the location of the report. The path will appear
                      next to Report File.


5. TierButton     Connect the report to the button by setting the following property in design
                  view.

                      Control        Property on Object Inspector               Value
                   TierButton       Report                              The report name
                                    Caption                             Run Report


Note:             The report name refers to the name of the Crystal Report.




825e4560-9080-4c3c-ae93-2fdf29774109.doc                                            Page 2 of 4
Revision 2 – 3/10/05
              How To Pass a Parameter Through a TierButton
Select a Parameter on a Document

Introduction      This document explains how to pass a parameter for a Crystal Report through
                  the button.


When To Use It    Use this method when you want to pass only one parameter.


Overview          These are the overall steps:

                    Step                                   Action
                     1       Add a TierComboBox and TierButton to the form.
                     2       Create the FD table by saving the form as a document.
                     3       Create a new report category if needed.
                     4       Create the report.
                     5       Set the Params property for the button.


1. Form           Place the following controls on the form:
Controls

                       Control      Property on Object                         Value
                                        Inspector
                   TierComboBox FieldName                          P_List
                                Items                              List of the parameters
                                                                   defined in Crystal
                   TierButton         Params                       Parameter name=:tiercombo
                                      Action                       baReport


Note on           The parameter name is the name of the parameter in Crystal Reports without
TierButton        the ? preceding it. :tiercombo refers to the control name of the
                  TierComboBox that has the parameter list. There are no spaces before or after
                  the equal sign in Params.


2. FD table       Once the controls are on the form, save it as a document in a cabinet to create
                  the FD table.

                                                                              Continued on next page




825e4560-9080-4c3c-ae93-2fdf29774109.doc                                           Page 3 of 4
Revision 2 – 3/10/05
            How To Pass a Parameter Through a TierButton
Select a Parameter on a Document, Continued

3. Report Icon       If needed, create a new report category by right clicking on the report icon
                      and selecting New Report Category.
                     Create a new report by right clicking on the report category and selecting
                      New Report.
                          o Fill in name.
                          o Click on run Tool to open Crystal Reports.


4. Create            Insert the fields on the report.
Report               Create and insert the parameter.
                     Select the parameter in Select expert.
                     Save the report in the report directory on the server.
                     Close the report.
                     Click Browse to select the location of the report. The path will appear
                      next to Report File.


5. TierButton     Connect the report to the button by setting the following property.

                      Control        Property on Object Inspector               Value
                   TierButton       Report                              The report name
                                    Caption                             Run Report


Note:             The report name refers to the name of the Crystal Report.




825e4560-9080-4c3c-ae93-2fdf29774109.doc                                            Page 4 of 4
Revision 2 – 3/10/05

								
To top