Skip to Content
avatar image
Former Member

How to modify field values at runtime

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Feb 22, 2017 at 04:15 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 13, 2017 at 04:57 PM

    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

    Add comment
    10|10000 characters needed characters exceeded