Help with report please

nazu
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];
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];
0
Comments
-
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.0 -
Thanks for the reply.My intention behind pasting was I thought it would give a clear idea of my problem to others.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions