
I have a requirement to create a parameter interface that fits better with the look and feel of our application. We have several reports that have parameters that are lengthy string values and when you have a few of those on a report, the parameters don't look very good on top of the viewer. So, with that in mind, can you control the look/positioning of the parameters or is it best to just create another parameter aspx page that then kicks off the viewer and handles the parameters dynamically? Thoughts?
Mike
6 Answers, 1 is accepted


I am in the process of working on dynamically creating parameters per your suggestion and I am struggling a bit with the dynamic aspect of the data sources for each of the parameters. For example, based on the selected report, I will have different parameters.
I have create a report parameter base class and a report specific parameters class to help with this.
public class ReportParameter
{
public string Name { get; set; }
public string DataSource { get; set; }
public string ValueMember { get; set; }
public string DisplayMember { get; set; }
public Telerik.Reporting.ReportParameterType ParameterType { get; set; }
public bool MultiValue { get; set; }
public bool Visible { get; set; }
public ReportParameterControlType ControlType { get; set; }
}
public class Report1_ReportParameters
{
public List<ReportParameter> rpReportParameters { get; set; }
public Report1_ReportParameters()
{
rpReportParameters =
new List<ReportParameter>();
ReportParameter rpPerson = new ReportParameter();
rpPerson.Name =
"Person";
rpPerson.MultiValue =
true;
rpPerson.ValueMember =
"PersonContactInfoId";
rpPerson.DisplayMember =
"Name";
rpPerson.Visible =
true;
rpPerson.ControlType =
ReportParameterControlType.MultiSelect;
rpPerson.DataSource =
"BLPerson.SelectPossibleContactsByCompany";
rpReportParameters.Add(rpPerson);
ReportParameter rpCreatedBy = new ReportParameter();
rpCreatedBy.Name =
"CreatedBy";
rpCreatedBy.MultiValue =
false;
rpReportParameters.Add(rpCreatedBy);
}
}
public class Report2_ReportParameters
...
My initial thought was to create a delegate that would set the datasource for each parameter as needed. Did you run into this and if so, how did you deal with it?
Thanks, Mike

Tables:
1) Stores the reports
2) Stores the parameters (type to render, ie text or dropdown, etc...)
3) Link Table to add X parameter to X report
4) Value table to add in items to the parameter selectors
The parameter interface just loops through the link table and creates the controls based on their type, then adds in the values they need from the value table.
So we can add\remove parameters or values with a quick DB change

I guess my situation is a bit different. The items that appear in my list are totally dependent on who the user is and what permissions/relationships they have etc. So, we have a business logic layer where we have the methods to get data for the data sources. So, I think I am going to proceed down the delegate path. I will let you know what I come up with.
Thanks again, Mike

Did you upgrade to Q1 2010 yet? I just did and I am having issues with multivalue parameters that I create programmatically. Have you seen this?
Mike
