Preceding Posts In This Series
In Part 1 of this series of posts, we examined the underlying technologies behind RDLC reporting. In Part 2, we looked at the basic process of converting Dynamics NAV classic reports to an RDLC layout.
Since then, we’ve been working through the specific issues you will encounter during the conversion process.
In parts 5 to 7, we began converting Report 5703 – Transfer Order, which is a document report – the type of report that will likely pose your biggest challenge in transitioning to RDLC layouts. As part of that conversion, we analyzed the classic version of the report in some detail, fixed a problem with the multiple copies feature in the RDLC version, and resolved a labeling problem in the RDLC version created by NAV’s Create Layout Suggestion, where the program had improperly substituted one of its global functions for a perfectly valid text data field.
So what remains to be done?
Assessing the Remaining Problems With Report 5703 – Transfer Order
As a refresher, here’s an image of how the classic version of the report should look:
If you’re using the Cronus Ext database, the transfer order shown here is for the second transfer order in the database, i.e. Transfer Order No. 1002. Here’s the same transfer order presented in our latest version of the RDLC report:
The remaining problems are:
Column headings are missing in the body.
The report is much too wide. If you want to see the true effect of this, switch to the Print Layout in preview mode.
The Shipment Method label is missing.
Fixing the Missing Column Headings
Why are the column headings missing? Well, first, let’s keep in mind that we are dealing with a flattened dataset (if you don’t understand why, see Converting Dynamics NAV Classic Reports To RDLC – Part 1). The data for your column headings is therefore a set of fields within the same record structure as the rest of your data, i.e. the dataset passed to your RDLC report by the classic reporting engine. Whenever data is missing from a report, the first thing you should do is check whether the data has made it into the underlying dataset.
How do you check this? Perform the following procedure:
Run your RDLC report. Make sure you request 0 copies.
Under the Help menu in the upper right-hand corner of the report previewer, you should see an option labelled “About This Report”.
The first time you click this option, it will tell you that the feature you desire has been set up and that you need to run the report again (though not using that exact wording). Do as the message says and close the report, then run it again.
The second time you run the RDLC report, click the About This Report option again. This time, NAV will present you with a tabular listing of the dataset.
Now examine the listing, in particular the rows for the Transfer Order No. 1002, which we’ve highlighted in blue:
Compared to the report output, the first thing you should notice is that there are four data records for Transfer Order No. 1002, yet only three detail lines in the report itself.
Why is that?
The short answer is because, in the classic report designer, the third Integer data item and the Transfer Line data item both have a DataItemLinkReference to the Transfer Header data item, and both share the same level of indentation. Thus, in a flattened dataset model, the header data item is joined first to the Integer data item, which contains only 1 record (thus producing 1 result record), then to the Transfer Line data item, which contains 3 detail records for this transfer order (thus producing 3 result records). The final dataset for our sample transfer order therefore has 4 records (for a complete description of the dataset’s creation, see Converting Dynamics NAV Classic Reports To RDLC – Part 6).
But, given that Integer data items are virtual tables with only 1 field (Number), what’s in all the other flattened dataset fields for that record, including the ones containing the column heading values?
If you said “nothing”, you win the prize. We can confirm our “nothing” hypothesis by scrolling right in our “About This Report” dataset listing until the leftmost column is none other than “Transfer_Line_Item_No_Caption” – our first column heading field:
As you can see, the column heading fields for the first record of any transfer order are all blank. This gives us our first likely suspect in why the column headings themselves are blank, but we cannot yet declare the crime solved. Before we can do that, we have to examine the RDLC layout, in particular the placement of the column headings.
When you do this, you will find that the column headings are in the top row of the table in the Body section, while the Shipment Method label (and data field) are in the bottom row. But these are not regular table header/footer rows, as you might expect. They are group header/footer rows.
Hmmm, the plot thickens. What is our table grouped on? If you right click the group header symbol and select “Edit Group”, it will open up the following window:
As you can see, the table is grouped on the Transfer_Header_No. field. This is an utterly useless grouping. It was useless at the moment of conversion because, in a report with potentially multiple copies of each transfer order, there could be multiple sets of data sharing the same Transfer Header No.
It became even more useless when we placed the table inside a List data region in Converting Dynamics NAV Classic Reports To RDLC – Part 6, which we then grouped on a combination of Transfer_Header_No. and OutputNo (essentially the copy number). The table grouping is therefore redundant.
However, that’s not the point of this post. The point is that table group header values are drawn from the first record in the group, which, as we’ve already seen, contain blank column heading values, and the grouping/sorting at the list and table levels have done nothing to change that fact.
Now that we understand the problem, how do we fix it?
There are actually numerous ways to fix it, some better than others given the functionality we still have to implement for this report. But, for now, let’s take the easy road and simply filter out the blank record at the table level. To do this, open the table properties and set the following filter in the Filters tab:
Now save, compile, and run the report, and you will see that your column headings and your Shipment Method label will both now appear.
Fixing the Spacing Issues
From a visual perspective, all that remains to be done with this report now (so long as we continue to run the simple version of it) is to fix the spacing issues. For instructions on how to do this, see Converting Dynamics NAV Classic Reports To RDLC – Part 3.
In our next post, we’ll continue the repairs to Report 5703 – Transfer Order by implementing the Show Internal Information option, which will display the dimension values associated with each transfer line.