Help with report please

nazunazu Member Posts: 70
Hi Experts,

I am develeoping a report.If the report is having 13 records then the footer should be displayed on the first page itself.If its more than 13 then the foooter shuold be on next page but the max of records on page can be 25 & so on.The problem is my report is not showing correct page numbers where I display page # of total page count & the footer is also not diaplyaing correctly.

I am working on Nav 2009 SP1-Classic.

DATAITEMS
{
{ PROPERTIES
{
DataItemTable=Table38;
SECTIONS
{
{ PROPERTIES
{
PrintOnEveryPage=Yes;
OnPreSection=BEGIN
intPageNo := CurrReport.PAGENO;
END;

SectionType=Footer;
PrintOnEveryPage=No;
OnPreSection=BEGIN
txtPageNo := 'Page '+ FORMAT(intPageNo)+' of '+FORMAT(intNoPage);
END;

}

{ PROPERTIES
{
DataItemIndent=1;
DataItemTable=Table39;
DataItemTableView=SORTING(Document No.,Line No.);
OnPreDataItem=BEGIN
SrNo := 0;
intCountTemp := COUNT;
IF intCountTemp <= 13 THEN
intNoPage := 1
ELSE
intNoPage := intCountTemp DIV 13;
intLineCount := 0;
END;

OnAfterGetRecord=BEGIN
intSrNo := 0;
intLineCount += 1;

IF (intLineCount > 25) THEN BEGIN
intLineCount :=1;
CurrReport.NEWPAGE;
END;

IF "Purchase Line"."No."<> '' THEN BEGIN
intSrNo := SrNo + 1;
SrNo += 1;
END;


}
SECTIONS
{
{ PROPERTIES
{
SectionType=Body;
OnPostSection=BEGIN
intPrintCount += 1;
END;

}
{ PROPERTIES
{
SectionType=Footer;
PrintOnEveryPage=Yes;
SectionWidth=18150;
SectionHeight=977;
OnPreSection=BEGIN
CurrReport.SHOWOUTPUT((intPrintCount > 13)AND ((intPrintCount <= 25)));
txtPageNo := 'Page '+ FORMAT(intPageNo)+' of '+FORMAT(intNoPage);
END;

}

{ PROPERTIES
{
DataItemIndent=2;
DataItemTable=Table2000000026;
DataItemTableView=SORTING(Number);
DataItemVarName=Blank Line;
OnPreDataItem=BEGIN
IF (intLineCount <= 13) AND (intLineCount = intCountTemp) THEN
SETRANGE(Number,1,13-(intCountTemp))
ELSE
SETRANGE(Number,1,0);
IF CurrReport.PAGENO > 1 THEN BEGIN
IF (intLineCount > 13) AND (intLineCount < 25)THEN
SETRANGE(Number,1,13-(5));
END;
END;

}
CONTROLS
CODE
{
SrNo@1000000000 : Integer;
intSrNo@1000000027 : Integer;
i@1000000018 : Integer;
intLineCount@1000000016 : Integer;
intCount@1000000022 : Integer;
intCountTemp@1000000021 : Integer;
intCounter@1000000023 : Integer;
intMoreLines@1000000020 : Integer;
intNoPage@1000000042 : Integer;
intPrintCount@1000000043 : Integer;
intPageNo@1000000044 : Integer;
blnMoreLines@1000000039 : Boolean;
txtPageNo@1000000041 : Text[30];

Comments

  • vijay_gvijay_g Member Posts: 884
    let's know what you have done exactly using integer dataitem?

    what's need to paste report here? unless nobody would want to read this lenghty.
  • nazunazu Member Posts: 70
    Thanks for the reply.My intention behind pasting was I thought it would give a clear idea of my problem to others.
Sign In or Register to comment.