repeat data column on the same line

Stimulsoft Reports.NET discussion
Post Reply
shmuly
Posts: 58
Joined: Wed Jul 05, 2006 2:19 pm

repeat data column on the same line

Post by shmuly »

Is there a way to repeat a data field within a band instead of listing each row on a separate line besides using columns? I do not want to use columns because I would then have to specify the width of the column, instead I want to fit as many possible values on one line.

example:
instead of displaying following-
Parents: Sara and Michael Lehman
Children: John
Children: Mike
Children: Dora
Children: Kelly

I would like to display it as-
Parents: Sara and Michel Lehman
Children: John, Mike, Dora, Kelly
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

repeat data column on the same line

Post by Vital »

Hello,

Create master-detail report. Set height of detail report to 0. After then add detail text box (summary for all detail strings) to master band. In GetValueEvent of this text box type following code:

Code: Select all

Products.First();
string text = "";
while (!Products.IsEof)
{
  if (text.Length != 0)text += ", ";
  text += Products.ProductName;
  Products.Next();
}
Set WordWrap and CanGrow properties to true.

In attachment you can find sample report which you can run from Demo application.

Thank you.
Attachments
80.Master-Detail.mrt
(20.46 KiB) Downloaded 427 times
Post Reply