Skip to main content

Developing a Custom Sales Order Report.

 Hello everyone! 

I hope you all are doing well. This is the second installment in our report development series. If you haven’t already watched the first video, which covers the basics of report components, I recommend checking out the playlist to get a foundational understanding before diving into this guide.

In today’s post, we’ll take a step forward and start building a document report, specifically a Sales Order Report. While working on this report, we’ll cover many essential aspects of RDLC report development that are crucial to understanding the overall process. This guide will focus on printing the report body, and in future posts, we’ll tackle the header and footer.

Step 1: Setting Up the Data Source

Since the sales line details in the report come from the Sales Line table, we need to create a new report using this table as the data source.

  1. Open the Developer Environment in Dynamics NAV.

  2. Create a new report and set the DataItem as Sales Line.

  3. Save the report with an ID, such as 60000, and name it My Custom Sales Order Report.

  4. Select the necessary fields from the Sales Line table that we want to display in the report output:

    • Type (Item, G/L Account, etc.)

    • No. (Number associated with the item)

    • Description

    • Unit of Measure

    • Quantity

    • Line Amount

If any field isn’t directly selectable, you can manually append it in the dataset.

  1. Ensure that each field has a valid name format (no spaces allowed) and then save the report.

Step 2: Understanding the Dataset

Before diving into the visual layout, it’s important to understand the dataset that the report generates.

  1. Run the report preview.

  2. Navigate to Help > About This Page to inspect the dataset structure.

  3. Verify that the dataset includes all the required fields and understand how data is structured before designing the layout.

This dataset will serve as the foundation of our report and understanding it will help us troubleshoot issues as we progress.

Step 3: Designing the Report Layout

Now that our dataset is ready, let’s move to the layout design using either Visual Studio or Report Builder.

  1. Open the report layout in the preferred tool.

  2. Identify the Body section where the report details will be displayed.

  3. Insert a Table Control to represent the sales lines.

  4. Link the table to the dataset by setting the DataSetName property.

  5. Add six columns to match the selected fields:

    • Type

    • No.

    • Description

    • Unit of Measure

    • Quantity

    • Line Amount

  6. Format the table:

    • Ensure that the header row appears in bold.

    • Adjust column widths appropriately, especially for Description.

    • Remove unnecessary default table borders for a cleaner look.

    • Add a bottom border for the header row to visually separate it from the data.

Step 4: Refining Report Formatting

Upon previewing the report, we might encounter formatting issues such as text wrapping and misaligned headers. Let’s refine the layout further:

  1. Fix Multiline Text Issues:

    • Go to the properties of each column.

    • Set CanGrow = False to prevent text from expanding beyond cell boundaries.

  2. Ensure Consistent Font and Style:

    • Set the font family to Segoe UI (standard in NAV reports).

    • Adjust the font size to 8pt for better readability.

  3. Adjust Row Heights:

    • Standard NAV reports typically use a row height of 5 cm. Ensure that the same applies to both the data and header rows.

Step 5: Preview and Final Adjustments

Now, let’s preview the report:

  1. Run the report again to check the output.

  2. Verify that columns are properly aligned, headers are bold, and there are no unwanted borders.

  3. Ensure that numeric fields like Line Amount are formatted correctly.

  4. If needed, make final adjustments to column widths and alignments.



What’s Next?

In the next post, we’ll explore header and footer design options in Dynamics NAV, including:

  • Fixed and dynamic headers.

  • Formatting numeric fields correctly.

  • Handling page breaks efficiently.

I hope you found this guide helpful! Let me know your thoughts in the comments. If I missed anything, feel free to share your feedback, and I’ll make sure to address it in future posts. Thank you for reading, and happy reporting! 🚀

 Regards,
 Saurav Dhyani

Comments

Popular posts from this blog

RTC Report It is not possible to instantiate the Visual Studio bridge.

Hi all, As a Navision developers I have Multiple Versions of Navision running in single Machine. As discussed Earlier in the post how to run multiple Version of RTC in single machine. So my machine have following details for RTC Versions - NAV 2009 R2    - is installed. NAV 2009 SP1  - is copied at C:\Program Files (x86)\Microsoft Dynamics NAV\60\NAV 6.0 SP1 IN\ NAV 2009         - is copied at C:\Program Files (x86)\Microsoft Dynamics NAV\60\NAV 6.0 IN\ This approach has been working great for execution of Classic and RTC Clients. However, after installing Dynamics NAV 2009 R2, if i tried to view the Layout for an NAV 2009 SP1 Report i was getting the following error: ---------------------------  Microsoft Dynamics NAV Classic  ---------------------------  It is not possible to instantiate  the Visual Studio bridge.  ---------------------------  OK    --------------------------- After searchi...

Dynamics NAV - All that you need to know about MenuSuites.

Hi Readers, This article is based on a request from a blog reader who wanted to understand about MenuSuite in Dynamics NAV. If you have started working with Business central with AL Code then it does not apply to those releases but if you are interested go ahead. Let's start with Future - In Latest and greatest version of product MenuSuite are obsolete and no longer used. So this article applies if you want to learn about C/AL MenuSuite.

Error After Restore SQL Backup of NAV 2013 Database

Hi all, we are facing a conman issue during restoring a SQL Database backup restored for NAV 2013. While Trying to run object from Object Designer we get below listed error (even the service is configured properly) - --------------------------- Microsoft Dynamics NAV Development Environment --------------------------- There are no NAV Server instances available for this database. You must ensure that a NAV Server instance is running and is configured to use the database before you perform this activity. --------------------------- OK    ---------------------------