Running reports from PowerShell

lars_lind
Member Posts: 3
Hi,
I'm trying to run a report from a codeunit started with Invoke-NAVCodeunit from PowerShell. But I get the following error:
I can run the codeunit from the Development Environment and from the Job Queue without problems (The Chart of Accounts is printed). And when running from the Development Environment no Request Dialog was shown.
And if I choose a processing-only report, it also works from PowerShell.
My codeunit contains only one line of code:
I have also tried with the SystemPrinter parameter set to TRUE. And specifying the printer for the report in Printer Selections also did not solve the problem.
I have tried on both NAV 2013 R2 and NAV 2015 with the same result.
Are there anyone who have an idea of how I can make this work?
Best regards,
Lars
I'm trying to run a report from a codeunit started with Invoke-NAVCodeunit from PowerShell. But I get the following error:
Invoke-NAVCodeunit : Microsoft Dynamics NAV Management Server attempted to issue a client callback (Report - Chart of Accounts(1)). Client callbacks are not supported on Microsoft Dynamics NAV Management Server.
I can run the codeunit from the Development Environment and from the Job Queue without problems (The Chart of Accounts is printed). And when running from the Development Environment no Request Dialog was shown.
And if I choose a processing-only report, it also works from PowerShell.
My codeunit contains only one line of code:
REPORT.RUN(1, FALSE, FALSE);
I have also tried with the SystemPrinter parameter set to TRUE. And specifying the printer for the report in Printer Selections also did not solve the problem.
I have tried on both NAV 2013 R2 and NAV 2015 with the same result.
Are there anyone who have an idea of how I can make this work?
Best regards,
Lars
0
Comments
-
Hi,
I believe report error is coming from "Printing" dialog. No matter you use "REPORT.RUN(1, FALSE, FALSE);" but windows auto showing the "Printing" dialog box. I didn't try on powershell to run report. I did test on WS and fail. But Navision 2015 is introduce new function Report.Print https://msdn.microsoft.com/en-us/library/dn762337%28v=nav.80%29.aspx. I did test with WS and work.
Hope this info help to you.
Regards,
YukonMake Simple & Easy0 -
@yukon: Thank you for the suggestion. I had not discovered this new function. But unfortunately does REPORT.PRINT give the same error as before when called from PowerShell.
I may have to do some workaround using REPORT.SAVEASPDF, and then print the resulting file from PowerShell.
Regards,
Lars0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions