This is a migrated thread and some comments may be shown as answers.

Custom Report Parameter Interface

6 Answers 211 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michael Love
Top achievements
Rank 1
Michael Love asked on 02 Feb 2010, 09:48 PM
Hi there.

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

Sort by
0
Steve
Top achievements
Rank 2
Veteran
answered on 02 Feb 2010, 11:14 PM
I put in a ticket about this a long time ago...you'll get way more flexibility doing up your own custom page...takes more time, but WAY worth it once it's done.  I just use the built in one mostly for debugging...
0
Michael Love
Top achievements
Rank 1
answered on 15 Feb 2010, 11:23 PM
Hey Steve.

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

 

0
Steve
Top achievements
Rank 2
Veteran
answered on 15 Feb 2010, 11:35 PM
We have DB tables to create them dynamically here...

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
0
Michael Love
Top achievements
Rank 1
answered on 15 Feb 2010, 11:42 PM
Thanks for the reply Steve.

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
0
Michael Love
Top achievements
Rank 1
answered on 12 Mar 2010, 09:12 PM
Hey Steve.

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
0
Steve
Top achievements
Rank 2
Veteran
answered on 12 Mar 2010, 09:15 PM
No sorry...I've installed it on Dev, haven't fired up any reports yet though to take a look, still getting OpenAccess to work, then I'll move to Ajax then Reporting
Tags
General Discussions
Asked by
Michael Love
Top achievements
Rank 1
Answers by
Steve
Top achievements
Rank 2
Veteran
Michael Love
Top achievements
Rank 1
Share this question
or