Using Linq

Stimulsoft Reports.NET discussion
Post Reply
ChrDressler
Posts: 68
Joined: Tue Nov 09, 2010 2:05 pm
Location: Dresden

Using Linq

Post by ChrDressler »

Hi,

I want to set a variable with Linq, e.g.

Code: Select all

x = DataSource1.Any(p => p.Id == 14 && p.Pos == 12);
In Report.ReferencedAssemblys, I added System.Linq, but the Report Checker says
"Could not load file or assembly 'System.Linq' or one of its dependencies."

What can I do?

-Christoph
Foxpro and behind
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Using Linq

Post by HighAley »

Hello, Christoph.

Please, specify a name of the assembly file.

Code: Select all

System.Xml.Linq.dll
Thank you.
ChrDressler
Posts: 68
Joined: Tue Nov 09, 2010 2:05 pm
Location: Dresden

Re: Using Linq

Post by ChrDressler »

unfortunately, the same error: :-(
Could not load file or assembly 'System.Xml.Linq.dll' or one of its dependencies.

-Christoph
Foxpro and behind
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Using Linq

Post by HighAley »

Hello, Christoph.

Do you have the right version of the assembly?
Please, try to specify the full pass to it or copy to the project folder.

Thank you.
ChrDressler
Posts: 68
Joined: Tue Nov 09, 2010 2:05 pm
Location: Dresden

Re: Using Linq

Post by ChrDressler »

I can't specify the full path, because the report should run in customer's environment.
IF I copy the dll in the project folder, loading is succesfull, but this can't be the solution, because this dll is a part of .net. I dont' want to manage parts of .net in my project.
Foxpro and behind
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Using Linq

Post by HighAley »

Hello.

Sorry, but we have no such issue.
On our machine the Linq assembly is loaded without any error.
Please, check if there is available an assembly for used .Net Framework version.

Thank you.
ChrDressler
Posts: 68
Joined: Tue Nov 09, 2010 2:05 pm
Location: Dresden

Re: Using Linq [Solved]

Post by ChrDressler »

I solved my problem in a other way:

Code: Select all

x = DataSource1.GetDataTable().Select("Pos = 12 AND Id = 14").Length > 0;
-Christoph
Foxpro and behind
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Re: Using Linq

Post by Andrew »

Hello,

Thank you for sharing your way of solving the issue.
Post Reply