Skip to Content

Master - Detail Report


Hi, my name is Kumar, and in this video I will demonstrate Master Detail Report.

For that, let us go to Management Console. In Management Console, go to Reports, then under menu Designer Label, click on Report Designer. Report Designer window appears.

In this report, we will create relation between Data Sources. So, let us put 2 Data Band on a page of Report Template. Define New Data Source, Connection, Okay. Let us take a Table which is INV Product Group. I am taking this Table, selecting the field which will be Product Group Key and Description. Say Okay, select Data Source, and Okay.

Now, we will put another Data Band. Assign the New Data Source. This time, we will take another Table which is INV Product and select the ID, Description, and Product Group Key and then Okay. INV Product, Okay. You may edit the Data Bands, align them. Let us take this.

You can change the values of required properties, for example, if tit is necessary for all master entries to be printed in any case even if detailed entries are not present, then set the Print if Detail Empty property of the Data Band 1 which is a Master Component in Master Detail Report to True. So, let us make that Print if Detail Empty property to True and set the Can Shrink property of the Data Band 2 that is Detailed Component in the Master Detail Report to True. So, let us Can Shrink to True.

So, in this way you can edit your Data Bands and the properties. You can change the background color, like if I want to keep the background color, go to Brush, Color, select the Color. Similarly, for Data Band 2, we can change the Color, let us take it, this one.

Now, let us put the Text Components with expressions on Data Bands. Here, expression is a reference to the Data Field. For example, we will put a Text Component with expression INVProductGroup.Description on Data Band 1. Let us do it. Select the data column which will be Description and Okay. Align the Text Component. You can edit the Text component like increase the font size, make it bold. Let us make it. You may also change the background color of the Text Component.

Now, let us put the Text Component with INVPproduct.ID and INVProduct.Description expressions in Data Band 2. Select the Data Column, which will be ID. Take another one, Data Column and Description. Let us align them. You may change the font as per your requirement. If you want to provide borders you can provide the borders to the Text Components. Let us take this. So, in this way you can do the editing of the Text Components. Now, let us define the Master Component.

In our case, the Master Component is the Data Band 1. This means that in the Data Setup window of Data Band 2, the Data Band 1 will be specified as the Master Component in the Master Component tab. Double click on this. Click on Master Component and select this Data Band 1 as a Master Component. Click Okay.

Now, we will create relation between Data Sources. If the relation will not be created and/or relation property of the Detailed Data Source will not be filled, then for Master Entry, all details entries will be output.

Let us open the Data Source window, click on Relation, then click on New Relation, select the parent data source which will be INVProductGroup and then child data source which is INVProduct. Then, select the Data Columns for Relation which will be Product Group Key in our case. Product Group Key and then click Okay. Select the Relation and Okay.

Now, you may click Preview or press F5 to generate the report. Let us press F5, and this is your Master Detail report.

You may also add other bands like Header Band and Footer Band. For that, let us go back to Template, let us close this. Place the Header Band and Footer Band, let us place it here. Then, place the Footer. Put Text Component with Expressions in these bands.

The Expression in the Text Component is a header in the Header Band and footer in the Footer Band. Let us put here. Item Code, let us align it. Similarly, another one. This will be Description. Let us align these. You can edit the Header Bands. Let us take this. Let us make it bold.

Now, we will place the Text Component in footer, provide the Expression, and Okay. Align it. You may provide the color for it. Let us give it some color.

Now, click on preview or F5 to generate this report. Let us press F5, and this is the Master Detailed report with header and this is the count.

With this, we end our session.

Thank you for watching this video.