Cursor position on Reports
 
            
                
                    hkrisz79                
                
                    Member Posts: 13                
            
                        
            
                    Hi there,
Is somebody knows, how can I ask Axapta to return cursor position in reports?
Cause' I want to make this:
If a report section larger than empty space on actual page, let's make a page break.
Thanks in advance!
Krisz
                Is somebody knows, how can I ask Axapta to return cursor position in reports?
Cause' I want to make this:
If a report section larger than empty space on actual page, let's make a page break.
Thanks in advance!
Krisz
Best Regards
Krisztian Hampuk
AX Consultant
Krisztian Hampuk
AX Consultant
0                
            Comments
- 
            Hi
 I solved it with a little function within the report.
 See attachment
 Gtrz
 OBJECT Report 50100 Sample
 {
 OBJECT-PROPERTIES
 {
 Date=24/10/08;
 Time=12:39:52;
 Modified=Yes;
 Version List=;
 }
 PROPERTIES
 {
 }
 DATAITEMS
 {
 { PROPERTIES
 {
 DataItemTable=Table36;
 DataItemTableView=SORTING(Document Type,No.)
 WHERE(Document Type=CONST(Order));
 ReqFilterFields=No.;
 }
 SECTIONS
 {
 { PROPERTIES
 {
 SectionType=Body;
 SectionWidth=13402;
 SectionHeight=2301;
 OnPreSection=BEGIN
 CurrReport.SHOWOUTPUT(CurrReport.PAGENO = 1);
 IF CurrReport.SHOWOUTPUT THEN
 QuantityPrinted := 0;
 END;
 }
 CONTROLS
 {
 { 1000000006;Label ;0 ;0 ;5250 ;423 ;CaptionML=ENU=Sales Header start }
 { 1000000007;Label ;0 ;1878 ;5250 ;423 ;CaptionML=ENU=Sales Header stop }
 }
 }
 }
 }
 { PROPERTIES
 {
 DataItemIndent=1;
 DataItemTable=Table37;
 DataItemTableView=SORTING(Document Type,Document No.,Line No.)
 WHERE(Document Type=CONST(Order));
 DataItemVarName=Smaller;
 OnAfterGetRecord=BEGIN
 QuantityPrinted := QuantityPrinted + 1;
 END;
 DataItemLink=Document Type=FIELD(Document Type),
 Document No.=FIELD(No.);
 }
 SECTIONS
 {
 { PROPERTIES
 {
 SectionType=Header;
 SectionWidth=13402;
 SectionHeight=846;
 OnPreSection=BEGIN
 //The section uses 2 lines thus number of lines must be 2 or more
 QuantityPrinted := QuantityPrinted + 2;
 END;
 }
 CONTROLS
 {
 { 1000000001;Label ;2752 ;0 ;2690 ;846 ;ParentControl=1000000000;
 HorzAlign=Right;
 VertAlign=Bottom;
 FontBold=Yes;
 MultiLine=Yes }
 { 1000000002;Label ;0 ;0 ;2796 ;423 ;CaptionML=ENU=Smaller }
 }
 }
 { PROPERTIES
 {
 SectionType=Body;
 SectionWidth=13402;
 SectionHeight=423;
 }
 CONTROLS
 {
 { 1000000000;TextBox;2841 ;0 ;2584 ;423 ;SourceExpr="Line No." }
 }
 }
 }
 }
 { PROPERTIES
 {
 DataItemIndent=1;
 DataItemTable=Table37;
 DataItemTableView=SORTING(Document Type,Document No.,Line No.)
 WHERE(Document Type=CONST(Order));
 DataItemVarName=Bigger;
 OnAfterGetRecord=BEGIN
 QuantityPrinted := QuantityPrinted + 1;
 END;
 DataItemLink=Document Type=FIELD(Document Type),
 Document No.=FIELD(No.);
 }
 SECTIONS
 {
 { PROPERTIES
 {
 SectionType=Header;
 SectionWidth=13402;
 SectionHeight=846;
 OnPreSection=BEGIN
 //The section uses 2 lines thus number of lines must be 2 or more
 QuantityPrinted := QuantityPrinted + 2;
 //Because you want the section to not start at the end of a page
 IF fctMaxLines(QuantityPrinted) THEN
 CurrReport.NEWPAGE;
 END;
 }
 CONTROLS
 {
 { 1000000003;Label ;2752 ;0 ;2690 ;846 ;ParentControl=1000000005;
 HorzAlign=Right;
 VertAlign=Bottom;
 FontBold=Yes;
 MultiLine=Yes }
 { 1000000004;Label ;0 ;0 ;2796 ;423 ;CaptionML=ENU=Bigger }
 }
 }
 { PROPERTIES
 {
 SectionType=Body;
 SectionWidth=13402;
 SectionHeight=423;
 }
 CONTROLS
 {
 { 1000000005;TextBox;2725 ;0 ;2584 ;423 ;SourceExpr="Line No." }
 }
 }
 }
 }
 }
 REQUESTFORM
 {
 PROPERTIES
 {
 Width=9020;
 Height=3410;
 }
 CONTROLS
 {
 }
 }
 CODE
 {
 VAR
 QuantityPrinted@1000000000 : Integer;
 PROCEDURE fctMaxLines@1000000001(lintLineNo@1000000000 : Integer) : Boolean;
 VAR
 lintMaxAmountLines@1000000001 : Integer;
 BEGIN
 IF CurrReport.PAGENO = 1 THEN
 lintMaxAmountLines := 3
 ELSE
 lintMaxAmountLines := 45;
 IF lintLineNo > lintMaxAmountLines THEN
 EXIT(TRUE);
 //If the number of printed lines exseed the MaxAmountLines value
 //the section that called the function shall return the value TRUE
 //If the select statement that called the function is TRUE the section will be printed on the a new page.
 //For this to work one has to keep track of the Amount "QuantityPrinted" of lines where printed.
 END;
 BEGIN
 END.
 }
 }0
- 
            Many thx!
 Regards.
 K.Best Regards
 Krisztian Hampuk
 AX Consultant0
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
- 323 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
