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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

SSRS DataMethod Reference not resolved

(0) ShareShare
ReportReport
Posted on by 3,325

Hi

After adding SSRS DataMethod the report (AX 2012 R3) output shows #Error for the element calling the DataMethod.

    [DataMethod(), PermissionSet(SecurityAction.Assert, Name = "FullTrust")]
    public static string GetDataMatrixCode(string currentPage, string totalPages, string custInvoiceAccount)
    {
        string currentPagePad = currentPage.PadLeft(3, '0');
        string totalPagesPad = totalPages.PadLeft(3, '0');
        string inputStr = currentPagePad   totalPagesPad   custInvoiceAccount;
        string outputStr;

        try
        {
            DataMatrix dm = new DataMatrix(inputStr, 0, 0);
            outputStr = dm.Encode();
            dm.Dispose();
        }
        catch (Exception ex)
        {
            outputStr = ex.Message   ' '   ex.InnerException;
        }
                
        return outputStr;
    }

Returning just the inputStr works well, the problem seems to be when constructing the DataMatrix.dll. The referenced dll resides in client- and server bin.

How can we find the error reason? Must dll reference be placed somewhere else?

Thanks for help.

Jan

I have the same question (0)
  • Sergei Minozhenko Profile Picture
    23,095 on at

    Hi Jan,

    Did you add reference to DataMatrix under Rererences node in Business logic project?

  • Jan M. Profile Picture
    3,325 on at

    Hi Sergei

    Without any refernce you cannot build the Project.

  • Martin Dráb Profile Picture
    239,152 Most Valuable Professional on at

    Did you try to walk through the code in debugger? If new DataMatrix() throws an exception, what's the type and Message?

    By the way, where did you get "DataMethod Reference not resolved" mentioned in the title? The text of your questions mentions only that the control shows #Error.

  • Jan M. Profile Picture
    3,325 on at

    No, that was not the error, just assumed.

    The debugger doesn't stopp at the breakpoint. Tried to attach with Ax32Serv.exe or ReportingServicesService.exe (symbols not resolved). VS is on the same system like AX and SSRS. What is the correct way for degugging?

  • Verified answer
    Martin Dráb Profile Picture
    239,152 Most Valuable Professional on at

    Sorry, I don't remember exact process; it's quite a few years since I did this for the last time (there is no such a thing in F&O).

    Try the usual tricks like unchecking "Just my code". If you can't get the debugger working, use trace messages.

  • Suggested answer
    Jan M. Profile Picture
    3,325 on at

    Solution for adding DLL (our case DataMatrix.dll) in SSRS data method:

    1) Copy the DataMatrix.dll to the C:\Program Files\Microsoft SQL Server\MSRS12.MSSQLSERVER\Reporting Services\ReportServer\bin
    2) Add the following CodeGroup to the rssrvpolicy.config file in the C:\Program Files\Microsoft SQL Server\MSRS12.MSSQLSERVER\Reporting Services\ReportServer folder:
    <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust">
    <IMembershipCondition class="UrlMembershipCondition" version="1" Url="C:\Program Files\Microsoft SQL Server\MSRS12.MSSQLSERVER\Reporting Services\ReportServer\bin\DataMatrix.dll" />
    </CodeGroup>

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 649

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 447 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 242 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans