Hi Everyone,
I have created a .Net application that creates a PDF for a MSSQL reporting services report we have created and expects 5 parameters.
I can successfully run it whit the standard Nav SHELL comand as below:
Ret := SHELL(ApplicationString, ReportId, RunMode, FORMAT(inSalesInvoiceRec."Sell-to Customer No."), FORMAT(inSalesInvoiceRec."No."), YearTxt);
Typically this would translate to something like this:
Ret := SHELL('\\someshare\myapp.exe', 'PDFINVOICE', '1', '1234', 'INV123456', '2012');
This works really well except for the untrusted application message. As I need to run this application 100s of times per run from a code unit I need bypass this message.
I have tried to use a 'Microsoft Shell Controls And Automation'.Shell object but I get error message attached. I've read multiple posts on this topic and I'm still hitting my head up against a brick wall. ](*,) ](*,) ](*,)
I have included my code below.
What am I missing???
Cheers
VAR global
WSHShellObj@1000000001 : Automation "{F935DC20-1CF0-11D0-ADB9-00C04FD58A0B} 1.0:{72C24DD5-D70A-438B-8A42-98424B88AFB8}:'Windows Script Host Object Model'.WshShell";
VAR local
Ret@1100011 : Integer;
ShellString@1100012 : Text[256];
WinStyle@1100013 : Variant;
IF ISCLEAR(WSHShellObj) THEN
CREATE(WSHShellObj);
ShellString := ApplicationString + ',' + ReportId + ',' + RunMode + ',' + FORMAT(inSalesInvoiceRec."Sell-to Customer No.") + ',' +
FORMAT(inSalesInvoiceRec."No.") + ',' + YearTxt;
WinStyle := 1;
WSHShellObj.CurrentDirectory := PDFGenCtrlRec."Console Applcation Folder";
ret := WSHShellObj.Run(ShellString, WinStyle);
CLEAR(WSHShellObj);
Comments
FD Consulting
=D> \:D/