Important Note:
This documentation reflects the state of the application before the .NET 10 migration. Any changes introduced during or after the migration may not be represented here.
Trouble Viewing Images? Right-click on any image and select "Open in new tab" to view a larger version. You can also zoom in using Ctrl + Mouse Wheel for easier readability.
Article Goal
Learn how to specify the correct DLL (Dynamic Link Library) file paths when executing scripts in Finished Reports that rely on external .NET assemblies, especially when running the report through the Scheduler Service.
Why Specify the DLL’s Location During Scheduled Exports?
When exporting reports via the Scheduler, it runs independently of your local VDM session and doesn’t inherently recognize references to external libraries unless explicitly provided. By specifying the required DLL paths:
You ensure that all .NET script dependencies are resolved correctly.
The report executes without
missing methodorreferenceerrors.Scheduled jobs remain consistent and stable.
Note: Scripts that rely on extensions like .AsEnumerable() will fail without referencing the required System DLL.
Example Path: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Data.DataSetExtensions.dll
Example Error Message:
Error: The following error occurred when the script in procedure Hours_WorkedTOTAL.GetValue was executed:
There are the following errors in script(s):
line 71, column 23:
error CS1061: 'System.Data.DataTable' does not contain a definition for 'AsEnumerable'
and no extension method 'AsEnumerable' accepting a first argument of type 'System.Data.DataTable' could be found
(are you missing a using directive or an assembly reference?)
line 84, column 9:
error CS0411: The type arguments for method 'System.Linq.Enumerable.Max<TSource>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource,int>)'
cannot be inferred from the usage. Try specifying the type arguments explicitly.
line 259, column 23:
error CS1061: 'System.Data.DataTable' does not contain a definition for 'AsEnumerable'
and no extension method 'AsEnumerable' accepting a first argument of type 'System.Data.DataTable' could be found
(are you missing a using directive or an assembly reference?)
line 270, column 9:
error CS0411: The type arguments for method 'System.Linq.Enumerable.Max<TSource>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource,int>)'
cannot be inferred from the usage. Try specifying the type arguments explicitly.
Tip: These errors typically point to a missing System.Data.DataSetExtensions.dll reference that supports LINQ operations on DataTables.
Where Do You Set the DLL Reference?
You’ll add the reference inside the Finished Reports Designer, under the Script References property of the XtraReport object.
Note: If your report contains Subreports, repeat the process for each subreport's script references.
Steps to Add the DLL Reference Path
Step 1: Run the Report
Execute the report to generate any necessary data or query results. This ensures the Designer can properly bind data when editing.
Step 2: Open Finished Reports Designer
Navigate to the Finished Reports Designer by selecting the View and entering edit mode.
Step 3: Access XtraReport Properties
In the Report Explorer, click on the top-level XtraReport object. Use the property search bar and locate the Script References field.
Step 4: Add the DLL Reference
Click the ... button next to the Script References property to open the path editor.
Step 5: Enter the DLL Path
Paste in the full path to the required .NET DLL file.
Root Path Example:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Data.DataSetExtensions.dll
⚠️ Note: Ensure the file exists at the specified location and matches the architecture (e.g., Framework64 vs Framework for 64-bit vs 32-bit).
Step 6: Save and Confirm
Click OK to confirm the script reference, then save the report in the Designer.
Step 7: Re-run the Report
Execute the report again to validate that the error is resolved and the script now runs without issue.
Article Summary
When a script in a Finished Report depends on methods like .AsEnumerable() or LINQ operations, it may require external DLLs such as System.Data.DataSetExtensions.dll. These must be explicitly added to the Script References in the Finished Reports Designer for Scheduler-based exports to work.
By correctly setting these references, you:
Avoid runtime script errors
Ensure consistent execution whether run manually or scheduled
Improve reliability of automated report delivery
Use Case: A report showing work hours grouped by Employee and Week fails during export because .AsEnumerable() is not recognized. Adding the DLL fixes the issue without modifying the script logic.
Comments
0 comments
Article is closed for comments.