error in FilterControl: the data contract type "lightswitchfilter.Client.FilterControls.Clause" cannot be serialized because the member "_clauseType" is not public.

Proposed error in FilterControl: the data contract type "lightswitchfilter.Client.FilterControls.Clause" cannot be serialized because the member "_clauseType" is not public.

  • sexta-feira, 14 de outubro de 2011 11:59
     
     

    While saving the report I get this error. Any ideas?

Todas as Respostas

  • sábado, 15 de outubro de 2011 05:35
     
     

    Is that my sample from: Using The LightSwitch Filter Extension ?

    If so, does it give you an error by just running it? I just did a test on a new computer and downloaded the filter extension from:

    http://code.msdn.microsoft.com/Filter-Control-for-Visual-90fb8e93

    I notice that it does not have the Save report feature like your screen shot. Perhaps it was updated since you last downloaded it?

     


    Make Them Ask: That's a LightSwitch App?

    http://LightSwitchHelpWebsite.com


  • terça-feira, 18 de outubro de 2011 09:02
     
     

    Hello, It is indeed the extension downloaded from http://code.msdn.microsoft.com/Filter-Control-for-Visual-90fb8e93

    I tested again on a new computer last week so the version is the same

    In order to see the save button, you should check the "Display report save options" (see below)

    is the same. Thanks in advance

    jan

  • segunda-feira, 31 de outubro de 2011 02:41
     
     

    Same error for me. Filtering works fine but when I click the [Save...] button I get the '_clauseType' is not public message.

    Interestingly enough the feature works OK even after the error mesage!!! If I select from the drop-down of 'Existing Reports' my newly created filter is returned and it works as expected :-)

     

    Is it just me or is the term 'Report' in this context confusing? Why not Save 'Filter' and select an 'Existing Filter'?

     

    BTW I'm running against a single SQL table filtered down to just active records on local named instance of SQLEXPRESS using SQL authentication.

     

    BTW nice job on the Custom Filter. Much appreciated.


    Z A R D O Z
  • quarta-feira, 23 de novembro de 2011 13:18
     
     Resposta Proposta

    You should open the solution of the filter control wich came with the download.

    • Open the following file: LightSwitchFilter.Client=>LightSwitchFilterControls=>Clause.vb.
    • Search for the member _clauseType (line 47 in my case). The problem is the line above where the datamember attribute is declared. This attribute needs to be declared before the public property ClauseType and is not needed for the private member _clauseType.
    • Cut the line (46 in my case) and paste it before the public property.
    • Build the solution (release configuration in my case)
    • Grab the .vsix from the output directory of the LightSwitchFilter.Vsix project and save it somewhere convenient.
    • Uninstall the filter control and restart visual studio.
    • Run the new .vsix file

    Everything should be working ok now.

    • Sugerido como Resposta Dytiscus_ quinta-feira, 24 de novembro de 2011 08:21
    •  
  • quarta-feira, 23 de novembro de 2011 21:14
     
     

    That error is the same one I reported a few weeks back (ZARDOZ below). I wasn't even the first to report the error so it does seem to be a bug. My version was the latest and it occurs when to try to save a report. Another quirk I've noticed is that sometimes the Save Report line completely disappears (as in the screen shot). I haven't figured out a consistent pattern but these two bugs mean that the control could not, in it's current form, be included in an application release. The ugly error message for one but because it's flakey too.

    I'd really appreciate a bug-fix or a suggestion on what might be causing the random behvour because it's a control that I really love and want to use.


    Z A R D O Z
  • quarta-feira, 23 de novembro de 2011 21:50
     
     

    You should open the solution of the filter control wich came with the download.

    • Open the following file: LightSwitchFilter.Client=>LightSwitchFilterControls=>Clause.vb.
    • Search for the member _clauseType (line 47 in my case). The problem is the line above where the datamember attribute is declared. This attribute needs to be declared before the public property ClauseType and is not needed for the private member _clauseType.
    • Cut the line (46 in my case) and paste it before the public property.
    • Build the solution (release configuration in my case)
    • Grab the .vsix from the output directory of the LightSwitchFilter.Vsix project and save it somewhere convenient.
    • Uninstall the filter control and restart visual studio.
    • Run the new .vsix file

    Everything should be working ok now.


    Brilliant. Thank you very much. By following your steps above I fixed the bug and the 'Report' now saves without the ugly error message. Well done. Maybe this will also fix the random loss of that whole Report List line from the control. Time will tell.

    I'm still not quite sure why you call a 'Filter' a 'Report' though. When I've written the logic for a user Custom Filter I would say 'Save Filter Group' or 'Save Custom Filter'. A 'Report' here in NZ (and Australia too because I mentioned this to Andrew Coates from MS-AUS last week) has a different meaning which is a formatted display capable of rendering on a printer. IOW more than just a filtered grid. Perhaps someone could explain why the label is 'Existing Report' and you Save a 'Report Name'. Great if you could save the Filter and use it to run a custom report but that's not what's happening here IMO.


    Z A R D O Z
  • sexta-feira, 24 de fevereiro de 2012 18:24
     
     

    I have downloaded the latest version dated 2/23/2012 and I am still getting the same error.

    Even when I deselect the 'show save' option it still shows up.

    There appears to be an issue with the resource file as it displays as $(ShowSaveOptionsDisplayName) in the properties.

    yes it does save the query but only 1 query gets saved should it be able to save more than 1, the dropdownlist implies this.

  • sexta-feira, 24 de fevereiro de 2012 18:34
     
     
    • Run the new .vsix file

    Everything should be working ok now.

     Any chance you can share your working version?
  • segunda-feira, 12 de março de 2012 21:03
     
     

    The version dated 2/28/2012 has the same problem, both with the option not working and with saving the report.

  • terça-feira, 3 de julho de 2012 22:04
     
     

    Hi!

    I hace some problem, what's exactly i need to change?

    #Region
    "Shared Properties"
    'Potentially null for first item in tree
        <DataMember()> _
    Public Property Parent As Clause
        <DataMember()> _
    Private _clauseType As String

    Anythung here?

  • sexta-feira, 7 de setembro de 2012 15:02
     
      Contém Código

    Just replace last line with:

    Public _clauseType As String
        Public Property ClauseType As String



    PBerumen


    • Editado PBerumen sexta-feira, 7 de setembro de 2012 15:03
    •