FrankR
Posts: 154
|
Posted: 09/15/2006, 11:28 AM |
|
I've been banging my head against the wall - hard - with this.
Can anyone please post a clip of code for
changing the contents of a report label before show?
_________________
FR |
|
|
matheus
Posts: 386
|
Posted: 09/15/2006, 11:40 AM |
|
Do you try Before Show from the Report Label?
_________________
Matheus Trevizan
Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br |
|
|
FrankR
Posts: 154
|
Posted: 09/15/2006, 11:46 AM |
|
Yes - but I have been unable to find the right code to actually access properly the label.
_________________
FR |
|
|
peterr
Posts: 5971
|
Posted: 09/15/2006, 12:01 PM |
|
Here are related docs: http://docs.codecharge.com/studio3/html/ProgrammingTech.../RowNumber.html http://docs.codecharge.com/studio3/html/ProgrammingTech...ntrolValue.html
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
FrankR
Posts: 154
|
Posted: 09/18/2006, 5:22 AM |
|
Quote peterr:
Peter - if it was only that simple.
Many controls - at least on report pages - aren't even declared in the code - they seem to be generated dynamically and then accessed dynamically with .FindControl().
I am aware of adding the code to the BeforeShow event, but I arm wrestled for many hours - unsuccessfully - to gain access to the control programmatically.
Using the Report Builder, I generated a page based on a table called
BCN_PCN_FORM. Various columns of the table are on the report page, one of them being a text column called COMMENTS. Specifically, what would be the code clip to access and modify the text of COMMENTS?
Thank you.
_________________
FR |
|
|
FrankR
Posts: 154
|
Posted: 09/18/2006, 6:34 AM |
|
Ok, folks here's a double answer to:
1. Programmatically gaining access to a report label dynamically
2. Formatting a label to display line breaks
// -------------------------
// Write your own code here.
// -------------------------
ReportLabel ThisLabel = (ReportLabel)e.Item.FindControl("BCN_PCN_FORMCOMMENTS");
if (ThisLabel != null)
{
ThisLabel.Text = ThisLabel.Text.ToString().Replace("\n", "<BR>");
}
else
{
ThisLabel.Text = "[Unexpected error formatting text]";
}
_________________
FR |
|
|