Initiate Jet Report from Navision Menu

Kylea
Member Posts: 39
Hi all,
Lots of comments about Jet Reports and have been using them for a few months now here and there. I can not find any example of how to call a Jet Report from a Navision menu. Can this be done? I tried using
from the ONPush trigger on the menu item - but the Shell command failed saying that my operating system could not execute the program 'C:\Temp\MyJetReport.xls'
As always any assistance is greatly appreciated.
Cheers
Kylea.
Lots of comments about Jet Reports and have been using them for a few months now here and there. I can not find any example of how to call a Jet Report from a Navision menu. Can this be done? I tried using
SHELL('C:\Temp\MyJetReport.xls')
from the ONPush trigger on the menu item - but the Shell command failed saying that my operating system could not execute the program 'C:\Temp\MyJetReport.xls'
As always any assistance is greatly appreciated.
Cheers
Kylea.
0
Comments
-
have you tried changing it to Hyperlink?
HYPERLINK('C:\Temp\MyJetReport.xls');0 -
=D> Of course it would have to be that simple.
I read the help text for both SHELL & HYPERLINK and from that decided that HYPERLINK would not do it. Just shows you how wrong you can be.
Thankyou
Kylea.0 -
The Hyperlink allows windows to use the extension associations therefore the proper application is used when opening a file.
hyperlink a doc & word opens
hyperlink a pdf & abobe reader opens
hyperlink a xls & excel opens
etc.0 -
There is a section in the Jet Reports help that explains how to launch excel from within Navision
Andrew0 -
The example in the help document (which I've copied here) is much better because you can pass values to the report to use in filtering the report.
Name DataType Subtype
XL
Automation
'Microsoft Excel 10.0 Object Library'.Application
Workbook
Automation
'Microsoft Excel 10.0 Object Library'.Workbook
Worksheet
Automation
'Microsoft Excel 10.0 Object Library'.Worksheet
OnRun()
{To reuse existing instances of Excel, use CREATE(XL)}
IF CREATE(XL, TRUE) THEN BEGIN
{Workbooks don't necessarily start visible or interactive. Since the user will interact with the workbook, you need to set the below values.}
XL.Interactive := TRUE;
XL.Visible := TRUE;
{Add-ins do not automatically open when using automation, so the Jet Reports add-in must be opened below. You must also open any other add-ins that are needed.}
XL.Workbooks.Open("C:\Program Files\JetReports\JetReports.xla");
{Open the report workbook.}
Workbook := XL.Workbooks.Open("C:\Program Files\JetReports\Reports\Finance Graph.xls");
{Update the report options. The option values are in single cell named ranges.}
Workbook.Names.Item('PeriodType').RefersToRange.Value := 'Week';
Workbook.Names.Item('DateFilter').RefersToRange.Value := '1/1/01..3/31/01';
{Run the jet report.
IMPORTANT NOTE:
Jet Reports intends to keep the below command working in future versions of Jet Reports. All other menu commands might change. They might work now, but could break in future version. Please do not use any other Jet Reports commands in your software.}
XL.Run('JetMenu','Report');
XL.Run('Events');
{In some cases all the below steps may not be desired. Perhaps the user wants to drilldown and examine the report in Excel.}
{Choose a worksheet and launch print preview. The user can cause the report to print if desired.}
Worksheet := Workbook.Worksheets.Item('Report');
Worksheet.PrintPreview;
{Avoid the message asking if the workbook should be saved by marking it as already saved. Be careful with this. This step assumes that the workbook does not need to be saved since it is a report template.}
Workbook.Saved := TRUE;
{Close Excel}
XL.Quit;
END;Sherman Glass
http://community.jetreports.com0
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