PageNumber

Post Author: queen3
CA Forum: General
I'm not a master of the Crystal Reports so please forgive me if I'm asking an obvious things. But I'm stucked.
I'm trying to build a Table Of Contents. I can't use the KB decision (with a DB table to hold TOC) because I don't have groups - I need a TOC entry for each subreport. So, I created a formula like this:
===
WhilePrintingRecords;
Global StringVar strAccumTOC;
strAccumTOC := strAccumTOC + ToText(PageNumber) + ", ";
strAccumTOC
===
I put this formula on each page that I need to add to the TOC.
This is not a real formula - it is used to test the technique. You see I output the strAccumTOC each time it is calculated.
So what is wrong? On the first page we'll see: "1, ". On the second page we'll see: "2, 2, ". And so on. On the last page where I show the accumulated TOC we'll see: "#, #, #, ...., #, " where # is (it seems) the last page that this formula was calculated at.
What is expected? "1, " on the first page, "1, 2, " on the second, etc.
In fact I checked the value of the strAccumTOC on each page - it IS "1, " on the first page. But when it comes to the second page - BANG - it is "2, 2, ". I only added "2, " to the "1, " and I would say, "1, " + "2, " = "2, 2, " does not seem to be valid.
I don't understand this. It seems that instead of storing the page number Crystal Reports stores a kind of object reference to the page number so that it is always the current page, no matter on which page it was added to the strAccumTOC. So we'll have "<PageNumberRef>, <PageNumberRef>, ..." and on each page the <PageNumberRef> will become the current page, not the one on which it was added to the strAccumTOC.
This is just a wild guess of course. A wild guess for a wild situation.
I've been fighting with this for a half of day trying different formulas, arrays, and so on. I tried PageNOfM instead of PageNumber.
And now I have no idea of what's going on. Could someone please explain this to me?

Post Author: Roca
CA Forum: General
I can't help you, but I have the same problem and no solution.  Let's pretend a subreport is on page 4 and my TOC will be on page 1.  Here is what I did:1.  In the main report, I put the pagenumber into a formula.2.  I passed the formula to the subreport.  Now, the subreport knows what page it is on in regards to the main report! (The subreport now knows it is on page 4).  It's a good start.3.  In the sub report, I put this parameter into a new formula.4.  I used the 'shared variable' to call it back into the main report.After passing the pagenumber from the main report to the subreport and back to the main report, I would have expected the actual number to be passed, but I agree with you that CR is really just passing an object reference.  The key is breaking that reference. If anyone finds a solution, please email me. With 50+ page reports involving 6 subreports, a Table of Contents is crucial!

