0

I have a web service which I consume in a C# application. To be able to view child properties inside the class I defined a partial class like this:

public class Client{
   public int Id {get; set;}
   public int Name {get; set;}
   ...
]
public partial class ClientDiagnose{ /* this class is auto-generated from service */
   public Client client{get; set;}
   ... 
}
public partial class ClientDiagnose{
   public int ClientId {
      get { return client.Id; }
   }
   public string ClientName {
      get { return client.Name; }
   }
}

When I added a business object (ClientDiagnose) as a datasource to rdlc report, it shows only the properties generated from service, and didn't show ClientId or ClientName.

What am I doing wrong? What is missing?

Jeffrey Bosboom
  • 13,313
  • 16
  • 79
  • 92
user3222589
  • 184
  • 1
  • 13

2 Answers2

0

Rebuild the solution and try again. If possible, delete the RDLC report, rebuild the solution and create the RDLC report again.

Raja Nadar
  • 9,409
  • 2
  • 32
  • 41
0

Wow this is old. I have found the same behavior so if anyone has a real solution I'd love to see it.

You can add the extended properties manually after adding the dataset. Open the RDLC report with an XML editor and locate the DataSet. Manually add the Fields.

    <Field Name="ClientId">
      <DataField>ClientId</DataField>
      <rd:TypeName>System.Int32</rd:TypeName>
    </Field>
    <Field Name="ClientName">
      <DataField>ClientName</DataField>
      <rd:TypeName>System.String</rd:TypeName>
    </Field>

Save the file, and reopen in the designer. You can now use the additional fields and they behave as you would expect on a local report. If you refresh the dataset then these fields will be lost. You'll need to re-add them manually.

NRiding
  • 301
  • 1
  • 5