Section Report Custom Assembly

Posted by: dklingman on 6 October 2019, 11:47 pm EST

  • Posted 6 October 2019, 11:47 pm EST

    I've created a custom assembly that has been signed and even added to the GAC. Yet when I try and use it in a Section report I get the error that the assembly cannot be found.

    GrapeCity.ActiveReports.ReportScriptException: Report Script Compile Error on line 2:
    The type or namespace name 'SectionReportControlAlignment' could not be found (are you missing a using directive or an assembly reference?)
  • Replied 8 October 2019, 5:10 pm EST

    Hello Derek,

    Have you add the dll in your report object to gain access to namespaces like as follow:

    private void runReport() 
    {
    YourReportName rpt = new YourReportName;
    rpt.AddScriptReference("System.Data.dll");
    rpt.Run();
    }


    For more information, you can refer to the topic "To access namespaces" in the following documentation link:
    https://help.grapecity.com/activereports/webhelp/AR13/webframe.html#UsingScriptinaSectionReport.html

    Also, if you need to use the designer, you can refer the solution in the following forum post:
    https://www.grapecity.com/forums/ar-dev/using-script-references-an

    I am assuming that this query is not related to AR Server, if my assumption is wrong, could you please tell me which report type are you using (Code based/ Xml based)

    Thanks,
    Mohit
  • Replied 8 October 2019, 10:59 pm EST

    Mohit,

    The report will end up on AR server in the end, but right now I'm trying to run in locally with the end designer. Currently, it's a code based report that's being converted over to an XML based report, since other developers may need to work on the report in the future and we only have 3 pro licenses.

    In any case I have the following in the script just to start with in order to figure out how to get the assembly referenced. Again keep in mind it's a code base report that's being moved over to XML based, and the code based works fine.



    const string SPROC = "rpt_usp_109X_TaxForm";

    DataTable TaxData;
    int RowCounter;
    System.Data.SqlClient.SqlConnectionStringBuilder ConnStr;

    public void ActiveReport_ReportStart()
    {
    rpt.AddScriptReference("SectionReportControlAlignment.dll");
    SectionReportControlAlignment.MicroAlignment AligmentSettings;
    }


  • Marked as Answer

    Replied 8 October 2019, 11:18 pm EST

    Hello Derek,

    From this, I understand that the issue is only reproducible with the RPX type report. For RPX report, you need to add the script reference before loading to designer or viewer as mentioned in the following case:
    https://www.grapecity.com/forums/ar-dev/using-script-references-an

    Please feel free to revert back if you still face any issue with this.

    Thanks,
    Mohit
Need extra support?

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

Learn More

Forum Channels