Global Using directives in report

Stimulsoft Reports.NET discussion
Post Reply
Andreas Tastler
Posts: 63
Joined: Fri Jul 17, 2009 5:00 am
Location: St. Gallen, Switzerland

Global Using directives in report

Post by Andreas Tastler »

Hi All

I add a common used assembly to the AssemblyReferences list each time a report will be loaded by our application.
For easy coding, I want to add a global using directive to the report. Can this be done by code?
I found a element in the mrt file. Adding the using directive to that code will help but I want to do that from code and I think this is not a good solution because the code is generated.

Code: Select all

using System;
using System.Drawing;
using System.Windows.Forms;
using System.Data;
using Stimulsoft.Controls;
using Stimulsoft.Base.Drawing;
using Stimulsoft.Report;
using Stimulsoft.Report.Dialogs;
using Stimulsoft.Report.Components;

namespace Reports
{
    
    public class Report : Stimulsoft.Report.StiReport
    {
        
        public Report()
        {
            this.InitializeComponent();
        }
        #region StiReport Designer generated code - do not modify#endregion StiReport Designer generated code - do not modify
    }
}
Thanks in advance

Kind Regards
Andreas

Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Global Using directives in report

Post by Jan »

Hello Andreas,

You can change default list of referenced assemblies with help of following static option:

Code: Select all

StiOptions.Engine.ReferencedAssemblies
for namespaces:

Code: Select all

StiOptions.Engine.Namespaces
This settings is apply to all new reports. You need use Script property to change namespaces in existing reports.

Thank you.
Post Reply