0

Launching Jet from Navision Multiple times

Do note that the code found in the support site (http://support.jetreports.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=131) only allow Excel to launch once.

For example:
I'm unable to launch the report from Navision after the first time unless I close the form and re-launch (which also work for the first time).

With the great help from the in-house NAV consultant, we managed to work around with the below code (maybe Jet folks could provide some good insights on their given code in support site)

We added an additional code "clear(XL)" to allow multiple launching of Jet without closing the form.

IF CREATE(XL, TRUE) THEN BEGIN XL.Interactive := TRUE; XL.Visible := TRUE; XL.Workbooks.Open('C:\Program Files (x86)\JetReports\JetReports.xlam'); Workbook := XL.Workbooks.Open('C:\EZRA\Customer.xls'); //Workbook.Names.Item('PeriodType').RefersToRange.Value := 'Week'; //Workbook.Names.Item('DateFilter').RefersToRange.Value := '1/1/01..3/31/01'; XL.Run('JetMenu','Report'); //XL.Run('Events'); worksheet := Workbook.Worksheets.Item('Record'); worksheet.PrintPreview; Workbook.Saved := TRUE; XL.Quit; CLEAR(XL) END;

2 comments

Please sign in to leave a comment.