is it possible to use full path to referenced library?

edited 10:58AM in FastReport .NET
Hello,

i would like to use full path for referenced libraries in script tab like this:

System.dll
System.Drawing.dll
System.Windows.Forms.dll
System.Data.dll
System.Xml.dll
c:\tmp\TestDataProvider.dll

Is it possible? Or must the assembly always be in the same folder as application.

When i use full path and press preview button i get an exception bellow. When the library is in the same folder like application all works fine. But I need to use different location for it.

For a test case the TestDataProvider is very simple (fake) class, it has no external references. I tried change down library target framework to 2.0, but without any change.

namespace TestDataProvider
{
public class Test
{
public Test()
{
MyProperty = 42;
}
public int MyProperty { get; set; }
}
}

here is report script:

namespace FastReport
{
public class ReportScript
{
public string GetValue() {
var provider = new TestDataProvider.Test();

return provider.MyProperty.ToString();
}
}
}

and finally usage in text block:
[GetValue()]

Here is the exception I get:

System.Exception: Text1: expression error: GetValue() ---> System.IO.FileNotFoundException: Could not load file or assembly TestDataProvider, Version=1.0.0.0, Culture=neutral, PublicKeyToken=nullor one of its dependencies.
The specified module could not be found.
v FastReport.ReportScript.GetValue()
v FastReport.ReportScript.CalcExpression(String expression, Variant Value)
--- Konec trasov??n?­ z??sobn?­ku pro vnitÅ™n?­ v??jimku ---
v FastReport.TextObjectBase.CalcAndFormatExpression(String expression, Int32 expressionIndex)
v FastReport.TextObject.GetData()
v FastReport.BandBase.GetData()
v FastReport.Engine.ReportEngine.PrepareBand(BandBase band, Boolean getData)
v FastReport.Engine.ReportEngine.ShowBandToPreparedPages(BandBase band, Boolean getData)
v FastReport.Engine.ReportEngine.ShowBand(BandBase band, Boolean getData)
v FastReport.Engine.ReportEngine.ShowDataBand(DataBand dataBand, Int32 rowCount)
v FastReport.Engine.ReportEngine.RunDataBand(DataBand dataBand, Int32 rowCount, Boolean keepFirstRow, Boolean keepLastRow)
v FastReport.Engine.ReportEngine.RunDataBand(DataBand dataBand)
v FastReport.Engine.ReportEngine.RunBands(BandCollection bands)
v FastReport.Engine.ReportEngine.RunReportPage(ReportPage page)
v FastReport.Engine.ReportEngine.RunReportPages()
v FastReport.Engine.ReportEngine.RunReportPages(ReportPage page)
v FastReport.Engine.ReportEngine.Run(Boolean runDialogs, Boolean append, Boolean resetDataState, ReportPage page)
v FastReport.Report.Prepare(Boolean append)
v FastReport.Report.Prepare()
v FastReport.Design.ReportTab.Preview()




I tried many scenarios like load assembly in runtime in application before load report, use AssemblyResolve event, change environment temp folder and get created assembly with temp name like"w30tu2oc.dll" copy and load it in AssemblyReslove event. But nothing works.

Thanks for help
Petr

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.