Showing posts with label RTC Reports. Show all posts
Showing posts with label RTC Reports. Show all posts

Wednesday, 17 September 2014

What's New in Microsoft Dynamics NAV 2015 - Part 5

Word Report Layouts


In previous versions of Microsoft Dynamics NAV, you could only design the layout of reports by using Visual Studio Report Designer or Microsoft SQL Server Report Builder. With Microsoft Dynamics NAV 2015, you can design report layouts by using Microsoft Word 2013. Word report layouts are built on Word custom XML parts that dynamically map a report dataset into a report at runtime.

Customizing and Managing Report Layouts from the Microsoft Dynamics NAV Clients

You can customize Word and RDLC report layouts from the Microsoft Dynamics NAV Windows client and Microsoft Dynamics NAV Web client by using Word 2013 and SQL Server Report Builder, respectively. This enables users can make variations of layouts, and then use the variations when viewing and printing reports as needed.

New Report Functions

The following functions have been added in Microsoft Dynamics NAV 2015 to support new report layout implementation.

SAVEASXML
 Saves a report as an .xml file on the computer that is running Microsoft Dynamics NAV Server.
WORDXMLPART
 Returns the report data structure as structured XML that is compatible with Word Custom XML parts.
WORDLAYOUT
 Gets the Word report layout that is used on a report and returns it as a data stream.
RDLCLAYOUT
 Gets the RDLC layout that is used on a report and returns it as a data stream.
HASCUSTOMLAYOUT
 A function in codeunit 1 that determines whether a report has an active custom Word layout or RDLC layout at run time.
MERGEDOCUMENT
 A function in codeunit 1 that loads the custom Word layout that is active on report and renders it in the targeted format, such as Word or PDF.
REPORTGETCUSTOMRDLC
 A function in codeunit 1 that loads the proper custom RDLC layout for a report at run time and uses the layout to render the report.



Layout can be designed in Word



Output will be




Monday, 23 September 2013

Fixed No. of Lines in NAV 2013 RTC Reports

The Objectives of this video are:
 1.      Review a typical NAV 2013 reports preview.
 2.      Modify the report to show fixed No. of lines
 3.      Run the report to review the changes.

Please note that I have used Report 205 = Order Confirmation report in this demo.





The functions created in Visual Studio are

public Shared DocumentNo as Object
public Shared FixedLenth as integer
public Shared prevOutputNo as integer

Public Function SetDocLength(NewData as boolean,Group as object,Outputno as integer )
  If (NOT NewData) AND (prevOutputNo = OutputNo) AND (DocumentNo = Group) Then
      FixedLenth = FixedLenth + 1
  ELSE
      FixedLenth = 0
  End If
 DocumentNo = Group
 prevOutputNo = OutputNo
End Function

Public Function GetDocLength( ) As Integer
  Return FixedLenth
End Function


Expression Added in Invisible text box is

=Code.SetDocLength((Iif(Fields!Type_SalesLine.Value = " ", true, false)),Fields!No_SalesHeader.Value,Fields!OutputNo.Value)


You can also watch video at