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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Tahir AnsariRank #366 · 6.8K reputationPosted Aug 30, 2023, 11:20 AM EDT
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.
Ramco RamcoRank #462 · 5.4K reputationPosted Aug 30, 2023, 11:44 PM EDT
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
Saravanan GanesanRank #153 · 15.1K reputationPosted Sep 24, 2023, 1:11 PM EDT
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.