Report Paramter Problems with enum

6 posts, 1 answers
  1. Simon
    Simon avatar
    47 posts
    Member since:
    Sep 2018

    Posted 07 Jun Link to this post

     

    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

  2. Simon
    Simon avatar
    47 posts
    Member since:
    Sep 2018

    Posted 07 Jun Link to this post

    I have forgotten something:
  3. Todor
    Admin
    Todor avatar
    310 posts

    Posted 12 Jun Link to this post

    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
  4. Simon
    Simon avatar
    47 posts
    Member since:
    Sep 2018

    Posted 13 Jun Link to this post

    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?

     

     

  5. Simon
    Simon avatar
    47 posts
    Member since:
    Sep 2018

    Posted 14 Jun Link to this post

    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

  6. Answer
    Todor
    Admin
    Todor avatar
    310 posts

    Posted 18 Jun Link to this post

    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
Back to Top