Output DataSource items as a concatenated string?

Stimulsoft Reports.WEB discussion
Post Reply
ColinDaly
Posts: 7
Joined: Fri Nov 11, 2011 3:44 am

Output DataSource items as a concatenated string?

Post by ColinDaly »

Hi,

We have a DataSource in our report that has a similar shape to:

Key | Value
-----------------------
1 | Value1
2 | Value2

We require a concatenated string ('Key = Value, '...repeat) of the results to be in the report i.e. '1 = Value1, 2 = Value2'....can you provide an example of how this could be achieved?

Regards,

Col
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Output DataSource items as a concatenated string?

Post by HighAley »

Hello.
ColinDaly wrote:We have a DataSource in our report that has a similar shape to:

Key | Value
-----------------------
1 | Value1
2 | Value2

We require a concatenated string ('Key = Value, '...repeat) of the results to be in the report i.e. '1 = Value1, 2 = Value2'....can you provide an example of how this could be achieved?
We have no final solution, but there could be a workaround.
To say something certain we need to know what product do you use Designer.Web with.

Generally, the better way is to prepare a string in advance and send it to the report.

Thank you.
ColinDaly
Posts: 7
Joined: Fri Nov 11, 2011 3:44 am

Output DataSource items as a concatenated string?

Post by ColinDaly »

Thanks for the reply, I guessed this may be the response. Do you recommend using a variable for this task?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Output DataSource items as a concatenated string?

Post by HighAley »

Hello.
ColinDaly wrote:Thanks for the reply, I guessed this may be the response. Do you recommend using a variable for this task?
Here is a sample code for this before compilation:

Code: Select all

StiReport report = new StiReport();
report.Load("d:\\stimulsoft\\1\\ReportArguments2.mrt");
report.Dictionary.Variables["Variable1"].Value = yourCancatenatedString;
report.Compile();
report.Render(false);
report.Show();
or after compilation:

Code: Select all

report.Compile();
report["Variable1"] = yourCancatenatedString;
report.Render(false);
report.Show();
Thank you.
Post Reply