Rectangle with TextBox in RDLC Report using C#

NazHim 206 Reputation points
2021-12-25T11:38:39.303+00:00

Hi All,

i am added a Rectangle in RDLC Report also added a TextBox on Rectangle Like Picture at Below
can possible to visible Rectangle if TextBox.Text content is Blank. means
i want to show only Rectangle (as same width and height) if TextBox is Empty.
for i want to maintain that space

160388-rdlc-with-rectangle-and-textbox.png

with Regards
NazHim

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Isabellaz-1451 3,616 Reputation points
    2021-12-27T08:05:52.43+00:00

    Hi @NazHim
    You can Name the textbox first ,such as “textboxname”,and then change the background color expression of the Rectangle like =iif(ReportItems!textboxname.value.length >0,"No Color","blue")

    160559-color.png

    Best Regards,
    Isabella


    If the answer is the right solution, please click "Accept Answer" and upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Joyzhao-MSFT 15,646 Reputation points
    2021-12-27T08:07:05.05+00:00

    Hi @NazHim ,
    Is the data in your text box a parameter value?
    If it is a parameter value, you can try the following expression in the Rectangle Properties:

    =IIF(IsNothing(Parameters!ParameterName.Value), "YourColor","NULL")  
    

    160609-01.jpg
    Best Regards,
    Joy


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.