8 Customizing Master-Detail Reports
Customizing Master-Detail Reports
This chapter describes how to customize a master-detail report. It includes the following topics:
About Master-Detail Reports
A master-detail report is a type of report that displays a record that resides in a master business component and a list of the detail business component records that reference the master business component. The master business component possesses a one-to-many relationship with the detail business component. It is similar to a master-detail view in a Siebel application, in that Siebel CRM displays detail records for each master record. A master-detail view displays the detail records for one master record at a time, but a master-detail report displays detail records for all master records at the same time.
The following figure includes the Service Request Activity - All report in Siebel Service, which is an example of a master-detail report.
![Example of a Master-Detail Service Request Activity (All) Report](images/Examp_ServiceReqActivity(All).png)
In this example, the master-detail reports provide master information for each service request, and a list of activities for this service request. Each service request begins on its own page. For more information, see Viewing the Report Template of a Master-Detail Report.
A master-detail report can also include multiple detail elements where a list of detail records can display several business components for each master record. For example, the Account Service Profile report includes the following lists for each account master record:
Customer survey responses
Opportunities
Service requests
For a description of a report that includes two detail elements, see Creating a Master-Detail Report Template in Microsoft Word.
Many reports that come predefined with Siebel CRM are master-detail reports.
How Siebel CRM Handles Multivalue Fields
The business object that the integration object references specifies how the master-detail report incorporates a parent business component and child and grandchild business components. When Siebel CRM runs a report, it captures the user interface context, and then sends it to the primary integration component of the integration object. If a report includes a multivalue field (MVF), then Siebel CRM displays only the first record. To display all the records from a a multivalue field, you must create an integration object that references the business component that contains the multivalue field that Siebel CRM must display. For more information, see How Siebel Reports Uses Integration Objects.
Siebel CRM also uses this configuration for an indirect multivalue field. For example, consider the case where the business address of an account is associated with an opportunity that Siebel CRM displays in the report. The business addresses in the multivalue field are not directly related to the opportunity, but they are related to the account that it is associated with this opportunity. To display all the records in the business address multivalue field as a detail section, you must do the following work:
Create a link between the Business Address business component and the Opportunity business component using Account Id as the source field.
Include the Business Address business component under the Opportunity business object
Create an integration object with the Business Address business component under the integration object, and include the required multivalue field.
For more information about multivalue fields, see Configuring Siebel Business Applications.
Viewing the Report Template of a Master-Detail Report
In the example in this topic, you view the report template that Siebel CRM uses for the Service Request Activity (All) master-detail report.
To view the report template of a master-detail report
Run the Service Request Activity (All) report:
Log in to the Siebel Service application.
Navigate to the Service screen, and then choose All Service Requests across Organizations.
In the All Service Requests across Organizations list, choose an account and then click the Reports button in the application toolbar.
In the Run Report pane, in the Report Name list, choose Service Request Activity (All).
Choose a report output type, and then click Submit.
In the File Download dialog box, choose Open.
Siebel CRM displays the Service Request Activity (All) report in a browser window. To view this report, see About Master-Detail Reports.
Open Oracle BI Publisher Desktop.
For more information, see About Oracle BI Publisher Desktop.
Open the srvreqaa.rtf file that resides in the following folder:
SIEBEL_SERVER_ROOT\XMLP\TEMPLATES
For more information, see Directory Structure That Siebel Reports Uses
The following screen capture includes some of the features that this template uses:
For example, this template includes the following items:
Table for the master record that Siebel CRM displays in a form.
Table for each set of child records that Siebel CRM displays in a list.
For-each loop that Siebel CRM runs for all master records. It includes the parent form and all child lists.
The following condition for the Activity section that prevents Siebel CRM from displaying header information in the Activity section if no activities exist for the service request:
(
<?if:current-group()//ssAction?>
)For information about how to identify the report template that is associated with a report, see Views You Use to Register Report Templates.
In the Oracle BI Publisher menu, choose Tools, Field Browser, and then Show All.
The Field Browser dialog box displays, that allows you to view and modify the template. For more information, see Code That Oracle BI Publisher Uses for the Service Request Activity (All) Report Template.
Code That Oracle BI Publisher Uses for the Service Request Activity (All) Report Template
The following table describes the code that Oracle BI Publisher uses for the Service Request Activity (All) report template. You can view this code if you use Oracle BI Publisher Desktop to open the Service Request Activity (All) report template. For more information about this code, see theFusion Middleware Report Designer's Guide for Oracle Business Intelligence Publisher available on Oracle Technology Network (http://www.oracle.com/technetwork/indexes/documentation/index.html). For more information about integration objects, see How Siebel Reports Uses Integration Objects.
Table Code That Oracle BI Publisher Uses for the Service Request Activity (All) Report Template
Syntax | Oracle BI Publisher Code | Description |
---|---|---|
If |
<?if://ssServiceRequest?> |
An IF condition that determines if service request record exist, do not exist, or are not displayed. |
for-eachgroup: ssServiceRequest |
<?for-each- group:ssServiceRequest; position()?> |
The start of a group section that iterates for each record in the Service Request data set. |
ssSrNumber ssAccount ssStatus |
<?ssSrNumber?> <?ssAccount?> <?ssStatus? |
Field mappings. |
If |
<?if://ssCreated?> |
If condition that does not display the ssCreated field if null. |
ssCreated |
<?format- date:psfn:totext(ssCreated, "yyyy-MM-dd'T'HH:mm:ss", "MM/dd/yyyy hh:mm:ss"); 'SHORT_TIME'?> |
Field formatting. |
End |
<?end if?> |
End of if condition. |
ssSeverity ssDescription |
<?ssSeverity?> <?ssDescription?> |
Field mappings. |
If |
<?if://ssClosedDate?> |
If condition that does not display the ssClosedDate field if null. |
ssClosedDate |
<?format- date:psfn:totext(ssClosedDa te,"yyyy-MM-dd'T'HH:mm:ss", "MM/dd/yyyy hh:mm:ss"); 'SHORT_TIME'?> |
Field formatting. |
End |
<?end if?> |
End of if condition. |
ssPriority ssCustomerRefNumber ssOwner |
<?ssPriority?> <?ssCustomerRefNumber?> <?ssOwner?> |
Field mappings. |
for-each:current-group() |
<?for-each:current- group()?> |
Start of a group section, iterating for each record in the current group (for example, Service Request). |
If |
<?if:current-group()// ssAction?> |
An IF condition that determines if action records exist, do not exist, or are not displayed. |
for-each:ssAction |
<?for-each:ssAction?> |
Beginning of the repeating element group for Action. |
If |
<?if://ssCreated?> |
If condition that does not display the ssCreated field if null. |
ssCreated |
<?format- date:psfn:totext(ssCreated, "yyyy-MM-dd'T'HH:mm:ss", "MM/dd/yyyy hh:mm:ss"); 'SHORT_TIME'?> |
Field formatting. |
End |
<?end if?> |
End of if condition. |
ssCreatedByN ssOwnedBy sssStatussType ssDescription |
<?ssCreatedByName?> <?ssOwnedBy?> <?ssType?> <?ssStatus?> <?ssDescription?> |
Field mappings. |
end for-each:ssAction |
<?end for-each?> |
End of the repeating element group for Action. |
End if |
<?end if?> |
The end of the if condition |
end for-each |
<?end for-each?> |
End of current-group() repeating group section. |
page break |
<?split-by-page-break:?> |
Page break after the end of the group section. |
end for-each-group: ssServiceRequest |
<?end for-each-group?> |
End of Service Request group section. |
End |
<?end if?> |
End statement that ends a subroutine. |
If |
<?if:not(// ssServiceRequest)?> |
If condition that prints "No Data Found" in the report if there are no records. |
End |
<?end if?> |
End if statement for the condition in the first row. |
Creating a Master-Detail Report Template in Microsoft Word
Creating a master-detail report follows the same process as creating a simple report. However, consider the following important points when creating master-detail reports:
Make sure that all child integration components in the integration object include the required value in the Parent Integration Component property. For more information, see How Siebel Reports Uses Integration Objects.
In the report template file, make sure that the correct for-each-group and for-each:current-group elements are placed in the template, see Viewing the Report Template of a Master-Detail Report.
When creating custom integration objects for Siebel CRM, make sure that the fields used for dynamic queries in the applet of the master component are also contained in the integration component. Dynamic queries are specific, customized queries that you create.
To create a master-detail report template in Microsoft Word
Open Oracle BI Publisher Desktop in Microsoft Word, and then create a new document.
For more information, see About Oracle BI Publisher Desktop.
In the Oracle BI Publisher Desktop menu, choose Data, and then Load XML Data.
Choose the XML file that contains the sample data, and then save the template in RTF format.
Add titles, formatting, page header, page footer, and so on, as necessary.
Add the Master data section:
Insert a master data section.
You can insert this section manually or use the Oracle BI Publisher Desktop menu, and then the Insert menu item.
Choose the master data section, and then add a for-each-group section:
Click Insert, Repeating Group, and then the Advanced tab.
This process embeds the for loop in the table and does not replicate the location of the controls in the predefined examples.
Change the expression:
<?for-each-group:ssServiceRequest;position()?>
(Optional) If you must view descriptive text for the inserted sections, click Tools, Options, Build, and then Descriptive.
Add the Detail data section:
Choose the detail data section.
In the Oracle BI Publisher menu, click Insert, and then Repeating Group.
Choose the defaults, and then click OK.
Insert a page break after the final detail section:
Choose the Oracle BI Publisher properties of the entire group.
Navigate to Create, Group, and then Properties.
Choose a page break option.
Add formatting features and conditions.
For more information about adding features, see Viewing the Report Template of a Master-Detail Report.
Register the report.
For more information, see Registering Report Templates.
Viewing Descriptive Text for Repeating Group Sections
When you create a template that includes a repeating group section, you might find it useful to view the descriptive text for the inserted sections. Descriptive text allows you to view the Oracle BI Publisher syntax.
To view the descriptive text for the repeating group sections
Open Oracle BI Publisher Desktop in Microsoft Word.
In the Oracle BI Publisher application-level menu, click Options, and then Build.
In the For-each form field box, choose Descriptive.