How do you put a Jet Reports in NAV Navigation Pane?

I’m trying to make a NAV Navigation Pane Designer menu entry that when clicked, runs a Jet Report.

Can this be done? Is so, can you outline how?

Many thanks

Hi Adrian,

you will find the answer in the Jet Reports Help (See the Text below)

You can also use the autopilot.exe to start JetReports by C/Side-code using the shell-command (See AutoPilot Command Line Parameters).

Best regards

Andreas

Launching Jet Reports from Navision

If you are a Navision developer and have appropriate development granules you can launch Excel from Navision, update report options, refresh the report and print. You must have the OCX granule and either Application Builder or Report Designer. Below is a code-unit example of how to do this. The same code could be written inside a form or a Navision report.

Documentation()

Example: Run A Jet Report from within Navision

Steps implemented in code:

  1. Start Excel; make it visible and interactive.

  2. Open the Jet Reports Add-in.

  3. Open a Workbook.

  4. Update Options.

  5. Run Jet/Report.

  6. PrintPreview the Worksheet that contains the report.

  7. Close Excel.

Global Variables (This example uses Excel XP objects. For other versions of Excel, these will be slightly different.):

#### 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;

Hi,

You can also simply create a shortcut to the actual Excel-workbook.
(This is something the users can do them selves too.)
Can also be done by using the HYPERLINK command from a form/report or what ever.

If the Jet Reports Add-in are installed locally (which i think it has to be afterall), then opening excel, will also start jet reports (as i understand how it works).
Someone might correct me if i’m wrong.

If you only open the excel-file, then you will not be able to set parameter, but you can open the Jet Report option form automatically using +Report in the Cell A1.

Sir,

May I Ask, whare must i put the code above? I’m Using Jet Essentials 2011, and NAVISION 2009. Thanks.