CppMax Homepage
Forum Home Forum Home > ReportMax > ReportMax
  New Posts New Posts RSS Feed - Autoresize field control in reportmax 3.1
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Autoresize field control in reportmax 3.1

 Post Reply Post Reply
Author
Message
Rockmode View Drop Down
Newbie
Newbie
Avatar

Joined: 25 Nov 2013
Location: PH
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rockmode Quote  Post ReplyReply Direct Link To This Post Topic: Autoresize field control in reportmax 3.1
    Posted: 09 Dec 2015 at 4:01am
How to make an autoresize field control in reportmax 3.1 that will automatically expand with the text value?
Back to Top
emadns View Drop Down
Admin Group
Admin Group


Joined: 06 Feb 2012
Status: Offline
Points: 126
Post Options Post Options   Thanks (0) Thanks(0)   Quote emadns Quote  Post ReplyReply Direct Link To This Post Posted: 09 Dec 2015 at 11:05am
Expanding the textbox vertically (multiple lines) can be done by setting the Textbox AutoExpand property to True. Please note that the section AutoExpand property may also have to be set to True.

Expanding the textbox horizontally (according to the text width) can be done programmatically in the Report_Detail_Format event handler (if the control is in the Detail section) as follows:

private void reportMaxViewer1_Report_Detail_Format(ReportMaxSection Detail, DataRow row, ref bool bCancel)
{
    Graphics g = Graphics.FromHwnd(IntPtr.Zero);
    for(int i = 0; i < Detail.m_aFields.Count; i++)
    {
        if(Detail.m_aFields.GetControlType() == rmReportFieldType.rmFieldText)
        {
            ReportMaxTextbox txt = (ReportMaxTextbox)Detail.m_aFields;
            txt.Width = g.MeasureString(txt.Text, txt.Font).Width;
        }
    }
    g.Dispose();
    g = null;
}


Back to Top
Rockmode View Drop Down
Newbie
Newbie
Avatar

Joined: 25 Nov 2013
Location: PH
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rockmode Quote  Post ReplyReply Direct Link To This Post Posted: 10 Dec 2015 at 12:57am
Thank you. I'll give it a try. And 1 more thing before I buy the 3.5 version may I know what's the difference between 3.1 and 3.5? Please give me a list. I'm willing to buy that 3.5 if I'm interested with its additional features. Thank you.
Back to Top
emadns View Drop Down
Admin Group
Admin Group


Joined: 06 Feb 2012
Status: Offline
Points: 126
Post Options Post Options   Thanks (0) Thanks(0)   Quote emadns Quote  Post ReplyReply Direct Link To This Post Posted: 10 Dec 2015 at 10:05am
3.5 has major changes over 3.1:
- Visual Studio 2015 Support including the Express Version
- Standalone Designer : you can design your reports from outside Visual Studio
- Tutorial Document: explains major features of ReportMax 
- Many bug fixes and enhancements

You can download the 30-day Trial and see for yourself 


Back to Top
Rockmode View Drop Down
Newbie
Newbie
Avatar

Joined: 25 Nov 2013
Location: PH
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rockmode Quote  Post ReplyReply Direct Link To This Post Posted: 17 Aug 2016 at 4:13am
Sir how about in VB.Net?
Back to Top
Rockmode View Drop Down
Newbie
Newbie
Avatar

Joined: 25 Nov 2013
Location: PH
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rockmode Quote  Post ReplyReply Direct Link To This Post Posted: 18 Aug 2016 at 12:52am
Need some help Sir emandns

Back to Top
emadns View Drop Down
Admin Group
Admin Group


Joined: 06 Feb 2012
Status: Offline
Points: 126
Post Options Post Options   Thanks (0) Thanks(0)   Quote emadns Quote  Post ReplyReply Direct Link To This Post Posted: 18 Aug 2016 at 7:52am
It should be

Detail.m_aFields(i).GetControlType() = ...

You forgot (i)
Back to Top
Rockmode View Drop Down
Newbie
Newbie
Avatar

Joined: 25 Nov 2013
Location: PH
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rockmode Quote  Post ReplyReply Direct Link To This Post Posted: 18 Aug 2016 at 10:49pm
It works :) Thanx
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.06
Copyright ©2001-2016 Web Wiz Ltd.