Options

Report in Role Tailored: can return the number of pages?

MCMC Member Posts: 19
edited 2010-05-19 in NAV Three Tier
Hello everybody!

We are designing 2 different reports to use in the role tailored version, so we have created a Layout in Visual studio.

We have a third report without layout because it's only a process (called from role tailored too). We're going to call the first two reports from the third report.
We need to know the number of pages of the first report to pass the number of pages + 1 to the second report (to use as the first page)

How can we obtain the number of pages of a report printed in Role Tailored?

The classic version has the [CurrPageNo] := PAGENO([NewPageNo]) function, but we are in role tailored and layout design.

Please, can anybody help us?
Thanks a lot!!

Comments

  • Options
    worthowortho Member Posts: 23
    Hi,

    This expression, placed in a text box in the footer of a report, provides page number and total pages in the report.

    =Globals.PageNumber & " of " & Globals.TotalPages

    This is described in the online help topic: http://msdn.microsoft.com/library/ms251716.aspx

    Cheers,

    David
    “This posting is provided "AS IS" with no warranties, and confers no rights.”
  • Options
    MCMC Member Posts: 19
    Thanks David,

    But I not only want to print the number of pages in role tailored version.

    Maybe I didn't explain correctly.

    I have three reports, one report doesn't print (report 1), it only calls the other two reports (report 2 and report 3)

    I need to know the number of pages (numPages) of the report 2 because report 1 needs this value in order two call report 3, and tell him that the first page is numPages +1.

    This is very simply in the classic version, because Currreport.PageNo returns the number of pages. But this expression in the Visual studio layout can't return a value to report 1, designed in classic version.

    How can I do?

    Thanks a lot.
  • Options
    PureHeartPureHeart Member Posts: 190
    I'm afraid MC but that cannot be done... Once you print the layout of the report you have no connection back to the NAV database so you can't report back to the other processing only report the last printed page number...

    The only way I see if you want to automate the process is to call a NAV web service to return back the number of the last printed page but... I tried and I wasn't able because of permission problem...
    Why don't you try my compare tool?
    http://www.mibuso.com/dlinfo.asp?FileID=1123
  • Options
    worthowortho Member Posts: 23
    Hi,

    OK I understand the problem now. Unfortunately, I don't know of any way to return the number of pages from the report viewer after it has rendered the report. The total number of pages would also depend on how the report was rendered by the report viewer (in preview mode or interactive mode).

    Regards,

    David
    “This posting is provided "AS IS" with no warranties, and confers no rights.”
  • Options
    PureHeartPureHeart Member Posts: 190
    David,

    What about my suggestion of calling a NAV Web Service from the Report itself?
    Why don't you try my compare tool?
    http://www.mibuso.com/dlinfo.asp?FileID=1123
  • Options
    ReinhardReinhard Member Posts: 249
    Or the report can store this number in a Navision table, where the next report can go retrieve it.
  • Options
    PureHeartPureHeart Member Posts: 190
    Well you can't do that without a web service or another way of communication...
    Can't save in the table as in classic nav....
    Why don't you try my compare tool?
    http://www.mibuso.com/dlinfo.asp?FileID=1123
  • Options
    MCMC Member Posts: 19
    Hi all, and thank you very much for your time,

    I thought about save the number of pages in a table, but this is a think that I only can do in classic version. Can I do this with web services? My customer needs a special licence to use a web service?

    I think we have lost this funcionality with the role tailored version.

    Another possibility it's that "report 2" calculates the number of pages in OnPostDataItem or in OnAfterGetRecord, considering number of records, the possible space of the Headers, GroupHeaders,Footers, GroupFooters. I think it's a mess, but the only solution if I don't want (or don't know how) to use web services.
  • Options
    PureHeartPureHeart Member Posts: 190
    MC wrote:
    Hi all, and thank you very much for your time,

    I thought about save the number of pages in a table, but this is a think that I only can do in classic version. Can I do this with web services? My customer needs a special licence to use a web service?

    I think we have lost this funcionality with the role tailored version.

    Another possibility it's that "report 2" calculates the number of pages in OnPostDataItem or in OnAfterGetRecord, considering number of records, the possible space of the Headers, GroupHeaders,Footers, GroupFooters. I think it's a mess, but the only solution if I don't want (or don't know how) to use web services.

    Yes it would be a messy solution...using web services from NAV to call NAV functionality should be "free" and in the licence but it is not an easy route....
    Otherwise you would have to let the user select the last printed page manually in the second report....or :( use the classic from the RTC...
    Why don't you try my compare tool?
    http://www.mibuso.com/dlinfo.asp?FileID=1123
Sign In or Register to comment.