Unable to cast object of type 'System.Int32' to type 'System.Nullable`1[System.Int64]'. SearchPanes

Unable to cast object of type 'System.Int32' to type 'System.Nullable`1[System.Int64]'. SearchPanes

sarooptrivedisarooptrivedi Posts: 62Questions: 19Answers: 2
edited June 25 in Free community support

This is reference questions :https://datatables.net/forums/discussion/76041

This is looks like bug when I am enabling the ViewTotal=true then datatables.net **server-side code **throw the below error . I am using Datatables-Editor-Server library version 2.2.2 (.Net)

Unable to cast object of type 'System.Int32' to type 'System.Nullable`1[System.Int64]'.

buttons: [
    {
        extend: 'searchPanes',  

        config: {
            cascadePanes: true,
            delayInit: false,
            viewTotal: true,
            //i18n: {                      
            //    count: '{total}',
            //    countFiltered: '{shown} ({total})'
            //},
            layout: 'columns-3',
                preSelect: [
                    {
                        column: 7,
                        rows: [(new Date().getFullYear()-1).toString()]
                    }
                ],
        }
    },
]

Answers

  • sarooptrivedisarooptrivedi Posts: 62Questions: 19Answers: 2

    Server Side Code. It is working perfectly until I add the viewTotal=true in Jquery side

     var response = new Editor(db, TblNames.Test, "Id")
                 .ReadTable(TblNames.V_Test)
                 .Field(new Field("Id"))
                 .Field(new Field("AreaId"))
                 .Field(new Field("Area"))
                 .Field(new Field("SiteId"))
                 .Field(new Field("Site"))
                 .Field(new Field("EntryNum"))
                 .Field(new Field("EntryDate").Validator(Validation.DateFormat("yyyy-MM-dd")).SetFormatter(Format.NullEmpty()).GetFormatter(Format.DateSqlToFormat("yyyy-MM-dd")).SetFormatter(Format.DateFormatToSql("yyyy-MM-dd")))
                 .Field(new Field("Year").SearchPaneOptions(new SearchPaneOptions().Table(TblNames.V_RadConLogEntry).Value("YEAR").Label("YEAR").Where(q => q.Where("SiteId",  "(1,2,3)", "IN", false))))
    
                 .Where(q => q.Where("SiteId", "(1,2,3)", "IN", false))
                 .TryCatch(true).Debug(true)
                 .Process(httpRequest).Data();
    
  • allanallan Posts: 63,439Questions: 1Answers: 10,459 Site admin

    Many thanks for letting me know about this. I'll dig into it, but I fear it might be a couple of weeks before I can do so due to other commitments. I've got a note of it in my issue tracker and will post back when I have had a chance to look at it.

    Allan

Sign In or Register to comment.