0

Launching Jet Reports from Navision

Hello

I’m trying to launch JetReports from Navision, update the named ranges (for filtering), refresh the report and show it to the user.

This is my code:


fctRunJet() //XL Automation 'Microsoft Excel 12.0 Object Library'.Application //Workbook Automation 'Microsoft Excel 12.0 Object Library'.Workbook //Worksheet Automation 'Microsoft Excel 12.0 Object Library'.Worksheet IF CREATE(XL, TRUE) THEN BEGIN XL.Interactive := TRUE; XL.Visible := TRUE; XL.Workbooks.Open('c:\Program Files\JetReports\JetReports.xlam'); Workbook := XL.Workbooks.Open('c:\test.xlsx'); Workbook.Names.Item('namedrange').RefersToRange.Value := FORMAT("No."); //”Sales Header”.”No.” XL.Run('JetMenu','Report'); XL.Run('Events'); END;

This is my testreport’s NL function:

=NL("rows";"sales header";"No.";"No.";$D$3)

I see the Report do what it is supposed to do, but after calculating I get this error:

The formula on sheet "result" in address $D$6 cannot be used with NL(Rows), NL(Columns), or NL(Sheets)…

Does anyone has good code to launch JetReports from the Sales Order form, update a named range for filtering, refresh the report and show it to the user who can work with the report and save it if necessary?


Thanks in advance,
Karel

6 comments

Please sign in to leave a comment.