.NET Business Connector calls the method to print Axapta report

I created the method in Axapta for the print report. Then I called this method from .Net. The report won’t print. What can be wrong in the code? I tested this method in Axapta and Report is printing. This is the code from Axapta method:

ReportRun report;

Args args = new Args();

MenuFunction ReplenishmentMenu;

PrintJobSettings printJobSettings = new PrintJobSettings();

;

ReplenishmentMenu = new MenuFunction(menuitemoutputstr(ReplenishmentReport),MenuItemType::Output);

args.record(PlanTable::find(‘PL000049’));

args.parmEnumType(enumName2Id(‘NoYes’)); //send this parameter for can disable interactivies of report and query

args.parmEnum(enum2int(NoYes::Yes));

report = ReplenishmentMenu.create(args);

report.init();

report.report().interactive(false);

report.query().interactive(false);

printJobSettings.setTarget(PrintMedium::Printer);

printJobSettings.deviceName(@’\st1\Canon LBP2900’);

printJobSettings.copies(1);

report.printJobSettings(printJobSettings.packPrintJobSettings());

report.printJobSettings();

report.run();

Hi

I have the same problem using BusinessConnector to print a report (a shared network printer on AOS machine). From C# I can create a FreeTextInvoice, post it succesfully, but printing the invoice does not work. My work-around was to print the invoice in PDF format to a file. But again, AcromatReader fails to print the file. I believe AcroRd starts but fails to access the printer. The report sees all available printers.

Do you have a solution to the problem.

Wille

UI won’t work through BC, this is reports, forms and dialogs.

you said…Axapta method working fine…

can you just post the BC code and the error

let me see…

Regards,

AxxxAPTA