[SOLVED] Printing FooterRows
Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=18062
Printed Date: 07 May 2024 at 4:08pm Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: [SOLVED] Printing FooterRows
Posted By: Xander75
Subject: [SOLVED] Printing FooterRows
Date 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)
|
Replies:
Posted By: ABuenger
Date 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
|
Posted By: Xander75
Date 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)
|
Posted By: cbs
Date 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
|
Posted By: Xander75
Date 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)
|
Posted By: cbs
Date Posted: 23 March 2011 at 11:35am
Hi xander75,
This is what I was looking for. I appreciate the help.
Thanks, cbs
|
Posted By: ABuenger
Date 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
|
Posted By: ABuenger
Date Posted: 10 April 2011 at 7:13pm
- Uncheck "pin footer rows printed" - File > Print preview
uploads/1755/ReportSample_18062.zip - uploads/1755/ReportSample_18062.zip
------------- Codejock support
|
Posted By: Xander75
Date 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)
|
|