Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • I have some custom functions in a "new" DLL (myDLL2) that I have been trying to use in the GetValue method of a calculated field in the report designer scripting.

                                    But I keep getting an error (when previewing report) saying I might be missing an assembly reference.
                                    (I have added "using myDLL2;)

                                    If I use the property "ScriptReferencesString" and provide a full path to myDLL2, I am able to see my custom methods which I expect, and it works great.

                                    However, I am also able to reference custom methods in another existing assembly (myDLL1) within the solution.
                                    (if I add "using myDLL1;)

                                    My question is, how am I able to see methods in myDLL1, when it was NEVER added to "ScriptReferencesString".??

                                    Something somewhere is allowing the report designer scripting to see the first DLL, which I do not want to allow users to be able to do.

                                    So while I understand on some leverl the need to register DLLs using the ScriptReferencesString property, what I don't understand is how I'm able to see methods in other customs DLL that I have not registered.


                                Show all comments
                                • Hi Darren,

                                  My attempts to replicate the issue you are experiencing have been unsuccessful. I have created a sample, and it appears to work fine on my side (see a video). It looks like some other things are involved in this issue, which I have not taken into account. Would you please check how the attached project works? If it operates well, modify it to reproduce this issue and send the project to us.

                                • Darren Flynn 1 11.06.2013

                                  Thanks for the sample, there may be a few issues going on. But I'll tackle the first problem here.

                                  Your sample seems to work depending on the intended functionality .

                                  I modified your 2 test functions to return two different strings (the names of the DLLs)
                                  Then added 2 labels to the report and assigned each label Text value to a result of the test function from each DLL.
                                  This worked great and each label displayed the correct text "MyDLL1" & "MyDLL2"

                                  It appears I have access to "any" DLL if they are in the using clause, until I set the report property "ScriptReferencesString" to the path of MyDLL2, then I can ONLY see MyDLL2. Attempting to use MyDLL1 blows an error.

                                  Is this intended functionality?
                                  Should I be able to reference any DLL, unless I specifically limit which DLLs I can use by setting the "ScriptReferencesString" property?

                                • Hi Darren,

                                  >>It appears I have access to "any" DLL if they are in the using clause, until I set the report property "ScriptReferencesString" to the path of MyDLL2, then I can ONLY see MyDLL2.
                                  I have tested my sample project, and neither MyDLL1 nor MyDLL2 assemblies content is accessible in the XtraReports scripts when the XtraReport.ScriptReferences property value is empty (see the attached video).

                                  >>Should I be able to reference any DLL, unless I specifically limit which DLLs I can use by setting the "ScriptReferencesString" property?
                                  You need to add all required assemblies to the XtraReport.ScriptReferences property to make your report work correctly. Those assemblies that are not referenced by the ScriptReferences property should not be accessible in your scripts. Please refer to the Scripting Overview => Scripting Options help topic for more information regarding this.

                                • Darren Flynn 1 11.07.2013

                                  That does not make sense, the Test() methods from MyDLL1 & MyDLL2 in your first sample project worked fine without specifing the ScriptReferences property.

                                  You stated you could not reproduce the problem, and provided a working example.
                                  I placed 2 labels on the report, added a string return value to your 2 methods, and was able to assign the 2 label Text values using the Test() methods from both DLLs.

                                  So I'm confused by your statement based on the sample project you provided:
                                  "You need to add all required assemblies to the XtraReport.ScriptReferences property to make your report work correctly."

                                • Hi Darren,

                                  >>the Test() methods from MyDLL1 & MyDLL2 in your first sample project worked fine without specifing the ScriptReferences property.
                                  Please refer to the video attached to my previous comment. As you can see, runtime errors are thrown on my side when I am trying to access the MyDLL1 and MyDLL2 methods when the ScriptReferences property value is empty.

                                  >>I placed 2 labels on the report, added a string return value to your 2 methods, and was able to assign the 2 label Text values using the Test() methods from both DLLs.
                                  Would you send us the current version of your sample, to test it on our side?

                                • Darren Flynn 1 11.07.2013

                                  Attached is an updated verion of your original example project.
                                  The methods in the 2 DLLs you created have been changed to return a string (stating the DLL name)
                                  These where then used to assign the text of 2 labels I placed on the report.
                                  Hopefully you will see as I do, that both functions work and text is assigned to both labels, when the ScriptReferencesString property is commented out.

                                • Darren Flynn 1 11.07.2013

                                  OK my bad, I missed the part where the DLL names were hardcoded in the report ScriptReferences at design time.
                                  I appreciate the feedback, I will continue with more testing.
                                  Thanks

                                • Hi Darren,

                                  I am looking forward to your response.      Please let us know if you need any further assistance.

                                You must  log in  or  register  to leave comments

                                To start a chat you should create a support ticket


                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners