EUD Script Editor Feature Requests

Posted by: hasaki on 14 September 2017, 6:26 pm EST

  • Posted 14 September 2017, 6:26 pm EST

    [activereports_archive]Hi,







    After spending the last few weeks working with RPX reports and heavy use of the script editor I have built-up a list requests that would make life easier for those who are doing the same.







    1) Support for displaying intellisense for “custom” assemblies. It would be nice if the script editor would expose the content of assemblies that have been referenced via SectionReport.AddAssembly or the PageReport.Report.CodeModules method/collection. Barring that, having the ability to tell the designer what assemblies I want the script editor to work with would be awesome too.







    1a) A bug, IMO: Intellisense doesn’t display any members for the Chart assembly, which makes working with charts through script a huge PITA. I know the chart assembly isn’t required to be deployed and is probably why it was excluded by default; but you could try doing a conditional load of the assembly and if it succeeds tell the script editor to make its contents available for intellisense.







    2) Support for displaying Extension methods in the editor’s intellisense. I’m making heavy use of extension methods to make it easier for our eventual non-developer power users to do things like use the Windows Forms Chart control (since it supports Radar graphs and the built-in SectionReport chart does not).







    3) Support for var. While it highlights the var keyword, the editor has no clue what type is being referenced and so intellisense doesn’t display when using a var’d variable.







    4) Support for object initializers. The script editor currently “red squiggles” the use of object initializers, though the code works just fine.







    Thanks,







    James[/activereports_archive]

  • Posted 14 September 2017, 6:26 pm EST

    [activereports_archive]Hello,



    Apologies for the delay in response. And thank you for your valuable suggestions and feedback.



    Regarding your requests :



    > Support for displaying intellisense for “custom” assemblies. It would be nice if the script editor would expose the content of assemblies that have been referenced via SectionReport.AddAssembly or the PageReport.Report.CodeModules method/collection. Barring that, having the ability to tell the designer what assemblies I want the script editor to work with would be awesome too.

    Please note that one need to make use of the AddScriptReference to add the assemblies to the script. For further clarification, please follow the under-mentioned link :

    reference to the specified assembly to be loaded into the scripting run-time context.

            <br><br>Also, could you please clarify if you are referring to .Net assemblies or any third party assemblies.<br>In order to access the .Net assemblies, you just need to add the using/imports statement with the name of the respective assembly.<br>For eg, you may add 'Using System.Windows.Forms;' for accessing MessageBox in the script editor<br><br>And in case you are referring to the third party control, then we regret to mention that the same are not supported as of now.<br><br><b><i>&gt; A bug, IMO: Intellisense doesn't display any members for the Chart assembly, which makes working with charts through script a huge PITA. I know the chart assembly isn't required to be deployed and is probably why it was excluded by default; but you could try doing a conditional load of the assembly and if it succeeds tell the script editor to make its contents available for intellisense. </i></b><br>It has been escalated as an enhancement request to the concerned team. The feature might/might not be added in one of the future builds of AR. The reference number to track this request is : 170310<br><br><b><i>&gt; Support for var. While it highlights the var keyword, the editor has no clue what type is being referenced and so intellisense doesn't display when using a var'd variable. </i></b><br>This too has been escalated as an enhancement request and the tracking number for the same is : 170309<br><br><i><b>&gt; Support for displaying Extension methods in the editor's intellisense. I'm making heavy use of extension methods to make it easier for our eventual non-developer power users to do things like use the Windows Forms Chart control (since it supports Radar graphs and the built-in SectionReport chart does not). </b><br></i>and<i><br><b>&gt;Support for object initializers. The script editor currently "red squiggles" the use of object initializers, though the code works just fine. </b></i><b><br></b><br>We are not sure how exactly are you using the object initializers and the extension methods in your application/report. Could you please share a sample application or the report file with us that shows the issue faced by you or the results expected at your end.<br><br>Regards,<br>Mohita[/activereports_archive]
    
  • Posted 14 September 2017, 6:26 pm EST

    [activereports_archive]Hi Mohita,







    Re: Intellisense for custom assemblies.







    AddScriptReference doesn’t exist for PageReports so that part is still missing. Also, it is needed for both .NET assemblies as well as custom ones. For example; the built-in chart doesn’t offer a Radar/Spider chart, so to offer that capability to our users I add a custom toolbox item and then make sure to use use AddAssembly to make the System.Windows.Forms.DataVisualization.Chart available at runtime.







    My designer application generates a custom script section for each SectionReport created which automatically adds several using/imports statements so that isn’t an issue for my users (as you’ll see below).







    I’ll be sure to try using AddScriptReference when I get a chance to see if that helps for our Section-based reports. As I mentioned though; this method isn’t available to PageReports. The designer already has the CodeModules collection available to it for PageReports, so I don’t think we need yet another API added; just use the info already in the report to make intellisense available automatically.







    Re: Object Initializers







    Those are both features available in C# 4 (or whatever they call the one that shipped with VS2008). In my case I was using object initializers to do code similar to the following:







    var mylist = new List() { “a”, “b”, “c” };







    I might have had some that used the property setter notation in a constructor as well but that report’s structure has changed so the code is no longer in my report.







    Re: Extension methods







    I’ve created extension methods in my own custom assemblies that are referenced by my SectionReports that make some short cuts possible to users. As I mentioned already, we use the .NET Chart to handle radar/spider graphs so two extension methods I created was to simplify that process (both SetupRadarGraph and CreateRadarSeries are extension methods).







    // BEGIN AUTOGENERATED CODE



    // DO NOT REMOVE OR MODIFY



    using MyCompany.Reports.Extensibility;



    // END AUTOGENERATED CODE







    public void ActiveReport_ReportStart()



    {



    var chart = (System.Windows.Forms.DataVisualization.Chart) CustomControl1.Control;



    chart.SetupRadarGraph();



    var series = chart.CreateRadarSeries();







    series.XValueType = ChartValueType.String;



    series.XValueMember = “Item1”;



    series.YValueType = ChartValueType.Double;



    series.YValueMembers = “Item2”;



    }







    Another set of extension methods I created was to format chart axis, since our data deals with numbers that are often 10^-5 or smaller the auto-settings for chart min, max, and step don’t work for us:







    public void ActiveReport_DataInitialize()



    {



    // code to connect the chart to data



    // Extension methods implements algorithm here:



    // http://www.esurient-systems.ca/2011/03/algorithm-for-optimal-scaling-on-chart_8199.html



    ChartControl1.SetupSmartRange(ChartControl1.ChartAreas[0].Axes[2], minValue, maxValue, idealNumTicks);



    }







    Let me know if there is anything more you need.







    Cheers,







    James[/activereports_archive]

  • Posted 14 September 2017, 6:26 pm EST

    [activereports_archive]Hello,







    Apologies for the delay and thank you for sharing the required information with us. We really appreciate your co-operation.







    Re: Intellisense for custom assemblies.



    The issue has been escalated as an enhancement. And the tracking id for the same is : 170476







    Re: Extension methods



    This too has been escalated as an enhancement and the tracking id for this is : 170477







    Re: Object Initializers



    I could replicate this behavior and have forwarded the request to add the support for Object Initializer in the script editor. The request id for this is : 170478.







    We will update you as soon we have any information regarding any of the posted issues.







    Regards,



    Mohita



    [/activereports_archive]

  • Posted 18 June 2018, 2:51 pm EST

    Hello

    Is there any way to check the statuses of these enhancements? Especially 170476?

    Thanks

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels