Skip to Content
0

How to modify field values at runtime

Feb 21, 2017 at 03:43 PM

60

avatar image
Former Member

Hi,

We have a Crystal Report Viewer inside a .NET web application. Is there a way to iterate through the fields in a generated report document and modify the displayed field value at runtime?

Here is pseudo code example of what I am trying to achieve:

MyMethod(ReportDocument report)
{
	var allReportFields = report.getAllFields(); //???

	//Add “some_text” suffix to all fields starting with “*”
	Foreach(var field in allReportFields)
	{
		If(field.value.beginsWith(“*”)
		{
			//Change the field value
			field.value += “some_text”;
		}
	}
}

Regards,

Georgi

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Don Williams
Feb 22, 2017 at 04:15 PM
0

Hello,

No, that is what the refresh button is for, it updates the data coming from the DB.

If you want to modify Static text that is easy, see KBA 2281780 for samples or try searching or look in the SDK help file or in Inteli-sense withing VS.

Don

Share
10 |10000 characters needed characters left characters exceeded
Don Williams
Mar 13, 2017 at 04:57 PM
0

Oh, another way is to insert a text object and then drop the field into that object, now you can append text onto it.

Don

Share
10 |10000 characters needed characters left characters exceeded