web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Business Central forum

Extending existing report to add more fields into dataset

(0) ShareShare
ReportReport
Posted on by 10

I am just wondering whether I can download AL code of Standard purchase Order (1322). I like to add couple of fields into the dataset. If yes, then how?

OR 

Is there any other approach to accomplish the same task without rewriting the entire report object again?

Thanks in advance for your help and suggestions.

  • LSanderDK Profile Picture
    80 on at

    You can export them from youe NAV/BC Database. 

    https://docs.microsoft.com/en-us/powershell/module/microsoft.dynamics.nav.ide/export-navapplicationobject?view=businesscentral-ps

    Export-NAVApplicationObject -ExportToNewSyntax

    And after that run Txt2Al.EXE on the file, then you can have a complet AL liberal 

  • mbharodia Profile Picture
    10 on at

    Hi

    Thanks a lot for your info. I receive the following error

    PS C:\WINDOWS\system32> Export-NAVApplicationObject COD1-10.txt -DatabaseName 'Demo Database NAV (11-0)' -Filter 'Type=Report;Id=1322'  -Username navscripter -Password abcd1234 -DatabaseServer 'localhost\navdemo'

    Export-NAVApplicationObject : : [22922070] The following SQL Server error or errors occurred:

    18456,"28000",[Microsoft][SQL Server Native Client 11.0][SQL Server]Login failed for user 'navscripter'.

    At line:1 char:1

    + Export-NAVApplicationObject COD1-10.txt -DatabaseName 'Demo Database  ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

       + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException

       + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Export-NAVApplicationObject

    The user has OWNER permission on the database. Not sure.. what else need to be specified? Thanks.

  • LSanderDK Profile Picture
    80 on at

    Can you connect from NAV Development with database login with navscripter?

    Can you run the script with you windows login?

  • mbharodia Profile Picture
    10 on at

    I tried with windows login that I use for development environment including application. This has SUPER user permission within application. That did not work. So, I thought to create a sql sever login and give it a try.

  • Suggested answer
    I Gusti Made Ari Profile Picture
    3,608 on at

    Hi , you can use below as alternative way :

    1. Export to new Syntax

    Please ensure the user has permission as "db_owner" for the database in sql.

    Below command if you are using windows login :

    finsql.exe command=exporttonewsyntax, file=C:\Files\Mod\File.txt, database="Demo Database NAV (11-0)", servername=localhost\NAVDEMO ,filter=Type=Report;Id=1322

    Below command if you are using database login

    finsql.exe command=exporttonewsyntax, file=C:\Files\Mod\File.txt, database="Demo Database NAV (11-0)", servername=localhost\NAVDEMO ,filter=Type=Report;Id=1322 ntauthentication=0, username=myuser, password=myuserpassword

    2. Run txt2al

    C:\Program Files (x86)\Microsoft Dynamics NAV\110\RoleTailored Client>Txt2Al.exe

    --source=C:\Files\Mod\ --target=C:\Files\Converted\ --rename

  • mbharodia Profile Picture
    10 on at

    Thanks a lot for your suggestion. When I ran finsql, I received the following error.

     

    [18023703] You do not have permission to run the 'File, Export, Text' System.

    Contact your system administrator to have your permissions changed.

    I ran the command under windows login. The command prompt was called under Administrator mode and that login has SUPER user permission within the application.

    I appreciate if you have any suggestion to fix this issue.

  • Claus Macali.dk Profile Picture
    1,055 on at

    Hi

    this report 1322, is this a word report, i think, therfor you have to use word to do

    And therfor yoa cant do work with AL

  • Suggested answer
    I Gusti Made Ari Profile Picture
    3,608 on at

    Hi , please make sure you use developer license when export the objects to txt

  • mbharodia Profile Picture
    10 on at

    I was able to produce AL file; it needed the developer license.

  • mbharodia Profile Picture
    10 on at

    The SQL Server needed TCP/IP enabled; that resolved the connection issue.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans