How to use Variables

Stimulsoft Reports.NET discussion
Post Reply
Stephan1
Posts: 122
Joined: Fri Aug 31, 2007 7:22 am
Location: Germany

How to use Variables

Post by Stephan1 »

Hi,

i got a Problem using Variables.

In my Report. i have about 10 fields for Adress. Like Name1, Name2, Name3, Street, etc.

i want to put them all together to 1 Variable, so that no spaces in the report is show.

In the Events of the field i put the following code:

if WaWi_VKBelege.AuftraggeberAnrede.length > 0 then
anschrift =WaWi_VKBelege.AuftraggeberAnrede
end if

if WaWi_VKBelege.AuftraggeberName1.length > 0 then
anschrift +=WaWi_VKBelege.AuftraggeberName1
end if

...
....


Is there a way to add a Carriage Return to a string like chr(13) or VBCRLF ???

I dont want to use a container and Childdatabands to archieve this.

thx

Stephan
EDV Gradl
Posts: 228
Joined: Sat Jun 17, 2006 9:50 am
Location: Germany

How to use Variables

Post by EDV Gradl »

In the event you could use this (sorry, only in C#):
StringBuilder MyLine = new StringBuilder();
MyLine.Append("Some Text"); // Without CR
MyLine.AppendLine("More Text"); // With CR
Anschrift = MyLine.ToString();

I think you even don't need a variable, and instead use the GetValueEvent and then chane the last line to:
e.Value = MyLine.ToString();

Marco
Stephan1
Posts: 122
Joined: Fri Aug 31, 2007 7:22 am
Location: Germany

How to use Variables

Post by Stephan1 »

Thx for your help.

works fine.

Stephan
Post Reply