Adding dll reference to report

Stimulsoft Reports.NET discussion
Siang Hwee
Posts: 50
Joined: Mon Mar 26, 2007 6:32 pm
Location: Malaysia

Adding dll reference to report

Post by Siang Hwee »

Hi,

I notice there is a tutorial http://www.stimulsoft.com/livedemos/Rep ... ction.html to add dll reference inside the report. I would like to add my project dll reference into this project. My problem is how to add my project dll if it is not GAC.

The scenario shown as below.
======================
1) Project located: c:\web
2) Report located: c:\web\Modules\reports\SampleRpt.mrt
3) Utility Reference located: c:\web\bin\CompanyName.Utility.Core.dll

May i know how to set the reference to the dll as mentioned at location 3 if report is at location 2. Can i set something like "../../bin/CompanyName.Utility.Core.dll"

Thanks for help.
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Adding dll reference to report

Post by Vital »

Hello,

Really we don't search any assemblies during compilation. This operation processed by c# (or vb.net) compiler. You can use absolute paths and relative paths. All this variants must worked. Before compilation we have set current directory of application to ApplicationDirectory (directory where placed startup assemblies).

Thank you.
Siang Hwee
Posts: 50
Joined: Mon Mar 26, 2007 6:32 pm
Location: Malaysia

Adding dll reference to report

Post by Siang Hwee »

Hi Vital,

Thanks for reply. I did try to use the absolute path and i think it works. However, absolute path is not practical in real life deployment. I would prefer to use relative path, but i have no idea how to set it. ../../bin/CompanyName.Utility.Core.dll seem doesnt' work. I believe most of the reports is located at path others than the bin folder. Therefore if stimulReport allow set reference to the assemblies should have the capability to set the reference to the bin folder. May i know how to do it?
Vital wrote:Hello,

Really we don't search any assemblies during compilation. This operation processed by c# (or vb.net) compiler. You can use absolute paths and relative paths. All this variants must worked. Before compilation we have set current directory of application to ApplicationDirectory (directory where placed startup assemblies).

Thank you.
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Adding dll reference to report

Post by Vital »

Hello,

Please try CompanyName.Utility.Core.dll

Thank you.
Siang Hwee
Posts: 50
Joined: Mon Mar 26, 2007 6:32 pm
Location: Malaysia

Adding dll reference to report

Post by Siang Hwee »

Hi Vital,

Any news on the relative path? I have try to put CompanyName.Utility.Core.dll directly but seems the dll reference cannot be found. Please add relative path as mentioned earlier like "../../bin/CompanyName.Utility.Core.dll" so that deployment to client side will be much easier and practical.

Besides, I would like to ask you the question about external function. I write my own function in a CompanyName.Core.dll and the function is something like this:

public string ConvertSomeValueToOtherData(int value)
{
// follow by coding logic.
}

The parameter value is actually Sum of Databand column get from the group GroupHeaderEmployee "{Sum(GroupHeaderEmployee, DataSchema.number1)}". How can I pass the value and display the return value. Which event shall i pass. I try to use absolute path and call the function at BeforePrint event but seems nothing happen.

Just to clarify. I have a databand column call number1. Under the Group Footer i sum the the number1 column. But i have to change this sum of number1 at footer into some meaningful information which need to use my ConvertSomeValueToOtherData function. How can I pass the Sum Value to the function and display at the footer of the report. Besides, which event should I call the function.

Thanks and Regards,
Goh

Vital wrote:Hello,

Please try CompanyName.Utility.Core.dll

Thank you.
Siang Hwee
Posts: 50
Joined: Mon Mar 26, 2007 6:32 pm
Location: Malaysia

Adding dll reference to report

Post by Siang Hwee »

Hi,

Any update on this issue? Thanks
Siang Hwee
Posts: 50
Joined: Mon Mar 26, 2007 6:32 pm
Location: Malaysia

Adding dll reference to report

Post by Siang Hwee »

Hi,

Please let me know what's the possible solutions as I already used stimulreport as part of core engine. Changing back to Crystal Report is something i really reluctant to. I need your helps to resolve my problem.

Thanks.
Siang Hwee
Posts: 50
Joined: Mon Mar 26, 2007 6:32 pm
Location: Malaysia

Adding dll reference to report

Post by Siang Hwee »

Someone please answer me so that i know the problem is possible to be solved or not
Brendan
Posts: 309
Joined: Sun Jul 16, 2006 12:42 pm
Location: Ireland

Adding dll reference to report

Post by Brendan »

Hello,

I tried an example with the information you provided.
My settings locally were:

1) Project located: g:\work\web
2) Report located: g:\work\web\Modules\reports\SampleRpt.mrt (my test report was called LineReport.mrt)
3) Utility Reference located: g\work\web\bin\CompanyName.Utility.Core.dll (my assembly was called UtilityFunc.dll)


When I published the application to the web server all worked fine.
In the Report file from step 2 I referenced my utility assembly by just adding in the reference to "UtilityFunc.dll" without and need for relative paths

Siang Hwee
Posts: 50
Joined: Mon Mar 26, 2007 6:32 pm
Location: Malaysia

Adding dll reference to report

Post by Siang Hwee »

Hi Brendan,

I really appreciate your reply. I know absolute path will work. As I mentioned before, relative path will be more practical. We have a lot of customers using our system. However, not all company system have the G drive. normally deployment to customer site will just copy the entire web folder. Just imagine if you have 2 developers with 2 difference project location, using the source safe control, which dll location shall the application refer to? It will be very difficult to synch the source. Therefore relative path is inevitable for easier development and deployment. I really need your help to enhance the reporting tools for this simple features.


Thanks and Regards,
Goh
Brendan wrote:Hello,

I tried an example with the information you provided.
My settings locally were:

1) Project located: g:\work\web
2) Report located: g:\work\web\Modules\reports\SampleRpt.mrt (my test report was called LineReport.mrt)
3) Utility Reference located: g\work\web\bin\CompanyName.Utility.Core.dll (my assembly was called UtilityFunc.dll)


When I published the application to the web server all worked fine.
In the Report file from step 2 I referenced my utility assembly by just adding in the reference to "UtilityFunc.dll" without and need for relative paths
Post Reply