sumayya shahul
sumayya shahul

Reputation: 11

How to position RDLC Report item Programmatically

I want to set the screencordinates of rdlc report item(textbox) through c# coding in vs2005.i searched in the google.No proper answers found.How to set the location of an rdlc report item through report parmenters? Any kind of help will be highly appreciated. Thanks

Upvotes: 1

Views: 2181

Answers (1)

David
David

Reputation: 3763

If you open an rdlc file in notepad or any xml editor you can see that it is just xml. If you give the element an id then you can use xpath to find the element. Then all you need to do is update it's top and left nodes in the xml.

The basic steps are:

  • Open the rdlc into a new XmlDocument.
  • find the node that contains the element you want to move (this can be done with a relatively simple xpath query)
  • modify the nodes with the new cords.
  • save the xml document
  • then load the modified rdlc into the report viewer.

It's not overly easy but once you start playing with the xml you can do almost anything with RDLC.

Upvotes: 1

Related Questions