Nester ilist in a class

Hi,
I'm currently in the process of evaluation your reporting solution.
Here are the classes I'm using to test:
public class Address
{
	public Address(
		string street,
		string city,
		string province,
		string postalCode)
	{
		Street = street;
		City = city;
		Province = province;
		PostalCode = postalCode;
	}

	public string Street { get; set; }

	public string City { get; set; }

	public string Province { get; set; }

	public string PostalCode { get; set; }
}

public class PhoneNumber
{
	public PhoneNumber(
		int areaCode,
		int number)
	{
		AreaCode = areaCode;
		Number = number;
	}

	public int AreaCode { get; set; }

	public int Number { get; set; }
}

public class Patient
{
	public Patient(
		Address address,
		List<PhoneNumber> phoneNumbers)
	{
		Address = address;
		PhoneNumbers = phoneNumbers;
	}

	public Address Address { get; set; }

	public List<PhoneNumber> PhoneNumbers { get; set; }
}
I'm try to achieve the following behavior:

Let' say i have 3 patients and each patients have 3 phone numbers.
I want to be able to list the patient's address followed by all their phone numbers like this:

[Patient.Address.Street]
[Patient.PhoneNumbers.AreaCode] [Patient.PhoneNumbers.Number]
[Patient.PhoneNumbers.AreaCode] [Patient.PhoneNumbers.Number]
[Patient.PhoneNumbers.AreaCode] [Patient.PhoneNumbers.Number]
[Patient.Address.Street]
[Patient.PhoneNumbers.AreaCode] [Patient.PhoneNumbers.Number]
[Patient.PhoneNumbers.AreaCode] [Patient.PhoneNumbers.Number]
[Patient.PhoneNumbers.AreaCode] [Patient.PhoneNumbers.Number]
[Patient.Address.Street]
[Patient.PhoneNumbers.AreaCode] [Patient.PhoneNumbers.Number]
[Patient.PhoneNumbers.AreaCode] [Patient.PhoneNumbers.Number]
[Patient.PhoneNumbers.AreaCode] [Patient.PhoneNumbers.Number]

My problem is show the phone numbers.
Everything has to be done by code.
I've manage using your demos to list all the patient addresses but the nested list is giving me trouble.

Can you help me?

Best regards
Nicolas

Comments

  • edited 2:51PM
    I don't use C++ so my test is in Pascal Script. But I think you'll be able to convert it easily.
    Some FR code is to manipulate bands: MasterData and DetailData.
    procedure MasterData2OnAfterPrint(Sender: TfrxComponent);
    var Pa,ph: int;
    begin
       for Pa:=1 to 3 do begin
        Memo3.Text := 'Patient ' + IntToStr( Pa);                                                                                                                      
        Engine.ShowBand( MasterData1);    
        for ph:=1 to 3 do begin
          Memo2.Text := 'phone ' + IntToStr( ph);                                                                                                                      
          Engine.ShowBand( DetailData1);
        end;                
      end;  
    end;
    

    I attach an example and final result.

    Mick
  • edited 2:51PM
    Hi,

    I can't seem to find the Engine object.

    i have the Engine namespace with a ReportEngine class, but ReportEngine has no method available.

    Best regards,
    Nicolas
  • edited 2:51PM
    Nevermind found it.
  • edited 2:51PM
    wrote:
    Nevermind found it.
    Do you mean you could add my example to the solution of your issue and and it worked OK?

    Mick

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.