Ticket Q420776
Visible to All Users

Get actual height of the report

created 13 years ago

Hello,

How can I get the report's actual height after populating with data? The Report.Page.Height cannot be used since it has the height that is declared during design and not the actual one.

Thanks

Comments (2)
DevExpress Support Team 13 years ago

    Would you please describe the problem you are trying to resolve in this manner in greater detail? This will make the situation clearer.

    FM FM
    Fotis Moulatsiotis 13 years ago

      I have a report which is bind to a collection that is my data. This collection does not have a standar lenght. One time could have only one item and the other hundreds. I don't want to split into pages, so I have set a big number in Report.Page.Height in order to simulate unlimited page height.
      I would like to know what is the actual height of data in each case since it will vary. E.g. in first case, my report will have as data only one item and afterwards blank space (and the actual height of the report is small) and in second case, the data will reserve more space than the first case. Is it possible to know this?

      Answers

      created 13 years ago (modified 13 years ago)

      Hello Fotis.
      Thank you for your message. I am afraid there is no simple way to accomplish this task.
      The only possible solution is to do the following:

      1. Create a document by using the Report's CreateDocument Method;
      2. Iterate through all Bricks within the resulting document to obtain the height of all cells;
      3. Convert the calculated height to Report measurement units and pass this value to the Report's PageHeight property;
      4. Re-create the Report's document.
        Attached is an example that demonstrates this approach in action. We look forward to your feedback once you have had the opportunity to try our solution.
        Show previous comments (3)
        DevExpress Support Team 11 years ago

          Hi Gary,
          You can use the NestedBrickIterator class to iterate through all page bricks. Please refer the How do I get the Bricks created by an XRControl? ticket for additional information.

            Thanks, that works.

            DevExpress Support Team 11 years ago

              You are always welcome, Gary!

              Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

              Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.