web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Unanswered

Operation canceled when generating SSRS report

(0) ShareShare
ReportReport
Posted on by 10

ExceptionType : Microsoft.Dynamics.Ax.Xpp.ClrErrorException

stackTrace:

Microsoft.Dynamics.Ax.Xpp.ClrErrorException: Operation canceled: INVENTORY TRANSFER DOCKET at Dynamics.AX.Application.SysOperationSandbox.`executeInNewSessionAndWaitForCompletion(SysOperationIMarshalledRun operationInstance, Object[] serializedMethodInfo, String waitCaption, String operationCompletedMessage, String cancellationMessage, Boolean @operationCompletedMessage_IsDefaultSet, Boolean @cancellationMessage_IsDefaultSet) in xppSource://Source/ApplicationPlatform\AxClass_SysOperationSandbox.xpp:line 259 at

Dynamics.AX.Application.SysOperationSandbox.executeInNewSessionAndWaitForCompletion(SysOperationIMarshalledRun operationInstance, Object[] serializedMethodInfo, String waitCaption, String operationCompletedMessage, String cancellationMessage, Boolean @operationCompletedMessage_IsDefaultSet, Boolean @cancellationMessage_IsDefaultSet) at

Dynamics.AX.Application.SysOperationSandbox.executeInNewSessionAndWaitForCompletion(SysOperationIMarshalledRun operationInstance, Object[] serializedMethodInfo, String waitCaption, String operationCompletedMessage, String cancellationMessage) at

Dynamics.AX.Application.SysOperationSandbox.`executeSandboxMethod(Int32 classId, String staticMethodName, Object[] parameters, String waitCaption, String operationCompletedMessage, String cancellationMessage, Boolean @operationCompletedMessage_IsDefaultSet, Boolean @cancellationMessage_IsDefaultSet) in xppSource://Source/ApplicationPlatform\AxClass_SysOperationSandbox.xpp:line 193 at

Dynamics.AX.Application.SysOperationSandbox.executeSandboxMethod(Int32 classId, String staticMethodName, Object[] parameters, String waitCaption, String operationCompletedMessage, String cancellationMessage, Boolean @operationCompletedMessage_IsDefaultSet, Boolean @cancellationMessage_IsDefaultSet) at

Dynamics.AX.Application.SysOperationSandbox.executeSandboxMethod(Int32 classId, String staticMethodName, Object[] parameters, String waitCaption, String operationCompletedMessage, String cancellationMessage) at

Dynamics.AX.Application.SysOperationSandbox.`callStaticMethod(Int32 classId, String staticMethodName, Object[] parameters, String waitCaption, String operationCompletedMessage, String cancellationMessage, Boolean @operationCompletedMessage_IsDefaultSet, Boolean @cancellationMessage_IsDefaultSet) in xppSource://Source/ApplicationPlatform\AxClass_SysOperationSandbox.xpp:line 169 at

Dynamics.AX.Application.SysOperationSandbox.callStaticMethod(Int32 classId, String staticMethodName, Object[] parameters, String waitCaption, String operationCompletedMessage, String cancellationMessage, Boolean @operationCompletedMessage_IsDefaultSet, Boolean @cancellationMessage_IsDefaultSet) at


Dynamics.AX.Application.SysOperationSandbox.callStaticMethod(Int32 classId, String staticMethodName, Object[] parameters, String waitCaption) at

Dynamics.AX.Application.SrsReportRunService.`preRunReport(SrsReportDataContract _reportContract) in xppSource://Source/ApplicationFoundation\AxClass_SrsReportRunService.xpp:line 668 at

Dynamics.AX.Application.SrsReportRunService.preRunReport(SrsReportDataContract _reportContract) at

Dynamics.AX.Application.SrsReportRunImpl.`preRunReport() in xppSource://Source/ApplicationFoundation\AxClass_SrsReportRunImpl.xpp:line 231 at

Dynamics.AX.Application.SrsReportRunImpl.preRunReport() at

Dynamics.AX.Application.SrsReportRunController.`doReportRun() in xppSource://Source/ApplicationFoundation\AxClass_SrsReportRunController.xpp:line 1188 at

Dynamics.AX.Application.SrsReportRunController.doReportRun() at

