Results 1 to 5 of 5

Thread: What is the equivalent code of this line in VB.Net?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2013
    Posts
    23

    Question What is the equivalent code of this line in VB.Net?

    here is a line i've coded in VB6 to access the width of TextBox control in the report:
    Code:
    datareport1.sections("details").controls("txtbox.text").width = 100
    so, what is the equivalent code in VB.Net?
    how can i access the control properties of Report.rdlc by code?

  2. #2
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    537

    Re: What is the equivalent code of this line in VB.Net?

    I don't know vb6 so I can't write the line for you. (sorry)
    but this is how you set the height and width of a textbox.
    Txtbox.Size = New System.Drawing.Size(12, 20)
    George

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2013
    Posts
    23

    Re: What is the equivalent code of this line in VB.Net?

    thanks George for your reply
    but unfortunately this is not a correct code
    maybe your code works to set the textbox of a form but not Report Rdlc!

  4. #4
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: What is the equivalent code of this line in VB.Net?

    Quote Originally Posted by eng.bassel View Post
    thanks George for your reply
    but unfortunately this is not a correct code
    maybe your code works to set the textbox of a form but not Report Rdlc!
    I don't have SSRS at my current job (last job I used it quite a bit though) but from Googling this it looks like a lot of people have issues editing any of the report aspects using the .Net ReportViewer, however rdlc files are just xml which means you could open it prior to running, edit the length attribute of the textbox in question and write it all out again, then run the report in the viewer. Might be more work than it's worth, but I'm not seeing anything else via google searches.

    Here's something along those lines: Programmatically Set ReportViewer Page Size
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: What is the equivalent code of this line in VB.Net?

    I don't see why it would be any different. The object model for the RDLC hasn't changed... so once you've dropped in the report viewer control, accessing anything in it should still be the same. It's like saying I have a '76 Charger that uses a key to start the engine, what's the 2016 version? The UI may look a bit different, but under the hood (pun intended) there's still an engine that works the same and it still takes a key to turn it over and start it.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width