Hi, hope someone can help.
Basically I have a record box that is populated by a query from the database, the content of which has some variables that I'd like to alter at run time.
E.g, Each record is like this
'fdsfsd fsdfsd fdsf #VARIABLE fsdfsd fsd'
And I need to change the variable value at run time.
Is this possible?
Hope I make sense to someone.....
Altering RecordBox Text after population by database
Re: Altering RecordBox Text after population by database
Support · Aug 23, 2007Hello,
Do you want to change the field name at runtime? If yes it can be done through code as below:
DocumentLayout report = new DocumentLayout( @"C:\Temp\DPLX\Test.dplx" );
RecordBox box = (RecordBox)report.GetReportElementById("RecordBox1");
box.Field = "CustomerId";
Document document = report.Run();
document.DrawToWeb( "Test.pdf" );
Thanks,
ceTe Software Support Team
Re: Altering RecordBox Text after population by database
Forum member · Aug 23, 2007Hi,
No, I don't want to change the entire field at runtime, just certain values in the field. If it was a label I would do a string.replace on the variables, but as I can't bind a label to a datasource I can't do this. Is there anyway to way to access the actual text property of a record box?
Thanks
Re: Altering RecordBox Text after population by database
Support · Aug 24, 2007Hello,
It is not possible to set the actual text for the RecordBox. You can only set the Field in runtime. However you can achieve your requirement by using a Placeholder element instead of the RecordBox and the LaidOut event of the Placeholder. You can read the current record value and replace some of the text or alter the value then add a label with this new text in place of the Placeholder. You will have to do this within the LaidOut event. You can refer to the Handling Events
topic in our help documentation.
Thanks,
ceTe Software Support Team.