[Question] Report syntax with RDLC layout
Hi! Please give me a syntax to create a Report with RDLC layout.
Currently, I processed as below:
- I create a report 50028-Trial Balance Sheet with NAV Development Environment. It run well.
- I use Txt2Al.exe tool to convert this report (REP50028.txt). I receive 2 file: REP50028.al and Trial Balance Sheet.rdlc.
- I use Visual Studio Code to build the package. I publish, install the package well.
Result: When I run report in Preview mode, But system only show a blank layout. I checked DataSet with "About This Report" action. DataSet is OK.
So, Please give me a syntax to embed RDLC layout into report.
Hi,
I think the converter is not able to to this completely. When you create a new report, there are two things you must think about; defining the report dataset of data items and columns, and then designing the report layout. Once you have a report with a dataset, as in the example here above, you can create a layout using the following steps:
- Publish the report object to the server by pressing F5.
- Open Dynamics NAV, and then search for Custom Report Layouts.
- Create a new report layout; make sure to check the Insert Word Layout check box.
- Export the layout of the report.
- Save the Word layout to the VS code project and open the layout in Word.
- In Word, edit the layout using the XML Mapping Pane on the Developer tab. If you do not already see the Developer tab, go to Options, then Customize Ribbon, and in the Main tabs section, select the Developer check box.
- In Word, in the Custom XML part, locate the report, and then open the layout.
- Drag elements onto the document, and save the report layout when you are done.
- Back in Visual Studio Code, make sure to add the properties WordLayout set to the name of the layout file, and the DefaultLayout property set to Word.
- Press F5 to compile and run the report.
Example: MyReportTest.zip
It is also possible to use RDLC layout. Just make sure that:
- you exported the txt file using the finsql.exe -command=ExportToNewSyntax (docs: https://msdn.microsoft.com/en-us/dynamics-nav/newdev-txt2al-tool)
- RDLC file is located within the project folder
- That there is an RDLCLayout property defined on the report object and that it points to the relative path to the .rdlc file:
RDLCLayout = '.\Trial Balance Sheet.rdlc';
Indeed, I forgot to mention that in my reply :-) It is ofcourse also possible with an RDLC layout. In the zip file you will see an example of a report with both a word and rdlc layout, exported in a separate folder.
Hi StanislawStempin and srenders, Thank you so much for your reply.
I will check my case again and inform you soon.
I checked my reports. It run OK now. Thank all.
But I have another problem. My layout report include non-Unicode String. When I run Report on Preview Mode, Report show String incorrectly. However, I find out my issue. I must change Region before convert file using Txt2Al tool. Now: My Report is OK. Thank All so much.