Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - [SOLVED] Printing FooterRows
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] Printing FooterRows

 Post Reply Post Reply
Author
Message
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] Printing FooterRows
    Posted: 16 March 2011 at 11:57am
Hi,

I have a added a FooterRow to the ReportControl in order to be used to display totals, which works perfectly (see screenshot below).



The Issue I have is that when I print the ReportControl the FooterRow is no longer at the bottom of the Printed Report, instead it is located after the last Grid Row record (technically still at the bottom!). However I would prefer the FooterRow to stay as it is in the ReportControl.



Does anyone know if there is a setting to do this?

Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 18 March 2011 at 9:13am
Hi,

there is currently no such option. We will add it to one of the next releases.

Andre

Codejock support
Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post Posted: 18 March 2011 at 9:19am
Hi,

Thanks for the response on this.

I was confused as I had not pinned the FooterRow so I thought it would print at the bottom as it displays on screen. Pinning the FooterRow means it's displayed as it is shown in the Print Preview screenshot, so I wasn't sure if I was missing something or not.

I just believe in consistency i.e. if it displays that way then the print should also display that way, will look out for this in the next few releases.

Thanks again.
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)
Back to Top
cbs View Drop Down
Newbie
Newbie


Joined: 22 March 2011
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote cbs Quote  Post ReplyReply Direct Link To This Post Posted: 22 March 2011 at 12:03pm
Hi Xander75,

I have looked at various ways to add totals in the footer row. Can you share how you implemented the footer totals?

Thanks,
CBS
Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post Posted: 23 March 2011 at 9:32am
Hi cbs,

Sure I can share how I did this.

Below is an snippet of code I added when setting up the ReportControl. This will create the FooterRow at the bottom of the ReportControl. I also used BeforeDrawRow to right align the text "Totals:". Then I have a procedure I call to calculate the totals if the user makes a change in the ValueChanged event.

Private Sub GridSetup()
    With rpcGrid
        ' Add your column structure and other settings here...

        ' Used to format the Data in rows, i.e. Right align the text Totals: in the screenshot in my original post
        .SetCustomDraw xtpCustomBeforeDrawRow

        ' Show Footer Row...
        .ShowFooterRows = True

        With .FooterRecords.Add
            .AddItem vbNullString
            .AddItem "Totals:"
            .AddItem "0"
            .AddItem "0"
            .AddItem "0"
            .AddItem "0"
        End With

        .Populate
    End With
End Sub

Private Sub rpcGrid_BeforeDrawRow(ByVal Row As XtremeReportControl.IReportRow, ByVal Item As XtremeReportControl.IReportRecordItem, ByVal Metrics As XtremeReportControl.IReportRecordItemMetrics)
    If Trim$(Item.Record(1).Value) = "Totals:" Then
        Row.Record(1).Alignment = xtpAlignmentRight
        Metrics.BackColor = &HE7FFE5
    End If
End Sub

Private Sub CalculateFooterRow()
    ' Reset the Footer Row to be zero
    With rpcGrid
        .FooterRecords.Record(0).Item(2).Value = "0"
        .FooterRecords.Record(0).Item(3).Value = "0"
        .FooterRecords.Record(0).Item(4).Value = "0"
        .FooterRecords.Record(0).Item(5).Value = "0"
   
        Dim Record As ReportRecord
        For i = 0 To .Records.Count - 1
            Set Record = .Records.Record(i)
            .FooterRecords.Record(0).Item(2).Value = CDbl(.FooterRecords.Record(0).Item(2).Value) + CDbl(Record.Item(2).Value)
            .FooterRecords.Record(0).Item(3).Value = CDbl(.FooterRecords.Record(0).Item(3).Value) + CDbl(Record.Item(3).Value)
            .FooterRecords.Record(0).Item(4).Value = CDbl(.FooterRecords.Record(0).Item(4).Value) + CDbl(Record.Item(4).Value)
            .FooterRecords.Record(0).Item(5).Value = CDbl(.FooterRecords.Record(0).Item(5).Value) + CDbl(Record.Item(5).Value)
        Next
   
        .FooterRecords.Record(0).Item(3).Value = Format$(.FooterRecords.Record(0).Item(3).Value, "########0.000")
        .FooterRecords.Record(0).Item(4).Value = Format$(.FooterRecords.Record(0).Item(4).Value, "########0.000")
        .FooterRecords.Record(0).Item(5).Value = Format$(.FooterRecords.Record(0).Item(5).Value, "########0.000")
    End With
End Sub


Hope this helps.

Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)
Back to Top
cbs View Drop Down
Newbie
Newbie


Joined: 22 March 2011
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote cbs Quote  Post ReplyReply Direct Link To This Post Posted: 23 March 2011 at 11:35am
Hi xander75,

This is what I was looking for. I appreciate the help.

Thanks,
cbs
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 08 April 2011 at 6:30pm
Added for the next release: PinFooterRowsPrinted
By default it is True, so you have to set it to False.

Codejock support
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 10 April 2011 at 7:13pm


- Uncheck "pin footer rows printed"
- File > Print preview

uploads/1755/ReportSample_18062.zip



Codejock support
Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post Posted: 11 April 2011 at 2:47am
Thanks for that ABuenger.
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.148 seconds.