ActiveReports Developers 7 Now Available in Beta!! (click for details)

ActiveReports for .NET Support

Started by klimia at 02-18-2010 2:27 PM. Topic has 7 replies.

Print Search Rate
Sort Posts:    
   02-18-2010, 2:27 PM
klimia is not online. Last active: 3/22/2012 3:43:55 AM klimia

Top 500 Posts
Joined on 05-24-2008
Posts 42
Detect when new column starts
Hi!

I need to know when detail section starts to print next column.
I tryed group header AfterPrint event but it fires first time before start to print any details then print both columns in detail section. So second time AfterPrint fires AFTER second column detail already printed.

I tryed to calculate in detail_AfterPrint _currHeight += detail.Height and check if _currHeight <= _DetailHeight but sometime second column started when _currHeight + detail.Height <= _DetailHeight

Please help me to detect when second column started or at least heights of first and second columns.

-Mila

   Report 
   02-19-2010, 4:46 AM
PrantikS is not online. Last active: 4/30/2012 6:13:04 PM PrantikS

Top 25 Posts
Joined on 12-11-2008
Posts 1,644

DDStaff
Re: Detect when new column starts
Hello,

The beforeprint event of a section would give you the exact height of the controls and the section that is starting to get rendered. Please take a look at this help document regarding the events of a section.

However, please let us know the exact issue that you are facing. Do you need the sections to keep together? You may utilize the keeptogether property of the section for this purpose.

Regards,
Prantik


   Report 
   02-19-2010, 12:30 PM
klimia is not online. Last active: 3/22/2012 3:43:55 AM klimia

Top 500 Posts
Joined on 05-24-2008
Posts 42
Re: Detect when new column starts

Attachment: columns.jpg
I know heght of the detail section. The problem is - i don't know if it goes to the first or to the second column.
I use following code (you can see result in the attachment):

        private float _currHeight = 0F;
        private float _currHeight2 = 0F;
        private float _DetailHeight = 8.4F;

        private void rptEmployeeTransactions_PageEnd(object sender, EventArgs e)
        {
            float Y1 = this.PageSettings.Margins.Top + pageHeader.Height + gpHeader.Height + _currHeight;
            float Y2 = this.PageSettings.Margins.Top + pageHeader.Height + gpHeader.Height + _currHeight2;

            this.CurrentPage.ForeColor = System.Drawing.Color.Black;
            this.CurrentPage.PenStyle = DataDynamics.ActiveReports.Document.PenStyles.Solid;
            this.CurrentPage.PenWidth = 1;
            this.CurrentPage.DrawLine(lnBottom.X1 + this.PageSettings.Margins.Left, Y1, lnBottom.X2 + this.PageSettings.Margins.Left, Y1);
            this.CurrentPage.DrawLine(lnBottom2.X1 + this.PageSettings.Margins.Left, Y2, lnBottom2.X2 + this.PageSettings.Margins.Left, Y2);
           
        }

        bool _IsFirstColumn = true;
        private void detail_AfterPrint(object sender, EventArgs e)
        {
            if ( _IsFirstColumn && (_currHeight + detail.Height <= _DetailHeight))
            {
                _currHeight += detail.Height;
            }
            else
            {
                _IsFirstColumn = false;
                _currHeight2 += detail.Height;
            }
        }

        private void rptEmployeeTransactions_PageStart(object sender, EventArgs e)
        {
            _currHeight = 0;
            _currHeight2 = 0;
            _IsFirstColumn = true;
        }



   Report 
   02-22-2010, 2:12 AM
PrantikS is not online. Last active: 4/30/2012 6:13:04 PM PrantikS

Top 25 Posts
Joined on 12-11-2008
Posts 1,644

DDStaff
Re: Detect when new column starts

Attachment: lineatbottomoflastrecord.zip
Hello,

From the image and the code that you have sent, it seems that you have set the column count of the detail section to 2 and you wish to have a line drawn at below the last record in a page. Please take a look at the attached sample where I have implemented this. The report is connected to the NorthWind.MDB.

Regards,
Prantik


   Report 
   02-23-2010, 12:55 PM
klimia is not online. Last active: 3/22/2012 3:43:55 AM klimia

Top 500 Posts
Joined on 05-24-2008
Posts 42
Re: Detect when new column starts

Attachment: columns.jpg
Hi!

Your example always draw line at the end of second column. At least seems like an end of second column.'

I need to draw line at the bottom of the first and second column. And columns are aneven because some rows placed in two lines and some are not. So I need to know when is the second column starts.

You simply add detail sections heights and divide by 2. This can be like this if you have no group keep together in your detail section. I do have group keep together and some details are big and some small so I have uneven columns.

-Mila


   Report 
   02-24-2010, 6:09 AM
PrantikS is not online. Last active: 4/30/2012 6:13:04 PM PrantikS

Top 25 Posts
Joined on 12-11-2008
Posts 1,644

DDStaff
Re: Detect when new column starts
Mila,

Could you send the RPX of the Report, so that I can check this further?

Regards,
Prantik


   Report 
   03-16-2010, 2:16 PM
klimia is not online. Last active: 3/22/2012 3:43:55 AM klimia

Top 500 Posts
Joined on 05-24-2008
Posts 42
Re: Detect when new column starts

Attachment: NewRPX.RPX
Hi!

This is RPX file. Look at first page.

Thank you,
Mila

   Report 
   03-18-2010, 6:08 AM
SankalpS is not online. Last active: 3/30/2012 11:17:34 PM SankalpS

Top 10 Posts
Joined on 12-11-2008
Posts 2,587

DDStaff
Re: Detect when new column starts
Mila,

Unfortunately, the Active Reports engine doesn't throw any event for new a new column. Therefore it is rather tricky to detect when a new column starts. You may want to take a look at this forum post which has a similar question and in the meantime, we will try to find some additional information.

Regards,
Sankalp
Sankalp Sen
GrapeCity- DataDynamics
   Report 
GrapeCity » Product Support » ActiveReports f... » Re: Detect when new column starts

Privacy Policy | Copyright © 1997-2012 — GrapeCity, inc.
All trademarks mentioned are the property of their respective owners.