[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Change textbox size and location in Microsoft Report Viewer control.

Posted on 2012-09-07
3
Medium Priority
?
2,125 Views
Last Modified: 2012-09-28
I am developing a win forms application using dotnet framework 4.0 with C# and SQL server 2005. I am using visual studio 2010 as IDE. My application has several reports and i am developing it using Microsoft Report Viewer Control. I have several occassions in which i need to change the size and location of text boxes in report viewer dynamically. I have googled a lot and didn't get any reliable solution. Please help me to find out a solution
0
Comment
Question by:syosys
  • 2
3 Comments
 
LVL 19

Expert Comment

by:Shahan Ayyub
ID: 38378166
This may help you:

cr.Section2.ReportObjects["ORderNo1"].Height = 600;     // Change Height
cr.Section2.ReportObjects["ORderNo1"].Left = 600;          // Change Location

Open in new window


Here:

cr = report bound to ReportViewer
Section2 = The section holds the field
ORderNo1 = Name of field exists in section 2
0
 

Author Comment

by:syosys
ID: 38378902
Thank you for the response. But may I know where this code should be placed. I have placed the report viewer inside a form. is this code to be placed in the form's code?
0
 
LVL 19

Accepted Solution

by:
Shahan Ayyub earned 1500 total points
ID: 38379060
this code should be placed where you bind report with ReportViewer control. Before binding set location and other parameters and bind it to the control.
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question