This is a migrated thread and some comments may be shown as answers.

Calling a report library from a dll.

3 Answers 46 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kelly
Top achievements
Rank 1
Kelly asked on 02 Jan 2018, 07:01 PM

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.


3 Answers, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 05 Jan 2018, 11:29 AM
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
0
Kelly
Top achievements
Rank 1
answered on 05 Jan 2018, 12:40 PM
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?
0
Todor
Telerik team
answered on 10 Jan 2018, 09:39 AM
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
Tags
General Discussions
Asked by
Kelly
Top achievements
Rank 1
Answers by
Todor
Telerik team
Kelly
Top achievements
Rank 1
Share this question
or