Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

SSRS DataMethod Reference not resolved

Posted on by 3,221

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

  • Suggested answer
    Jan M. Profile Picture
    Jan M. 3,221 on at
    RE: SSRS DataMethod Reference not resolved

    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>

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,198 Most Valuable Professional on at
    RE: SSRS DataMethod Reference not resolved

    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.

  • Jan M. Profile Picture
    Jan M. 3,221 on at
    RE: SSRS DataMethod Reference not resolved

    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?

  • Martin Dráb Profile Picture
    Martin Dráb 230,198 Most Valuable Professional on at
    RE: SSRS DataMethod Reference not resolved

    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
    Jan M. 3,221 on at
    RE: SSRS DataMethod Reference not resolved

    Hi Sergei

    Without any refernce you cannot build the Project.

  • Sergei Minozhenko Profile Picture
    Sergei Minozhenko 23,089 on at
    RE: SSRS DataMethod Reference not resolved

    Hi Jan,

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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans