Options

Execute Crystal Reports from NAV with selected parameters

ChowdaryChowdary Member Posts: 148
edited 2015-05-06 in NAV Three Tier
Hi NAVfamily

I am trying to work with this downloadhttp://www.mibuso.com/dlinfo.asp?FileID=1415
I am having difficulty understanding this code
Sales Invoice Header - OnAfterGetRecord()
// params like : reportname parm1 param2 param3
// use espace between params - reportname is allways the first param

params := 'facture.rpt '+ "Sales Invoice Header"."No.";

// --> execute script - do not modify
Vbs.Language := 'VBScript';
txtCR := '';
txtCR[1] := 13;
code1 := code1 + 'sub OpenFile()' + txtCR;
code1 := code1 + 'dim objShell' + txtCR;
code1 := code1 + 'Set objShell = CreateObject("Wscript.Shell")' + txtCR;
code1 := code1 + 'strArgument = "report.exe " & chr(34) & _' + txtCR;
code1 := code1 + '"'+params+'" & chr(34)' + txtCR;
code1 := code1 + 'objShell.Run strArgument' + txtCR;
code1 := code1 + 'set objShell = Nothing' + txtCR;
code1 := code1 + 'End Sub'+ txtCR;
Vbs.AddCode(code1);
Vbs.ExecuteStatement('OpenFile()'+ txtCR );
// <-- execute script - do not modify

I am working on NAV 2009 R2 and Crystal reports 14.0.2.364 RTM
Did anyone tried this download successfully?

thanks
Pleasure in the job puts perfection in the work

Comments

  • Options
    ecokeyecokey Member Posts: 5
    The code will execute "report.exe" ... Is a report loader and will pass your parameters
    First you have tu manually run report.exe to select the folder where your rpt is.
    Send me a pm if you need more infos
  • Options
    MEMMEM Member Posts: 57
    the question is after that I installed NNAV Crystal Reports installer where I can Find "report.exe"
Sign In or Register to comment.