Dynamics.AX.Application.SrsReportRunController.`runReport() in xppSource://Source/ApplicationFoundation\AxClass_SrsReportRunController.xpp:line 1132

Here is my Code:

public static void main(Args _args)
{

InventTransferDocketCL controller = InventTransferDocketCL::construct();
InventTransferDocketDC contract;

InventTransferJour inventTransJour;
InventTransferTable inventTransTable;
InventLocation toLocation;

#define.Orig('ORIGINAL')
#define.Copy('CUSTOMER COPY')


if(_args && (_args.record().TableId == tableNum(InventTransferJour)))
{
inventTransJour = _args.record();
inventTransTable = InventTransferTable::find(inventTransJour.TransferId);
toLocation = InventLocation::find(inventTransTable.InventLocationIdTo);
controller.parmReportName(ssrsReportStr(HSInventTransferDocket, Report));
contract = controller.parmReportContract().parmRdpContract() as HSInventTransferDocketDC;
contract.parmRecId(inventTransJour.RecId);
contract.parmTableId(inventTransJour.TableId);
contract.parmPrintType(#Orig);

controller.parmArgs(_args);
controller.parmShowDialog(false);
controller.parmLoadFromSysLastValue(false);
controller.parmReportContract().parmReportCaption("@HSLabel:HS00053");
controller.parmReportContract().parmPrintSettings().caption("@HSLabel:HS00053");
controller.startOperation();
}
}

I have the same question (0)
  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    Hi HJNC, I changed the title to from "is there any way to resolve this kind of issue I was trying to generate an SSRS report can someone explain to me what kind of error am I getting." to "Operation canceled when generating SSRS report". It's now possible to see what the thread is about. I lso changed the category to Development / Customization / SDK.

    Also, please use Insert > Code (in the rich-formatting view) to paste source code. It'll preserve line indentation, therefore your code will be eaiser to read. And if it's easier for others to help you, you have a better chance that someone will do it.

    Now please tell us more about your problem. You shared some code, but is it relevant? Isn't the problem in the report itself? Did you test it successfully when developing it? Have you deployed it succcessfully?

  • HJNC Profile Picture
    10 on at

    Hi Martin thank you for the correction it's my first time asking here in a forum and I'm new in D365 .. upon testing the report, it shows a dialog box "Something went wrong in data preparation while generating the report Please try again" and on the notification it says that Specified cast is not valid so I really don't have any ideas on how to solve this error and actually upon building the project there is no error found so I'm a bit confused on where is this error coming from. Thank you for  replying on my concerns

  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    Good, it sounds that you have more information about the cause. Can you please give us more details about the "Specified cast is not valid" error?

  • HJNC Profile Picture
    10 on at

    That is the problem on my end it's my first time encountering this kind of error and have not much background about this error. if you want I can show you my data provider and data contract so you can see the full code

  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    For example, is "Specified cast is not valid" the whole error message? Also, isn't it there a stack trace showing where the exception was thrown?

    Do you use an RDP class to obtain data? Don't you have a problem there? Have you tried debugging it?

    Also, does the solution compile without errors?

  • Arunraj Rajasekar Profile Picture
    1,743 on at

    Which version are you using?

  • HJNC Profile Picture
    10 on at

    10.0.17 (10.0.761.10019) this is the version that I'am using

  • HJNC Profile Picture
    10 on at

    The stack trace that I'm getting is in the description I'm using the event viewer to get the stack traces.

    I tried to debug it but like what I said It takes more than an hour for debugging unfortunately I'm using a slow devbox since this is just a trainee devbox so it really takes time to debug it tho

    and yes I compile the solution without an error

  • Arunraj Rajasekar Profile Picture
    1,743 on at

    When you assign the incorrect data type to a field, you will receive the "Specified cast not valid" error.

    You're using the classes "InventTransferDocketDC" and "HSInventTransferDocketDC," and I'm assuming that HSInventTransferDocketDC extends invenTransferDocketDC. Check to see if there's a data type mismatch between these two classes.

  • HJNC Profile Picture
    10 on at

    I just mistype the HS I already corrected it .. but let me check the datas that I'am passing and  I;ll get back to you

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 299 Super User 2025 Season 2

#2
Siv Sagar Profile Picture

Siv Sagar 183 Super User 2025 Season 2

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 118 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans