Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Calculating Page Total in Crystal Reports

Posted on 1999-08-01
4
Medium Priority
?
4,704 Views
Last Modified: 2013-12-25
How to Calculate and Print Page Total in Crystal Reports.
I am using MS Access Database for the Crytal Report.

And also Please send the information, how to make dynamic crystal report using SQL Server.
0
Comment
Question by:Onkar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Expert Comment

by:micwong
ID: 1507350
Actually, you don't need to CALCULATE the total page number as Crystal Report can do it for you. From the menu bar, click Insert => Special Field => Total Page Count Field, and then drag and drop into your report.

If you want to connect SQL Server from Crystal Report, you can use ODBC as a bridge.
0
 

Author Comment

by:Onkar
ID: 1507351
I want to calculate pagewise total of a column.
Suppose 'Salary' is a column displaying all employes salary, I want pagewise total of this Salary coulumn at end of the page.
0
 
LVL 18

Accepted Solution

by:
mdougan earned 200 total points
ID: 1507352
There are a few ways that you might try.  The easiest is to create a formula field, call it something like PageTotal, and give it a formula of Sum({employees.salary}).  Put this formula field in the Page Footer.  This may not work, however, but it is the easiest to try, so I'd give it a shot first.  If it doesn't work, then try:

Create a formula field called @AddSalaryTotal, in the properties for the formula, check the checkbox that says surpressed (this means it wont be visible on the report), then place the formula field somewhere on your detail line.
It keeps a running total for the Page, and for the Report:

The formula for @AddSalaryTotal is:

WhilePrintingRecords;
NumberVar SubTotal;
NumberVar GrandTotal;
SubTotal := SubTotal + {employees.salary};
GrandTotal := GrandTotal + {employees.salary}

Create another formula field called @DisplaySalaryTotal.
In the Page Footer, the following formula displays the subtotal (it is not surpressed):

The formula for @DisplaySalaryTotal is:

WhilePrintingRecords;
NumberVar SubTotal;
SubTotal

Create a third formula called @DisplayGrandTotal.
In the Report Footer, the following formula displays the Grand Total (not surpressed).

The formula for @DisplayGrandTotal is:

WhilePrintingRecords;
NumberVar GrandTotal;
GrandTotal

This will definately work, if the first method did not.

As for creating a "dynamic" report under SQL Server, you have to define what you mean by dynamic.  It is easy to create a report where you pass different parameters or change the Selection Criteria, but it is very difficult to change the columns that are selected.  My advice is to create a Stored Procedure to return your data, then create your Crystal Report based on the Stored Procedure, and not the tables themselves.  If you need help on how to pass parameters for a SQL Server Stored Procedure based report let me know.

0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6822785
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.

This is the Community Support link, if help is needed, along with the link to All Topics since many new ones were recently added.

http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
http://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thanks,
Moondancer
Moderator @ Experts Exchange
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question