Similar Messages

  • How to insert documents first pagenumber on any page?

    Does anyone know how to insert the pagenumber from the first page in a indesign-document, on a page of choosing? I can only find how to add a document last-page as a number.
    Example:
    A document with page 10-20.
    On page 3, 4 or 13 I would like to have a footer that says "Document XYZ - Pages: 10-20".
    Any ideas?

    This is not intuitive,, but should work...
    On the first page add a small text frame anywhere and insert a fame break character. Now thread that frame to the one where you want to have your start page number, wherever that happens to be in the document. In this new frame enter a Special Character > Markers > Previous Page Marker.
    The down-side here is this is not a variable, so if you want to have more than one frame like this you need to set up each one the same way with its own linked frame on the first page. In sush a case I thnk it would be more practical to just enter the start page number manually, perhaps as a custom text variable that you can edit in one place if the start number needs to change.

  • Fields in Keynote 3 (eg pagenumber, pagecount, date created)

    I have imported a ppt with pagenumber field. This field works as expected in KeyNote 3.
    The thing is, is there a way to create such a field (or one of the variations I mentioned)

    The other fields, no, but Keynote does support page numbers on master slides or on each slide via the slide inspector, you simply turn it on and format it to your liking.

  • How to get pagenumber from a anchored rectangle?

    Hi all!
    I want to know the pagenumber from a rectangle, which is anchored inside a textframe.
    I've got the UID from this rectangle.
    Thanks!

    It works!
    UIDList selectedItems;
    ErrorCode errorCode;
    PMString strPageNumber;
    IDocument* iDocument = Utils<ILayoutUIUtils>()->GetFrontDocument();
    if (iDocument == nil) { CAlert::ErrorAlert("iDocument == nil"); break; }
    // Get the document's database
    IDataBase* iDatabase = ::GetDataBase((IPMUnknown*)iDocument);
    if (iDatabase == nil) { CAlert::ErrorAlert("iDatabase == nil"); break; }
    InterfacePtr<ISelectionManager> iSelectionManager(Utils<ISelectionUtils>()->QueryActiveSelection());
    if (iSelectionManager == nil) { CAlert::ErrorAlert("iSelectionManager == nil"); break; }
    InterfacePtr<IHelloWorldSuite> iHelloWorldSuite(iSelectionManager, UseDefaultIID());
    if (iHelloWorldSuite == nil) { CAlert::ErrorAlert("iHelloWorldSuite"); break; }
    // Here I get the UID of the inline frame over selection
    errorCode = iHelloWorldSuite->GetSelectedFrameUIDList(selectedItems);
    if (errorCode == kFailure) break;
    Utils<ILayoutUtils> iLayoutUtils;
    // Get the hierarchy
    InterfacePtr<IHierarchy> iHierarchy(iDatabase, selectedItems[0], UseDefaultIID());
    if (iHierarchy == nil) { CAlert::ErrorAlert("iHierarchy == nil"); break; }
    // Get the page UID
    UID ownerPageUID = iLayoutUtils->GetOwnerPageUID(iHierarchy);
    // Get page number string
    InterfacePtr<IPageList> iPageList((IPMUnknown*)iDocument, UseDefaultIID());
    if (iPageList == nil){ CAlert::ErrorAlert("iPageList == nil"); break; }
    iPageList->GetPageString(ownerPageUID, &strPageNumber);
    // Show page number string
    CAlert::InformationAlert(strPageNumber);

  • Pagenumber and totalpagecount is always shown 1/1 for .txt format.

    When I export my report in .txt format somehow the pagenumber/totalpagecount is always shown 1/1.So I had placed formulae as page_num :-
    whileprintingrecords;
    if recordnumber  = 1  then 1
    else if recordnumber mod 10 = 0 then int ( recordnumber / 10 ) + 1;
    and a formulae for total page count as :-
    if isnull ( {rpt.account_number} ) then 1
    else if count ({rpt.account_number} ) <= 10 then 1
    else if count ( {rpt.account_number} ) > 10 then   int ( count ( {rpt.account_number} ) / 10 ) + 1;
    This formulae worked fine for all reports except 1 where we required to suppress some of the records in the report according to a flag.
    example : there are 10 accounts of flag a,b,c,d.We needed to show only those flags having 'a' or 'b' flag.The rest of the records were suppressed as in the summary of report only count(c) and count(d) was required.Display of these records were not needed. But the total page count and page number formulae failed in this case as it also took into consideration those accounts too which are to be suppressed.
    What alternative can be applied? Is there anyway that the problem of pagenumber/totalpagecount always showing 1/1 for .txt export can be solved.If not what change can be done in the formulae I have written?Any completely different suggestion is also acceptable.Only the criteria is that it is compulsory for me too export the report in .txt format.
    Please suggest!!

    Hi Som
    Can you try using the following formula:
    totext(PageNumber,0,'') & "/" & totext(TotalPageCount,0,'')
    and for the suppression condition, just right click on the formula and give the suppression condition for "Suppress" option.
    Hope this helps you.
    Thanks
    Pradeep Hulke

  • Pagenumber display in report out put..

    Hi all,
    what are the system variables to dispay report output with <b>pagenumber / total number of pages</b>.
    my output format is like <b>1/3 2/3 3/3</b>...
    thanks and regards.
    Rupa.

    Please see the following example.
    report zrich_0004
           line-size 80
           line-count 65
           no standard page heading.
    data: imara type table of mara with header line.
    selection-screen begin of block b1 with frame title text-001 .
    parameters: p_check type c.
    selection-screen end of block b1.
    start-of-selection.
      perform get_data.
      perform write_report.
    top-of-page.
      perform top_of_page.
    *  FORM GET_DATA
    form get_data.
      select * into corresponding fields of table imara
            from mara up to 300 rows.
    endform.
    *  FORM WRITE_REPORT
    form write_report.
      data: xpage(4) type c.
      loop at imara.
        write:/ imara-matnr.
      endloop.
      write sy-pagno to xpage left-justified.
      do sy-pagno times.
        read line 1 of page sy-index.
        replace '****' with xpage into sy-lisel.
        modify current line.
      enddo.
    endform.
    *  Form  top_of_page
    form top_of_page.
      write:/32 'Test Program',
            at 62 'Page:', at 67 sy-pagno, 'of', '****'.
    endform.
    Regards,
    Rich Heilman

  • Pagenumbering in Indesign

    Pagenumbering in Indesign: I know how to set the numbering in a document but I dont know how to do it if I want the document to start with f.ex. page 35 instead of page 1. Is there an easy way to do it?
    Goran W

    Go to Layout>Numberin and Section Options
    Start Numbering at 35
    Section Marker f.ex.
    On your Master page, before the page number go to Type>Insert Special Character>Markers>Section Marker
    View your page to make sure it looks ok.
    You can apply a different style to the f.ex. if you want to make it italic or bold or something, if you like.

  • Most efficient way to return the totalcount along with pagewise data [via pagenumber/pagesize as input]

    I have following query to return the page data
    declare @pageSize INT = Null
    ,@pageNumber INT = Null
    declare @totalcount int
    set @pageSize =15
    set @pageNumber = 1
    select *
    from (SELECT ROW_NUMBER()
    OVER(
    ORDER BY dbo.coordinator_event.CoordinatorId) AS RowNumberForPaging
    ,dbo.coordinator_event.EventId
    ,dbo.coordinator_event.NumberOfParticipantAllowed
    ,dbo.coordinator_event.RegistrationClosingDate
    ,dbo.coordinator_event.CoordinatorId
    ,dbo.royalevents_royalevent.title_en AS EventTitleEnglish
    ,dbo.royalevents_royalevent.StartDateTime
    ,Count(dbo.event_attendee_registration.FullName) ParticipantRegistration
    , COUNT(*) OVER(PARTITION BY 1) as TotalRows
    FROM dbo.coordinator_event
    inner JOIN dbo.royalevents_royalevent
    ON dbo.coordinator_event.EventId = dbo.royalevents_royalevent.base_id
    left JOIN dbo.event_attendee_registration
    ON dbo.coordinator_event.CoordinatorId = dbo.event_attendee_registration.CoordinatorId
    and royalevents_royalevent.base_id = event_attendee_registration.EventId
    where coordinator_event.CoordinatorId = 3
    group by dbo.coordinator_event.EventId
    ,dbo.coordinator_event.NumberOfParticipantAllowed
    ,dbo.coordinator_event.RegistrationClosingDate
    ,dbo.coordinator_event.CoordinatorId
    ,dbo.royalevents_royalevent.title_en
    ,dbo.royalevents_royalevent.StartDateTime
    ) MyTable
    WHERE RowNumberForPaging >= ( ( ( @pageSize * @pageNumber ) - @pageSize ) + 1 )
    AND RowNumberForPaging <= ( @pageSize * @pageNumber )
    ORDER BY CoordinatorId
    I want's two thing with it. One thing is about how i can easily return @totalcount as separate parameter instead of part of the result set and secondly if there is a way i can optimize above row_number query to achieve paging
    Kamran Shahid Application Developer (MCP,MCAD,MCSD.NET,MCTS,MCPD.net[web])

    What is your SQL Server version?
    I think there is no way to get the count except for using temp table, e.g.
    select *
    INTO #TempResults
    from (SELECT ROW_NUMBER()
    OVER(
    ORDER BY dbo.coordinator_event.CoordinatorId) AS RowNumberForPaging
    ,dbo.coordinator_event.EventId
    ,dbo.coordinator_event.NumberOfParticipantAllowed
    ,dbo.coordinator_event.RegistrationClosingDate
    ,dbo.coordinator_event.CoordinatorId
    ,dbo.royalevents_royalevent.title_en AS EventTitleEnglish
    ,dbo.royalevents_royalevent.StartDateTime
    ,Count(dbo.event_attendee_registration.FullName) ParticipantRegistration
    , COUNT(*) OVER(PARTITION BY 1) as TotalRows
    FROM dbo.coordinator_event
    inner JOIN dbo.royalevents_royalevent
    ON dbo.coordinator_event.EventId = dbo.royalevents_royalevent.base_id
    left JOIN dbo.event_attendee_registration
    ON dbo.coordinator_event.CoordinatorId = dbo.event_attendee_registration.CoordinatorId
    and royalevents_royalevent.base_id = event_attendee_registration.EventId
    where coordinator_event.CoordinatorId = 3
    group by dbo.coordinator_event.EventId
    ,dbo.coordinator_event.NumberOfParticipantAllowed
    ,dbo.coordinator_event.RegistrationClosingDate
    ,dbo.coordinator_event.CoordinatorId
    ,dbo.royalevents_royalevent.title_en
    ,dbo.royalevents_royalevent.StartDateTime
    ) MyTable
    WHERE RowNumberForPaging >= ( ( ( @pageSize * @pageNumber ) - @pageSize ) + 1 )
    AND RowNumberForPaging <= ( @pageSize * @pageNumber )
    select @TotalCount = TotalRows from #TempResult
    SELECT .. FROM #TempResult
    ORDER BY CoordinatorId
    See also this very recent article about the subject you ask:
    Paging
    a Query with SQL Server
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • Help in Pages: „pagenumber" not found

    In the meantime I found again how to insert and show pagenumbers. Though - in the helpfile the expression pagenumber is not found. Is this already known?
    ~k.

    For sure, I ran a copy of Pages which run only in English.
    I was unable to guess if (.at) is dedicated to a given language and I know that it's unsafe to link a first or last name to a language too
    Next time, it would be good idea
    (1) to tell which is the language used to run Pages (at least if it's not English)
    (2) don't search in the Help but in Pages User Guide.
    The Help rely upon a list of indexed words or strings which by definition is a limited one.
    The User Guide is a PDF in which we may search as we want.
    Yvan KOENIG (VALLAURIS, France) mardi 26 avril 2011 11:05:27

  • New Page After if PageNumber mod 2 = 0 not working

    My report needs to print on both sides of the paper, but one of the subreports that it calls must always start on the front, not the back, side of the page.  The subreport is in a subfooter (Group Footer #3e), so I have a 'dummy' subfooter (Group Footer #3d) before it, with a formula stipulating New Page After if PageNumber mod 2 = 0.  Since this doesn't seem to work, I also have a formula in Group Footer #3e stipulating New Page Before if PageNumber mod 2 = 0.  Still doesn't work - it just merrily starts the subreport on the even-numbered page.  If I print PageNumber in Group Footer #3e, (above where the subreport is invoked), it does display the even page number, so the formula should be forcing it to throw the page.  This even-page-throwing formula works just fine in other parts of my report and within the subreport itself.  Any ideas why it's not working in this particular case?

    Not sure I follow your design but I think what I would do is to use New Page Before for both the subreport section and the section preceding the subreport section.  I would use New Page Before all the time before the subreport section, and conditionally for the preceding section using the PageNumber mod 2 expression.
    Fuskie
    Who has a suspicion he is suggesting what you already tried but is not sure...

  • How to get pagenumber of anchored Box

    In javascript, how to get page number of anchored textbox.
    if i gave "textframes[0].parent" means it shows an error.
    Thanks

    Usually, the "textframes" array of an object points to the textframes contained in that object. Therefore, if you ask something with textframes what the parent is of "textframes[0]", you will get that same object again.
    In this case you are getting an error because there are (apparently) no text frames inside the anchored object.
    To try out stuff like this you can use the "constructor.name" construction:
    alert (app.selection[0].parent.constructor.name);
    with the anchored object selected results "Character". That cannot ever be a part of a page, so you have to get up another level:
    alert (app.selection[0].parent.parent.constructor.name);
    will tell you it's a Story. Now that's obviously wrong, because a story can run over several pages. Looking into the Object Model, you will see a character also has a property "parentTextFrames" (described as "The text frames that contain the Character. Can return: Array of TextFrames or TextPaths."). Checking with
    alert (app.selection[0].parent.parentTextFrames[0].constructor.name);
    now returns the text frame of the story where the actual character -- in this case the Anchored object -- is located in.
    For simple documents and scripts, you are done here: the parent of a text frame is the page. If this frame in turn could be anchored inside something else, or the anchored object could be inside a table or something like that, or the objects could be on the pasteboard or on a master page, you'll need additional checks.

  • Adding pagenumber to financial report

    Anyone familiar with adding pagenumbers to a report created in financial reporting studio?

    Try
    http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/html_fr_user/86.html
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Pagenumber on outside of the page

    I like to print a Pages document in book-style, with the pagenumbers on the outside of the page.
    So left aligned on the odd pages, right aligned on the even pages.
    In the previous version of Pages this was possible; I cannot find how to do this in version 5.2.
    Does anyone know how to do this?
    Thank you very much in advance!

    Facing Pages has been removed from Pages 5 along with about 100 other features.
    Just use Pages '09 which should still be in your Applications/iWork folder.
    Peter

  • BlankPages and PageNumber

    Hi all!
    I have one logical page, which contains three physical pages.
    Sometimes third physical page cannot fit all data and it repeats logical page.
    So, i recieve 6 pages, where 4th and 5th are blank.
    I remove blank pages with 'Runtime settings', and in output recieve only four.
    And when I put <PhysicalPageNumber> field, it counts all six pages, while in output I have only four.
    The forth page has <page=6>, but it should be <page=4>.
    Any ideas how to fix it?
    Thanks before

    Paul,
    The BLANKPAGES parameter is only meant to not print out blank pages as a paper saving enhancement. It
    doesn't have an effect on the page numbering as what happens is the report is completely formatted and then blank pages are not sent to the printer. As
    this is done after the formatting the report, it is not possible to change the page numbering in the current architecture.
    However there haws been an enhancement request filed for this and is under consideration for the next release
    Thanks
    The Oracle Reports Team

  • Error in Pagenumbering for Smartform

    Hi All.
    I am working on smartforms.
    I am able to print smartform evrything is perfect.
    I have 12 pages in my smartform.
    I am displaying page numbers like 1/12 and 2/12 etc like this.
    When i seesing the ouput from 2 to 9 pages  the page nummber is dispalying as 2/* and 3/* like for 10 , 11 and 12 pages it is coming correctly.
    What would be the problem.How can i solve this problem.
    Thanks,
    Swapna.
    <MOVED BY MODERATOR TO THE CORRECT FORUM>
    Edited by: Alvaro Tejada Galindo on Aug 28, 2008 1:10 PM

    In your total page print with addition 4ZC. This will not print astrik until 9999 pages.
    Like:
    Page &SFSY-PAGE& of &SFSY-FORMPAGES(4ZC)&
    Regards,
    Naimesh Patel

Maybe you are looking for

  • Depot  Excise Invoice with reference to Delivery from project

    please understood my requirement Normal Depo Sales is like VA01-VL01N-J1IJ----VF01 here whatever excise values captured in J1IJ those values come to the commercial Invoice. As per My requirement we are creating Project and while creating sales order

  • "This iPod cannot be used because the Apple Mobile Device service is not s"

    This iPod cannot be used because the Apple Mobile Device service is not started. why do i keep getting this whenever i connect my iPod touch (2G) started happening today, i think it has something to do with "Bonjour" i blocked it i believe and when i

  • Airport Works on 1 Machine, Does not on Another

    I have 2 macs.  One of the two will not connect to the net. Mac Number 1 connects to the net thru a wireless airport expres, everything is fine.  Other people who visit, can cnnect as well. The airport is not hidden and there is no password. Mac Numb

  • Wont boot: I get beeps and flashing sleep light

    The PB-T boots to a beeping noise and then the sleep light flashes once: long, then 3 short flashes. I reseated the RAM and swapped RAM, to no avail. Wont boot from anything even install disks. Did the PRAM too (which never does anything). Tried the

  • Same Execution plan But different consistent read values

    hi, my db version 10.2.0.3 os version solaris 10. i have a query which has same execution plan but with diffrenet consistent read values when optimizer_mode is RULE and CHOOSE. what may be the cause of that? thanks, Here is the query: SELECT * FROM X