AL icon indicating copy to clipboard operation
AL copied to clipboard

[Question] Report syntax with RDLC layout

Open hgnamvn opened this issue 9 years ago • 5 comments

Hi! Please give me a syntax to create a Report with RDLC layout.

Currently, I processed as below:

  1. I create a report 50028-Trial Balance Sheet with NAV Development Environment. It run well.
  2. I use Txt2Al.exe tool to convert this report (REP50028.txt). I receive 2 file: REP50028.al and Trial Balance Sheet.rdlc.
  3. 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.

hgnamvn avatar Jun 29 '17 08:06 hgnamvn

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:

  1. Publish the report object to the server by pressing F5.
  2. Open Dynamics NAV, and then search for Custom Report Layouts.
  3. Create a new report layout; make sure to check the Insert Word Layout check box.
  4. Export the layout of the report.
  5. Save the Word layout to the VS code project and open the layout in Word.
  6. 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.
  7. In Word, in the Custom XML part, locate the report, and then open the layout.
  8. Drag elements onto the document, and save the report layout when you are done.
  9. 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.
  10. Press F5 to compile and run the report.

Example: MyReportTest.zip

srenders avatar Jun 29 '17 09:06 srenders

It is also possible to use RDLC layout. Just make sure that:

  1. you exported the txt file using the finsql.exe -command=ExportToNewSyntax (docs: https://msdn.microsoft.com/en-us/dynamics-nav/newdev-txt2al-tool)
  2. RDLC file is located within the project folder
  3. 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';

StanislawStempin avatar Jun 29 '17 09:06 StanislawStempin

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.

srenders avatar Jun 29 '17 09:06 srenders

Hi StanislawStempin and srenders, Thank you so much for your reply.

I will check my case again and inform you soon.

hgnamvn avatar Jun 29 '17 10:06 hgnamvn

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.

hgnamvn avatar Jun 30 '17 02:06 hgnamvn