Error while opening CustInvoiceJournal Form through SSRS Report

Hi Friends,

I am working in dynamics ax2012 R3. while running ssrs report i want to open the form. Form name is CustInvoiceJournal. i used below code in process report.

form = new Form();

args = new Args(formStr(CustInvoiceJournal));

// Create the run-time form.
formRun = new FormRun(args);

// Return an object for the first data source,
// and then display a query form.
formRun.init();
formdatasource = formRun.dataSource(1);

formDataSource.query(query);
formRun.run();
formRun.detach();

it throws errors like

(S)\Classes\CW_SalesBookReport\processReport - line 151
(S)\Classes\SrsReportProviderQueryBuilder\initialize - line 59
(S)\Jobs\

i can’t find exact mistake in that line . can you help me out this error?

Thanks In Advance…

Hi Saravanaa,

pass the recid in find method and and run the job and see the form will open .

same way you can call the form in process report but i have bit confuse about your requirement, why u want to open the form at the time of report open,

i hope the below code will help u .

static void custInvoicejournalFormOpen()

{

Args args = new Args();

;

args.record(CustInvoiceJour::findRecId(5637166334));

new MenuFunction(MenuItemDisplayStr(CustInvoiceJournal),MenuItemType::Display).run(Args);

}