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

Report Paramter Problems with enum

5 Answers 285 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 07 Jun 2019, 02:37 PM

 

Hello,

as you can see in the attached files the Displaymember is set to "= Fields.OperationalVType" .

But nothing will appear when I call my report.

The report parameter "Vorgangstyp" is empty.

OperationalVType is from type enum.

 

public enum OperationalVehicleType
       {
           Waschen = 1,
           Hauptuntersuchung = 2,
           Werkstatt = 3,
           Tanken = 4,
           Kilometerstand = 5,
           Abgasuntersuchung = 6
       }
 
       public OperationalVehicleType OperationalVType {get;set;}

 

What is going wrong?

 

Best Regards

 

Simon

5 Answers, 1 is accepted

Sort by
0
Simon
Top achievements
Rank 1
answered on 07 Jun 2019, 02:40 PM
I have forgotten something:
0
Todor
Telerik team
answered on 12 Jun 2019, 11:26 AM
Hello Simon,

I have attached a sample report demonstrating how you may use Enum types in ObjectDataSource utilized in Report Parameter AvailableValues property. You need to build the project before previewing the report.

Regards,
Todor
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Simon
Top achievements
Rank 1
answered on 13 Jun 2019, 09:12 AM

Hello Todor,

I installed it in my project and it works.

Thank you!

But I have another problem:

Before, as I had only 3 filters in the report 3 records would be displayed.(See 3-filters.jpg)

So far so good.

And now I have installed the fourth filter named "Vorgangstyp" from the enum and I get a NoDatamessage "Es gibt keine Daten zum anzeigen" (On english: "There is no data to display"). (See 4-filters.jpg)

But there must be datas to display - just less records!

Perhaps I have a syntaxerror in the table filter property. (See filter.jpg)

Or have I configured anything wrong?

 

 

0
Simon
Top achievements
Rank 1
answered on 14 Jun 2019, 09:23 AM

Hi Todor,
I don't know exactly why, but now it works.
I try around and added a toString()-method and then the fourth filter works without error messages.

Code in the filter property of the table:

= Fields.OperationalVType.toString() In = Parameters.Vorgangstyp.Value

 

Perhaps it gives another solution?

But it's ok.

 

Best regards

Simon

0
Accepted
Todor
Telerik team
answered on 18 Jun 2019, 07:10 AM
Hi Simon,

The OperationalVType field is an enum (in my example it is of OperationalVehicleType). Therefore, it is necessary to convert it in order to compare it with a string value. I think the solution you have found is a good one.

Regards,
Todor
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Simon
Top achievements
Rank 1
Answers by
Simon
Top achievements
Rank 1
Todor
Telerik team
Share this question
or