CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Changing contents of Report Label Before Show

Print topic Send  topic

Author Message
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
View profile  Send private message
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
View profile  Send private message
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
View profile  Send private message
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
View profile  Send private message
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
View profile  Send private message
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.