Designer configure
Gonzalo
Madrid
Hi!
I am using FastReport.Net and I am trying to integrate in my application the whole tool.
I want that my program manages the edition of reports using the FastReport Designer, for it I execute it using the instruction:
Report1. Design (this); // modal
I Want that on having executed the designer in my application it appears always the same data connection provided by my source code.
The user will not be able to configure (or create) a new data connection and only it will be able to use provided previously by my source code, even when the user is going to create a new report.
How can I do it?
Thank you.
I am using FastReport.Net and I am trying to integrate in my application the whole tool.
I want that my program manages the edition of reports using the FastReport Designer, for it I execute it using the instruction:
Report1. Design (this); // modal
I Want that on having executed the designer in my application it appears always the same data connection provided by my source code.
The user will not be able to configure (or create) a new data connection and only it will be able to use provided previously by my source code, even when the user is going to create a new report.
How can I do it?
Thank you.
Comments
By creating the dataset in (.xsd file ) in .net. you can add this dataset as a datasource for your report. use this code to generate the design with userdefined dataset.
#region generate .frx
protected void Button1_Click(object sender, EventArgs e)
{
Thread th = new Thread(DesignReport);
th.SetApartmentState(ApartmentState.STA);
th.Start();
}
private void DesignReport()
{
Report report = new Report();
// create the DataSet instance
orgSummary ds = new orgSummary();
Parameter ps = new Parameter();
// register it in a report
report.RegisterData(ds);
report.RegisterData(ps);
// run the designer
report.Design();
// dispose a report
report.Dispose();
}
#endregion
You need to use the ApplicationConnection property as discussed here:
http://www.fast-report.com/en/forum/?p=/discussion/5966
I will use Config.DesignerSettings.ApplicationConnection property. It is just with what I need.
Regards.