Calling a report library from a dll.

4 posts, 0 answers
  1. Kelly
    Kelly avatar
    4 posts
    Member since:
    Mar 2013

    Posted 02 Jan 2018 Link to this post

    I have successfully created a reportslibrary.dll as a class library containing my reports and when called from a winforms.exe it works as expected.
    I'm creating an add-on application for AutoCAD that requires my code to be compiled as a class library(dll).
    When I call on my reportslibrary.dll from my AutoCAD dll I receive the following error:
    Invalid report type
    Value cannot be null.
    Parameter name: type

    Any reason why I can’t call on my reportslibrary.dll from a dll and I can from an exe?
    I have verified all setting are the same.


  2. Todor
    Admin
    Todor avatar
    646 posts

    Posted 05 Jan 2018 Link to this post

    Hi Kelly,

    The exception with the specified message is thrown when an instance of the report cannot be created. For some reason the report type cannot be resolved correctly.
    This could happen, for example, if the reportslibrary has not been loaded successfully by the AutoCAD.dll.

    Regards,
    Todor
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Kelly
    Kelly avatar
    4 posts
    Member since:
    Mar 2013

    Posted 05 Jan 2018 in reply to Todor Link to this post

    Thank you for your reply.
    I have found my problem.
    I’m writing a 3d party application for AutoCAD.
    The execution flow is thus: AutoCAD loads my Application.dll which references ReportsLibrary.dll.
    My install directory contains both Application.dll and ReportsLibrary.dll.
    After moving ReportsLibrary.dll from my install directory into AutoCAD’s install directory and changing AutoCAD’s acad.exe.config, it worked.
    I’m not real excited about putting my ReportsLibrary.dll into another application’s install directory and modifying there config.
    Are there any other options for referencing ReportsLibrary.dll and setting it’s connection string when it is located in another directory?
  4. Todor
    Admin
    Todor avatar
    646 posts

    Posted 10 Jan 2018 Link to this post

    Hi Kelly,

    The solution to the problem you found is the correct one. Many products require explicit registration of third party software in their configuration files for security reasons. I assume this is the case also with AutoCAD.

    Regards,
    Todor
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top