Page 1 of 1

Referenced assembly not found

Posted: Tue Feb 22, 2011 2:02 pm
by scott
Reports.Ultimate: 2010.2
Windows 7 Ultimate x64, English, SP1
.NET Framework 4, English

Loading a report from a template for viewing results in "Referenced assembly 'Imco.Stat.Reporting.ReportDataAccess.dll' not found" where Imco.Stat.Reporting.ReportDataAccess.dll is our assembly which is referenced in the project and via:

// Partial web service template creation code...
StiReport rep = new StiReport();
string[] references = rep.ReferencedAssemblies;
List newReferences = references.ToList();
newReferences.Add("Imco.Stat.Reporting.ReportDataAccess.dll");
rep.ReferencedAssemblies = newReferences.ToArray();
byte[] b;
b = rep.SaveToByteArray();
return b;

// Partial web service report creation code...
StiReport rep = new StiReport();
string[] references = rep.ReferencedAssemblies;
List newReferences = references.ToList();
newReferences.Add("Imco.Stat.Reporting.ReportDataAccess.dll");
rep.ReferencedAssemblies = newReferences.ToArray();
rep.Load("StiViolationsVersusTargetReport.mrt");
rep.Compile();
rep.Render();
byte[] b;
b = rep.SaveDocumentToByteArray();
return b;

// Partial client template view/save code...
StiReport rpt = new StiReport();
byte[] b;
b = // Call web service to get report template byte[]
rpt.Load(b);
StiWebDesigner1.Design(rpt);
// Save report template
protected void StiWebDesigner1_SaveReport(object sender,
StiWebDesigner.StiSaveReportEventArgs e)
{
StiReport rpt = e.Report;
rpt.Save("StiViolationsVersusTargetReport.mrt");
}

// Partial client report viewer code...
StiReport rpt = new StiReport();
byte[] b;
b = // Call web service to get report byte[]
rpt.LoadDocument(b);
StiWebViewerFx1.Report = rpt;

Thank you!

Referenced assembly not found

Posted: Wed Feb 23, 2011 2:32 am
by Alex K.
Hello,

Please check the following code for change reference:

Code: Select all

StiReport report = new StiReport();
string[] newRefAsssemblies = new string[9] 
{ "System.Dll", "System.Drawing.Dll", "System.Windows.Forms.Dll", "System.Data.Dll", "System.Xml.Dll", "Stimulsoft.Controls.Dll",
    "Stimulsoft.Base.Dll", "Stimulsoft.Report.Dll", "MyReference.dll"};
report.ReferencedAssemblies = newRefAsssemblies;
Thank you.

Referenced assembly not found

Posted: Wed Feb 23, 2011 10:07 am
by scott
Thank you very much, Aleksey. All is working fine now.

Referenced assembly not found

Posted: Wed Feb 23, 2011 1:08 pm
by Andrew
Our team is happy to help you.