Changing Repository Items on Your Report


As indicated earlier in the chapter, you may become confused once you add an object from the repository to your report. This might occur if you attempt to change the format of a text object you added from the repository, resize a bitmap graphic you added from the repository, or change the text of a SQL command or custom function that s been added to the repository. In all these cases, you ll discover that the objects are locked or set to a read-only status ” you won t be able to make these kinds of changes.

This behavior is by design. In order to ensure that the repository controls the appearance and behavior of these objects, they remain connected to the repository once you ve added them to the report. As long as they re connected, the repository will control their appearance and size (in the case of text objects and bitmap graphics), or their text (in the case of SQL commands and custom functions). Probably the most obvious clue that an object is connected is the inability to change it. However, in some dialog boxes, you ll also notice a small vertical-bar icon next to the object s name , which will indicate that the object is connected to the repository.

The main benefit of leaving objects connected to the repository is to allow them to be updated automatically if anybody else makes changes to the repository. For example, if you have added a common company logo and slogan to your report using a repository-connected bitmap graphic and text object, you ll probably want all reports using those objects to automatically reflect changes to the repository should your logo or slogan change. In order to ensure consistency with this behavior, individual changes to the objects once they ve been added to reports shouldn t be allowed.

Tip  

To ensure connected objects will be updated when you initially open your reports, you must make one of two choices. By choosing File Options from the pull-down menus and checking the Update Connected Repository Objects on Open option on the Reporting tab, you ensure all reports automatically update connected objects when opened. If you only want to update connected objects on a report-by-report basis, leave this global option off and instead check the Update Repository Objects check box on the Open File dialog box when opening a Crystal Report.

click to expand

To change this behavior and manually make changes to objects you ve added from the repository, you must disconnect them from the repository. Begin by right-clicking the object. In the case of text objects or bitmap graphics, right-click directly on the object in the Design or Preview tabs. For SQL commands or custom functions, right-click the command or function name in their respective dialog boxes. From the pop-up menu, choose Disconnect from Repository. Notice that you may now resize or reformat text objects or bitmap graphics, as well as changing the contents of SQL commands or custom functions. Also, you ll notice the previously mentioned vertical bar connected icon is no longer visible.

Be aware, though, that these objects will now behave as though you just added them to the report ”they won t be automatically updated by the repository any more. Using the company logo and slogan example mentioned previously, if you disconnect the objects from the repository and save the report, they won t reflect any repository changes the next time you open the report.

Updating Repository Versions of Objects

Continuing with the company logo and slogan examples referred to previously in this chapter; what if you are in charge of updating the repository copies of the company logo and slogan? Or, you may have a company-wide custom function that requires changing for a new fiscal year or a new bonus program. In these situations, you must add the object from the repository to your report, make changes, and update the repository with the changed object.

As mentioned previously, you can t edit or modify an object that s connected to the repository. This may cause confusion if you are required to update the repository copy of an object. To get around this confusion, consider the steps required to update the repository copy of an object:

  1. Add the object to a report from the repository.

  2. Disconnect the object from the repository.

  3. Make necessary changes to the object.

  4. Save the object back to the repository in the same folder and with the same name as the original object.

Step 4 will exhibit behavior that is slightly different than the first time you added the object to the repository. When you attempt to add an object to the repository in the same folder with the same name, you will be warned that an object already exists and given the opportunity to update the version in the repository with the version that you re saving. If you choose to do this, the old repository object will be replaced with the updated version.

Once you ve performed these steps, note that the updated object you just added back to the repository will once again be connected ”you won t be able to change formatting or contents. To make future changes to the object, you must once again disconnect it from the repository.

Note  

Business Views are modified using the Crystal Enterprise Business View Manager ”you cannot update Business Views from inside Crystal Reports. The Business View Manager is discussed in detail in Chapter 17.




Crystal Reports 10
Crystal Reports 10: The Complete Reference
ISBN: B005DI80VA
EAN: N/A
Year: 2004
Pages: 223
Authors: George Peck

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net