Question

We have a report designer project which uses Active Reports. We want to use SubReport tool of the Active Reports. Subreport control has a "report" property which fills the ActiveReport content of the Subreport. Since we have a designer project and a SubReport tool, I want to add a property to the SubReport control which opens a new form that enables user to choose a report from the list and load report into the SubReport control.

So how can I add a property to a control which opens a new windows form?

Here is how I set the properties:

public class SubReportProp
{
    private DataDynamics.ActiveReports.SubReport _SubReport;

    public SubReportProp(DataDynamics.ActiveReports.SubReport subReport, List<string> fieldCollection)
    {
        this._SubReport = subReport;

        if (fieldCollection != null && fieldCollection.Count > 0)
        {
            FieldVars._DataFields = fieldCollection;
        }
    }

    [DisplayName("X")]
    [Description("Kontrolün yatay konumunu getirir veya ayarlar.")]
    [Category("Konum")]
    public float X
    {
        get
        {
            return SharedProp.TrimFloatValue(ActiveReport.InchToCm(_SubReport.Location.X));
        }
        set
        {
            _SubReport.Location = new PointF(ActiveReport.CmToInch(value), _SubReport.Location.Y);
        }
    }

    [DisplayName("Y")]
    [Description("Kontrolün dikey konumunu getirir veya ayarlar.")]
    [Category("Konum")]
    public float Y
    {
        get
        {
            return SharedProp.TrimFloatValue(ActiveReport.InchToCm(_SubReport.Location.Y));
        }
        set
        {
            _SubReport.Location = new PointF(_SubReport.Location.X, ActiveReport.CmToInch(value));
        }
    }
}

Like these x, y coordinates I also need to add another property which enables user to choose a report from a list and apply to _SubReport.Report

Was it helpful?

Solution

http://blogs.gcpowertools.co.in/2011/11/showcase-enhance-end-user-designer.html#more

I think you should have a look at this blog . It does exactly what you want.

OTHER TIPS

kubilay

Report layout can be saved to stream. You can save this to the database as a blob/byte array. You can also save the report in its xml format as text, if possible. This is accomplished using the ActiveReport's SaveLayout API.

LoadLayout API can then be used to load this report back.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top