Hi
I have below code . I want to display CurrentPage variable value in Crystal report
whileprintingrecords;
booleanvar i;
numbervar CurrentPage;
if {#RTotal0} = {Command.No of Records} then
(
CurrentPage := PageNumber;
i:=true;
)
Thanks
Hi
I have below code . I want to display CurrentPage variable value in Crystal report
whileprintingrecords;
booleanvar i;
numbervar CurrentPage;
if {#RTotal0} = {Command.No of Records} then
(
CurrentPage := PageNumber;
i:=true;
)
Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Saravanan GanesanPosted Sep 24, 2023, 5:11 PM
In your Crystal Reports formula, you've set up a logic where you're tracking the current page number when a certain condition is met. To display the
CurrentPagevariable value in your Crystal Report, follow these steps:Create a Text Object: In your Crystal Report, add a text object where you want to display the
CurrentPagevalue.Set Text Object Formula: Right-click the text object, choose "Format Text," and in the "Common" tab, click the formula (X+2) button next to the "Text" field. Enter the formula
{@YourFormula}whereYourFormulais the name of the formula containing your code.Preview Report: When you preview the report, the
CurrentPagevalue will be displayed in the text object on the appropriate page based on your code logic.Ramco RamcoPosted Aug 31, 2023, 3:44 AM
Hi
I have placed below cod ein Page Header but it is not displaying CurrentPage value
"Current Page: " & ToText(CurrentPage)
Below code is in Details section
whileprintingrecords;
booleanvar i;
numbervar CurrentPage;
if {#RTotal0} = {Command.No of Records} then
(
CurrentPage := PageNumber;
i:=true;
)
Thanks
Tahir AnsariPosted Aug 30, 2023, 3:20 PM
To display the `CurrentPage` variable value in Crystal Reports, you can create a text object or a formula field in your report and then insert the `CurrentPage` variable into that object
1. Open your Crystal Report.
2. Go to the "Insert" menu and select either "Text Object" or "Formula Field," depending on your preference.
3. If you chose "Text Object," you can simply type the text you want to display and then drag and drop the `CurrentPage` variable from the "Field Explorer" onto the text object.
4. If you chose "Formula Field," you can name the formula and then write the formula to display the `CurrentPage` variable. For example:
5. Place the text object or formula field on the appropriate section of your report, such as the header, footer, or group footer.