Help with a report

DarkHorse
Member Posts: 389
Good morning, I've noticed that some reports that I have if there are final totals (created as a Createtotals on Dataitem) and these totals gives the casualty that appear at the top of the page it shows zero, but if there is just one more line it goes well beyond. I do not know if I explained. How can I fix this please?.
Thank you very much.
Thank you very much.
0
Comments
-
Thanks for reply. No, I don't have any transheader section. The totals are in a footer and on DataItem from that table footer I put the createtotals code.
Thank you.0 -
Sorry; from the code you mean or form the result?0
-
Ok. This is. Sorry because there are text and variables in my own languaje.
OBJECT Report 50130 { OBJECT-PROPERTIES { Fecha=13/03/09; Hora=12:34:02; Modificado=S¡; Lista versiones=ES2.00; } PROPERTIES { LeftMargin=1100; OnInitReport=BEGIN //Indica que usuarios no pueden acceder al report - Eloy. IF USERID = 'RMERCADER' THEN ERROR('No tiene permiso para ejecutar este report'); IF USERID = 'MFERNANDEZ' THEN ERROR('No tiene permiso para ejecutar este report'); IF USERID = 'DMARTIN' THEN ERROR('No tiene permiso para ejecutar este report'); IF USERID = 'CGONZALEZ' THEN ERROR('No tiene permiso para ejecutar este report'); IF USERID = 'AGUTIERREZ' THEN ERROR('No tiene permiso para ejecutar este report'); IF USERID = 'JCVAZQUEZ' THEN ERROR('No tiene permiso para ejecutar este report'); IF USERID = 'ABRUSTENGA' THEN ERROR('No tiene permiso para ejecutar este report'); IF USERID = 'HLAMA' THEN ERROR('No tiene permiso para ejecutar este report'); IF USERID = 'AVACAS' THEN ERROR('No tiene permiso para ejecutar este report'); IF USERID = 'GGOROSTIZAGA' THEN ERROR('No tiene permiso para ejecutar este report'); END; OnPreReport=BEGIN //FiltClient := Cliente.GETFILTERS; FiltroLinVenta := "Sales Line".GETFILTERS; NomPeriodo := "Sales Line".GETFILTER("Shipment Date"); END; } DATAITEMS { { PROPERTIES { DataItemTable=Table27; DataItemTableView=SORTING(Vendor No.); PrintOnlyIfDetail=No; OnPreDataItem=BEGIN CurrReport.NEWPAGEPERRECORD := ImpriSoloUnoporPag; CurrReport.CREATETOTALS(ImpPedVtaDL); CurrReport.CREATETOTALS(totent); CurrReport.CREATETOTALS(navi); CurrReport.CREATETOTALS(totsal); CurrReport.CREATETOTALS(totini); CurrReport.CREATETOTALS(eloy); CurrReport.CREATETOTALS(totot); CurrReport.CREATETOTALS(toti); CurrReport.CREATETOTALS(salida); END; ReqFilterFields=No.,Vendor No.,Familia,Inventory Posting Group,Location Code,Product Group Code; } SECTIONS { { PROPERTIES { SectionType=Header; PrintOnEveryPage=S¡; SectionWidth=19650; SectionHeight=1692; OnPreSection=BEGIN totini:=Inventory*"Unit Cost"; totent:="Unit Cost"*"Qty. on Purch. Order"; totsal:="Unit Cost"*"Qty. on Sales Order"; totot:=totini+totent-totsal; toti:=totini-salida; END; } CONTROLS { { 1 ;Label ;0 ;0 ;7500 ;423 ;FontSize=9; FontBold=S¡; CaptionML=ESP=C lculo previsi¢n Stock } { 2 ;TextBox ;15000;0 ;3150 ;423 ;HorzAlign=Right; SourceExpr=FORMAT(TODAY,0,4) } { 3 ;TextBox ;0 ;423 ;7500 ;423 ;SourceExpr='Fecha env¡o: ' + NomPeriodo } { 4 ;Label ;16950;423 ;750 ;423 ;ParentControl=5 } { 5 ;TextBox ;17700;423 ;450 ;423 ;CaptionML=ESP=P g.; SourceExpr=CurrReport.PAGENO } { 6 ;TextBox ;0 ;846 ;7500 ;423 ;SourceExpr=COMPANYNAME } { 7 ;TextBox ;15900;846 ;2250 ;423 ;HorzAlign=Right; SourceExpr=USERID } } } { PROPERTIES { SectionType=Header; SectionWidth=19650; SectionHeight=846; OnPreSection=BEGIN CurrReport.SHOWOUTPUT(ImprImportesEnDL); END; } CONTROLS { { 12 ;Label ;0 ;0 ;3000 ;423 ;CaptionML=ESP=Importes en divisa local. } } } { PROPERTIES { SectionType=Header; PrintOnEveryPage=S¡; SectionWidth=19650; SectionHeight=423; OnPreSection=BEGIN CurrReport.SHOWOUTPUT((CurrReport.PAGENO = 1) AND (FiltClient <> '')); END; } CONTROLS { { 9 ;TextBox ;0 ;0 ;18150;423 ;SourceExpr='test' } } } { PROPERTIES { SectionType=Header; PrintOnEveryPage=S¡; SectionWidth=19650; SectionHeight=423; OnPreSection=BEGIN CurrReport.SHOWOUTPUT((CurrReport.PAGENO = 1) AND (FiltroLinVenta <> '')); END; } CONTROLS { { 10 ;TextBox ;0 ;0 ;18150;423 ;SourceExpr='L¡n. venta: ' + FiltroLinVenta } } } { PROPERTIES { SectionType=Header; PrintOnEveryPage=S¡; SectionWidth=19650; SectionHeight=2115; OnPreSection=BEGIN //CurrReport.SHOWOUTPUT((CurrReport.PAGENO = 1) AND ((FiltClient <> '') OR (FiltroLinVenta <> ''))); END; } CONTROLS { { 13 ;Label ;8400 ;846 ;1800 ;846 ;HorzAlign=Center; VertAlign=Bottom; FontSize=8; FontBold=S¡; MultiLine=S¡; CaptionML=ESP=Existencias } { 44 ;Label ;0 ;846 ;3300 ;846 ;VertAlign=Bottom; FontSize=8; FontBold=S¡; MultiLine=S¡; CaptionML=ESP=Referencia } { 8 ;Label ;6750 ;0 ;5100 ;423 ;HorzAlign=Center; VertAlign=Bottom; FontSize=8; FontBold=S¡; MultiLine=S¡; CaptionML=ESP=STOCK INICIAL } { 22 ;Label ;13350;846 ;1800 ;846 ;ParentControl=21; HorzAlign=Center; VertAlign=Bottom; FontSize=8; FontBold=S¡; MultiLine=S¡ } { 62 ;Label ;17850;846 ;1650 ;846 ;HorzAlign=Center; VertAlign=Bottom; FontSize=8; FontBold=S¡; MultiLine=S¡; CaptionML=ESP=Valor Stock } { 104 ;Shape ;0 ;1692 ;19500;423 ;BorderWidth=Hairline; ShapeStyle=HorzLine } } } { PROPERTIES { SectionType=Body; SectionWidth=19650; SectionHeight=846; OnPreSection=BEGIN prove.INIT; nocompra:=TRUE; precio:=0; ptas:=0; IF prove.GET ("Vendor No.") THEN; ver:=TRUE; totini:=Inventory*"Unit Cost"; totent:="Unit Cost"*"Qty. on Purch. Order"; totsal:="Unit Cost"*eloy; navi:=totini; IF (navi=0) THEN CurrReport.SHOWOUTPUT(FALSE) ELSE CurrReport.SHOWOUTPUT(TRUE) ; END; } CONTROLS { { 24 ;TextBox ;0 ;423 ;6600 ;423 ;HorzAlign=Left; FontSize=8; FontBold=S¡; SourceExpr="No." } { 30 ;TextBox ;8400 ;423 ;1650 ;423 ;HorzAlign=Center; FontSize=7; SourceExpr=Inventory } { 21 ;TextBox ;13350;423 ;1800 ;423 ;HorzAlign=Center; SourceExpr="Unit Cost" } { 60 ;TextBox ;17850;423 ;1650 ;423 ;HorzAlign=Center; FontSize=8; FontBold=S¡; DecimalPlaces=3:3; SourceExpr=navi } { 63 ;TextBox ;15300;423 ;1050 ;423 ;Visible=No; HorzAlign=Center; SourceExpr=totini } { 76 ;TextBox ;16350;423 ;600 ;423 ;Visible=No; SourceExpr="Qty. on Purch. Order" } { 78 ;TextBox ;16950;423 ;750 ;423 ;Visible=No; SourceExpr="Qty. on Sales Order" } } } { PROPERTIES { SectionType=Footer; SectionWidth=19650; SectionHeight=2115; OnPreSection=BEGIN CurrReport.SHOWOUTPUT(ver); CurrReport.SHOWOUTPUT(NOT ImprImportesEnDL); END; } CONTROLS { { 64 ;Label ;0 ;846 ;2700 ;423 ;HorzAlign=Left; VertAlign=Bottom; FontSize=9; FontBold=S¡; MultiLine=S¡; CaptionML=ESP=Total Valor Stock: } { 67 ;TextBox ;2850 ;846 ;2250 ;423 ;HorzAlign=Center; FontSize=8; FontBold=S¡; DecimalPlaces=3:3; SourceExpr=navi } { 68 ;Label ;5550 ;846 ;2700 ;423 ;HorzAlign=Left; VertAlign=Bottom; FontSize=9; FontBold=S¡; MultiLine=S¡; CaptionML=ESP=T.Valor Entradas: } { 69 ;TextBox ;8400 ;846 ;2400 ;423 ;HorzAlign=Center; FontSize=8; FontBold=S¡; DecimalPlaces=0:3; SourceExpr=totent } { 70 ;Label ;11400;846 ;2550 ;423 ;HorzAlign=Left; VertAlign=Bottom; FontSize=9; FontBold=S¡; MultiLine=S¡; CaptionML=ESP=T.Valor Salidas: } { 71 ;TextBox ;14250;846 ;2400 ;423 ;HorzAlign=Center; FontSize=8; FontBold=S¡; DecimalPlaces=0:3; SourceExpr=salida } { 72 ;TextBox ;18150;846 ;600 ;423 ;Visible=No; HorzAlign=Center; FontSize=8; FontBold=S¡; DecimalPlaces=0:3; SourceExpr=totsal } { 73 ;Label ;11400;1692 ;2700 ;423 ;HorzAlign=Left; VertAlign=Bottom; FontSize=9; FontBold=S¡; MultiLine=S¡; CaptionML=ESP=Total Prevision: } { 66 ;TextBox ;14250;1692 ;2550 ;423 ;HorzAlign=Center; FontSize=8; FontBold=S¡; DecimalPlaces=0:3; SourceExpr=navi+totent-salida } } } } } { PROPERTIES { DataItemIndent=1; DataItemTable=Table37; DataItemTableView=SORTING(Document Type,Bill-to Customer No.,Currency Code) WHERE(Document Type=CONST(Order), Outstanding Quantity=FILTER(<>0), Document No.=FILTER(PV*|PM*)); ReqFilterHeadingML=ESP=L¡n. venta; OnPreDataItem=BEGIN CurrReport.CREATETOTALS(ImpPedVtaDL,ImpPedVta); CurrReport.CREATETOTALS(eloy); END; OnAfterGetRecord=BEGIN PedNuevo := "Document No." <> CabPedVta."No."; IF PedNuevo THEN CabPedVta.GET(1,"Document No."); IF "Shipment Date" <= WORKDATE THEN CdadPedPndte := "Outstanding Quantity" ELSE CdadPedPndte := 0; ImpPedVta := ROUND("Outstanding Quantity" * Amount / Quantity); ImpPedVtaDL := ImpPedVta; IF CabPedVta."Currency Code" <> '' THEN BEGIN IF CabPedVta."Currency Factor" <> 0 THEN ImpPedVtaDL := ROUND( TipoCambDivisa.ExchangeAmtFCYToLCY( WORKDATE,CabPedVta."Currency Code", ImpPedVtaDL,CabPedVta."Currency Factor")); IF ImprImportesEnDL THEN BEGIN "Unit Price" := ROUND( TipoCambDivisa.ExchangeAmtFCYToLCY( WORKDATE,CabPedVta."Currency Code", "Unit Price",CabPedVta."Currency Factor")); ImpPedVta := ImpPedVtaDL; END; END; CodDivisa2 := CabPedVta."Currency Code"; IF ImprImportesEnDL THEN CodDivisa2 := ''; MemIntTotDivisa.UpdateTotal( CodDivisa2, ImpPedVta, Contador1, Contador1); END; ReqFilterFields=Shipment Date; DataItemLink=No.=FIELD(No.); } SECTIONS { { PROPERTIES { SectionType=Header; SectionWidth=19650; SectionHeight=846; OnPreSection=BEGIN navi2:=navi; IF (navi=0) THEN CurrReport.SHOWOUTPUT(TRUE) ELSE CurrReport.SHOWOUTPUT(FALSE) ; END; } CONTROLS { { 87 ;TextBox ;0 ;423 ;6600 ;423 ;HorzAlign=Left; FontSize=8; FontBold=S¡; SourceExpr=Item."No." } { 89 ;TextBox ;8400 ;423 ;1650 ;423 ;HorzAlign=Center; FontSize=7; SourceExpr=Item.Inventory } { 90 ;TextBox ;13350;423 ;1800 ;423 ;HorzAlign=Center; SourceExpr=Item."Unit Cost" } { 94 ;TextBox ;17850;423 ;1650 ;423 ;HorzAlign=Center; FontSize=8; FontBold=S¡; DecimalPlaces=3:3; SourceExpr=navi2 } } } { PROPERTIES { SectionType=Header; SectionWidth=19650; SectionHeight=846; OnPreSection=BEGIN CurrReport.SHOWOUTPUT(ver); END; } CONTROLS { { 35 ;Label ;1350 ;423 ;1200 ;423 ;VertAlign=Bottom; FontBold=S¡; MultiLine=S¡; CaptionML=ESP=Doc } { 36 ;Label ;2700 ;423 ;5550 ;423 ;HorzAlign=Left; VertAlign=Bottom; FontBold=S¡; MultiLine=S¡; CaptionML=ESP=Cliente } { 41 ;Label ;8400 ;423 ;1650 ;423 ;HorzAlign=Center; VertAlign=Bottom; FontBold=S¡; MultiLine=S¡; CaptionML=ESP=Fecha Env. } { 52 ;Label ;10200;423 ;1650 ;423 ;ParentControl=51; HorzAlign=Center; VertAlign=Bottom; FontBold=S¡; MultiLine=S¡ } { 37 ;Label ;12600;423 ;1350 ;423 ;HorzAlign=Center; VertAlign=Bottom; FontBold=S¡; MultiLine=S¡; CaptionML=ESP=Total Ped. } { 40 ;Label ;14400;423 ;1800 ;423 ;HorzAlign=Center; VertAlign=Bottom; FontBold=S¡; MultiLine=S¡; CaptionML=ESP=Pendientes } { 56 ;Label ;18000;423 ;1500 ;423 ;HorzAlign=Center; VertAlign=Bottom; FontBold=S¡; MultiLine=S¡; CaptionML=ESP=Sub.Valor } { 61 ;Label ;13350;0 ;5250 ;423 ;HorzAlign=Center; VertAlign=Bottom; FontSize=8; FontBold=S¡; MultiLine=S¡; CaptionML=ESP=SALIDAS PREVISTAS } } } { PROPERTIES { SectionType=Body; SectionWidth=19650; SectionHeight=423; OnPreSection=BEGIN //CurrReport.SHOWOUTPUT((PedNuevo) AND (NOT ImprImportesEnDL)); clie.INIT; IF clie.GET("Sell-to Customer No.") THEN; divisa:=prove."Currency Code"; eloy:="Outstanding Quantity"; END; } CONTROLS { { 34 ;TextBox ;8400 ;0 ;1650 ;423 ;HorzAlign=Center; CaptionML=ESP=Fecha env¡o; SourceExpr="Shipment Date" } { 32 ;TextBox ;1350 ;0 ;1200 ;423 ;FontBold=S¡; CaptionML=ESP=N§ pedido; SourceExpr=CabPedVta."No." } { 38 ;TextBox ;12600;0 ;1350 ;423 ;HorzAlign=Center; SourceExpr=Quantity } { 39 ;TextBox ;14400;0 ;1650 ;423 ;HorzAlign=Center; FontSize=8; FontBold=No; SourceExpr="Outstanding Quantity" } { 15 ;TextBox ;2700 ;0 ;5550 ;423 ;SourceExpr=clie.Name } { 51 ;TextBox ;10200;0 ;1650 ;423 ;HorzAlign=Center; SourceExpr="Unit Price" } { 50 ;TextBox ;16050;0 ;150 ;423 ;Visible=No; HorzAlign=Center; FontSize=8; FontBold=S¡; SourceExpr=eloy } { 79 ;TextBox ;18000;0 ;1500 ;423 ;HorzAlign=Center; SourceExpr="Outstanding Quantity"*Item."Unit Cost" } } } { PROPERTIES { SectionType=Footer; SectionWidth=19650; SectionHeight=846; OnPreSection=BEGIN totsal:="Unit Cost"*eloy; salida:=totsal; lolo:=eloy; END; } CONTROLS { { 31 ;TextBox ;14400;0 ;1650 ;423 ;HorzAlign=Center; FontSize=8; FontBold=S¡; DecimalPlaces=3:3; SourceExpr=eloy } { 27 ;TextBox ;16050;0 ;300 ;423 ;Visible=No; HorzAlign=Center; DecimalPlaces=0:3; SourceExpr=totsal } { 80 ;TextBox ;18000;0 ;1500 ;423 ;HorzAlign=Center; FontSize=8; FontBold=S¡; DecimalPlaces=0:3; SourceExpr=salida } { 81 ;Label ;12450;0 ;1950 ;423 ;HorzAlign=Left; FontSize=8; FontBold=S¡; CaptionML=ESP=Total salidas: } { 83 ;Label ;16500;0 ;1500 ;423 ;HorzAlign=Left; FontSize=8; FontBold=S¡; CaptionML=ESP=Valor sal.: } { 88 ;TextBox ;12000;0 ;300 ;423 ;Visible=No; HorzAlign=Center; DecimalPlaces=0:3; SourceExpr=lolo } } } { PROPERTIES { SectionType=Footer; SectionWidth=19650; SectionHeight=846; OnPreSection=BEGIN IF (eloycompra < 0 ) OR (eloycompra = 0 ) THEN CurrReport.SHOWOUTPUT(TRUE) ELSE CurrReport.SHOWOUTPUT(FALSE) ; toti:=totini-salida; END; } CONTROLS { { 14 ;Label ;11100;0 ;3000 ;423 ;HorzAlign=Left; FontSize=8; FontBold=No; CaptionML=ESP=PV - Prevision Stock: } { 17 ;TextBox ;14100;0 ;1650 ;423 ;HorzAlign=Center; FontSize=8; FontBold=No; DecimalPlaces=0:3; SourceExpr=(Item.Inventory-lolo) } { 20 ;Label ;15750;0 ;1950 ;423 ;HorzAlign=Left; FontSize=8; FontBold=No; CaptionML=ESP=PV-Val. Prev.: } { 49 ;TextBox ;17700;0 ;1800 ;423 ;HorzAlign=Center; FontSize=8; FontBold=No; DecimalPlaces=0:3; SourceExpr=toti } } } } } { PROPERTIES { DataItemIndent=1; DataItemTable=Table39; DataItemTableView=WHERE(Document Type=FILTER(<>Quote)); OnPreDataItem=BEGIN CurrReport.CREATETOTALS(eloycompra); CurrReport.CREATETOTALS(eloy); END; ReqFilterFields=Fecha confirmaci¢n; DataItemLink=No.=FIELD(No.); } SECTIONS { { PROPERTIES { SectionType=Header; SectionWidth=19650; SectionHeight=846; OnPreSection=BEGIN navi2:=navi; IF (navi=0) THEN CurrReport.SHOWOUTPUT(TRUE) ELSE CurrReport.SHOWOUTPUT(FALSE) ; END; } CONTROLS { { 91 ;TextBox ;0 ;423 ;6600 ;423 ;HorzAlign=Left; FontSize=8; FontBold=S¡; SourceExpr=Item."No." } { 92 ;TextBox ;8400 ;423 ;1650 ;423 ;HorzAlign=Center; FontSize=7; SourceExpr=Item.Inventory } { 93 ;TextBox ;13350;423 ;1800 ;423 ;HorzAlign=Center; SourceExpr=Item."Unit Cost" } { 95 ;TextBox ;17850;423 ;1650 ;423 ;HorzAlign=Center; FontSize=8; FontBold=S¡; DecimalPlaces=3:3; SourceExpr=navi2 } } } { PROPERTIES { SectionType=Header; SectionWidth=19650; SectionHeight=846; } CONTROLS { { 47 ;Label ;1350 ;423 ;1200 ;423 ;VertAlign=Bottom; FontBold=S¡; MultiLine=S¡; CaptionML=ESP=Doc } { 46 ;Label ;2700 ;423 ;5400 ;423 ;HorzAlign=Left; VertAlign=Bottom; FontBold=S¡; MultiLine=S¡; CaptionML=ESP=Proveedor } { 45 ;Label ;8250 ;423 ;1950 ;423 ;ParentControl=18; HorzAlign=Center; VertAlign=Bottom; FontBold=S¡; MultiLine=S¡; CaptionML=ESP=Fecha Confirm. } { 29 ;Label ;10350;423 ;1800 ;423 ;ParentControl=28; HorzAlign=Center; VertAlign=Bottom; FontBold=S¡; MultiLine=S¡ } { 43 ;Label ;12600;423 ;1500 ;423 ;HorzAlign=Center; VertAlign=Bottom; FontBold=S¡; MultiLine=S¡; CaptionML=ESP=Total Ped. } { 33 ;Label ;14400;423 ;1650 ;423 ;HorzAlign=Center; VertAlign=Bottom; FontBold=S¡; MultiLine=S¡; CaptionML=ESP=Pendientes } { 82 ;Label ;18000;423 ;1500 ;423 ;HorzAlign=Center; VertAlign=Bottom; FontBold=S¡; MultiLine=S¡; CaptionML=ESP=Sub.Valor } { 25 ;Label ;13350;0 ;5100 ;423 ;HorzAlign=Center; VertAlign=Bottom; FontSize=8; FontBold=S¡; MultiLine=S¡; CaptionML=ESP=ENTRADAS PREVISTAS } } } { PROPERTIES { SectionType=Body; SectionWidth=19650; SectionHeight=423; OnPreSection=BEGIN prove.INIT; precio:="Direct Unit Cost"; IF prove.GET("Buy-from Vendor No.") THEN; divisa:=prove."Currency Code"; eloycompra:="Outstanding Quantity"; END; } CONTROLS { { 11 ;TextBox ;1350 ;0 ;1200 ;423 ;FontBold=S¡; SourceExpr="Document No." } { 19 ;TextBox ;2700 ;0 ;5400 ;423 ;SourceExpr=prove.Name } { 23 ;TextBox ;14400;0 ;1650 ;423 ;HorzAlign=Center; FontSize=7; FontBold=No; SourceExpr="Outstanding Quantity" } { 42 ;TextBox ;12600;0 ;1500 ;423 ;HorzAlign=Center; SourceExpr=Quantity } { 28 ;TextBox ;10350;0 ;1800 ;423 ;HorzAlign=Center; FontItalic=S¡; DecimalPlaces=0:4; SourceExpr="Direct Unit Cost" } { 18 ;TextBox ;8250 ;0 ;1950 ;423 ;HorzAlign=Center; SourceExpr="Fecha confirmaci¢n" } { 59 ;TextBox ;16200;0 ;300 ;423 ;Visible=No; HorzAlign=Center; FontSize=8; FontBold=S¡; SourceExpr=eloycompra } { 86 ;TextBox ;18000;0 ;1500 ;423 ;HorzAlign=Center; SourceExpr="Outstanding Quantity"*Item."Unit Cost" } } } { PROPERTIES { SectionType=Footer; SectionWidth=19650; SectionHeight=846; OnPreSection=BEGIN totent:=Item."Unit Cost"*eloycompra; pocho:=eloycompra END; } CONTROLS { { 48 ;TextBox ;14400;0 ;1650 ;423 ;HorzAlign=Center; FontSize=8; FontBold=S¡; SourceExpr=eloycompra } { 65 ;TextBox ;17700;0 ;1800 ;423 ;HorzAlign=Center; FontSize=8; FontBold=S¡; DecimalPlaces=0:3; SourceExpr=totent } { 84 ;Label ;12150;0 ;2250 ;423 ;HorzAlign=Left; FontSize=8; FontBold=S¡; CaptionML=ESP=Total entradas: } { 85 ;Label ;16050;0 ;1650 ;423 ;HorzAlign=Left; FontSize=8; FontBold=S¡; CaptionML=ESP=Valor ent.: } { 100 ;TextBox ;11550;0 ;300 ;423 ;Visible=No; HorzAlign=Center; FontSize=8; FontBold=No; SourceExpr=pocho } } } { PROPERTIES { SectionType=Footer; SectionWidth=19650; SectionHeight=846; OnPreSection=BEGIN IF (eloy < 0 ) OR (eloy = 0 ) THEN CurrReport.SHOWOUTPUT(TRUE) ELSE CurrReport.SHOWOUTPUT(FALSE) ; totite:=totini+totent; END; } CONTROLS { { 96 ;Label ;11400;0 ;3000 ;423 ;HorzAlign=Left; FontSize=8; FontBold=No; CaptionML=ESP=PC - Prevision Stock: } { 97 ;TextBox ;14400;0 ;1650 ;423 ;HorzAlign=Center; FontSize=8; FontBold=No; DecimalPlaces=0:3; SourceExpr=(Item.Inventory+pocho) } { 98 ;Label ;16050;0 ;1950 ;423 ;HorzAlign=Left; FontSize=8; FontBold=No; CaptionML=ESP=PC-Val. Prev.: } { 99 ;TextBox ;18000;0 ;1500 ;423 ;HorzAlign=Center; FontSize=8; FontBold=No; DecimalPlaces=0:3; SourceExpr=totite } } } { PROPERTIES { SectionType=Footer; SectionWidth=19650; SectionHeight=1269; OnPreSection=BEGIN IF (toti=0) OR (totite = 0 ) THEN CurrReport.SHOWOUTPUT(FALSE) ELSE CurrReport.SHOWOUTPUT(TRUE) ; totot:=(totini+totent)-salida; END; } CONTROLS { { 74 ;Label ;9600 ;0 ;4200 ;423 ;HorzAlign=Left; FontSize=10; FontBold=S¡; CaptionML=ESP=TOTAL Prevision Stock : } { 75 ;TextBox ;13800;0 ;1650 ;423 ;HorzAlign=Center; FontSize=9; FontBold=S¡; DecimalPlaces=0:3; SourceExpr=(Item.Inventory+eloycompra)-lolo } { 77 ;Label ;15450;0 ;2100 ;423 ;HorzAlign=Left; FontSize=10; FontBold=S¡; CaptionML=ESP=Valor Prev.: } { 26 ;TextBox ;17550;0 ;1950 ;423 ;HorzAlign=Center; FontSize=9; FontBold=S¡; DecimalPlaces=0:3; SourceExpr=totot } } } } } { PROPERTIES { DataItemIndent=1; DataItemTable=Table123; DataItemLink=No.=FIELD(No.); } SECTIONS { { PROPERTIES { SectionType=Body; SectionWidth=19650; SectionHeight=0; OnPreSection=BEGIN nocompra:=FALSE; prove.INIT; precio:="Direct Unit Cost"; IF prove.GET("Buy-from Vendor No.") THEN; divisa:=prove."Currency Code"; CurrReport.SHOWOUTPUT(ver); IF (navi=0) AND ("Unit Cost"=0) OR (Item.Inventory=0) AND ("Unit Cost"=0) THEN CurrReport.SHOWOUTPUT(FALSE) ELSE CurrReport.SHOWOUTPUT(TRUE) ; END; } CONTROLS { } } { PROPERTIES { SectionType=Footer; SectionWidth=19650; SectionHeight=423; OnPreSection=BEGIN CurrReport.SHOWOUTPUT(ver); IF (navi=0) THEN CurrReport.SHOWOUTPUT(FALSE) ELSE CurrReport.SHOWOUTPUT(TRUE) ; END; } CONTROLS { { 53 ;Label ;0 ;0 ;3944 ;423 ;Visible=No; HorzAlign=Left; FontSize=8; FontBold=S¡; CaptionML=ESP=éltimo Precio de Compra : } { 54 ;TextBox ;3900 ;0 ;1500 ;423 ;Visible=No; HorzAlign=Center; FontSize=7; FontBold=S¡; DecimalPlaces=0:4; SourceExpr=precio } { 55 ;TextBox ;5400 ;0 ;1500 ;423 ;Visible=No; HorzAlign=Left; FontSize=7; FontBold=S¡; SourceExpr=divisa } } } } } { PROPERTIES { DataItemIndent=1; DataItemTable=Table32; DataItemTableView=SORTING(Entry Type,Item No.,Variant Code,Drop Shipment,Location Code,Posting Date) ORDER(Ascending) WHERE(Entry Type=FILTER(Purchase)); DataItemLink=Item No.=FIELD(No.); } SECTIONS { { PROPERTIES { SectionType=Header; SectionWidth=19650; SectionHeight=0; OnPreSection=BEGIN IF Item.Inventory>0 THEN CurrReport.SHOWOUTPUT(ver); END; } CONTROLS { } } { PROPERTIES { SectionType=Body; SectionWidth=19650; SectionHeight=0; OnPreSection=BEGIN MovValor.SETRANGE("Item Ledger Entry Type","Item Ledger Entry"."Entry Type"); MovValor.SETRANGE("Entry No.","Item Ledger Entry"."Entry No."); IF MovValor."Cost per Unit" <> 0 THEN ptas:=MovValor."Cost per Unit"; nocompra:=FALSE; END; } CONTROLS { } } { PROPERTIES { SectionType=Footer; SectionWidth=19650; SectionHeight=423; OnPreSection=BEGIN CurrReport.SHOWOUTPUT(ver); IF (navi=0) THEN CurrReport.SHOWOUTPUT(FALSE) ELSE CurrReport.SHOWOUTPUT(TRUE) ; END; } CONTROLS { { 57 ;Label ;0 ;0 ;7050 ;423 ;Visible=No; HorzAlign=Left; FontSize=8; FontBold=S¡; CaptionML=ESP=éltimo Precio de Compra Registrado (en euros) : } { 58 ;TextBox ;7050 ;0 ;1500 ;423 ;Visible=No; HorzAlign=Center; FontSize=7; FontBold=S¡; DecimalPlaces=0:4; SourceExpr=ptas } } } } } { PROPERTIES { DataItemIndent=1; DataItemTable=Table2000000026; DataItemTableView=SORTING(N£mero) WHERE(N£mero=FILTER(1..)); OnAfterGetRecord=BEGIN IF N£mero = 1 THEN Aceptar := MemIntTotDivisa.FIND('-') ELSE Aceptar := MemIntTotDivisa.NEXT <> 0; IF NOT Aceptar THEN CurrReport.BREAK; MemIntTotDivisa2.UpdateTotal( MemIntTotDivisa."Currency Code", MemIntTotDivisa."Total Amount", Contador1, Contador1); END; OnPostDataItem=BEGIN MemIntTotDivisa.DELETEALL; END; } SECTIONS { { PROPERTIES { SectionType=Body; SectionWidth=19650; SectionHeight=423; OnPreSection=BEGIN CurrReport.SHOWOUTPUT(nocompra AND ver); nocompra:=FALSE; IF (navi=0) THEN CurrReport.SHOWOUTPUT(FALSE) ELSE CurrReport.SHOWOUTPUT(TRUE) ; END; } CONTROLS { { 16 ;Label ;0 ;0 ;15750;423 ;Visible=No; HorzAlign=Left; FontSize=8; FontBold=S¡; CaptionML=ESP=éltimo Precio de Compra : Nunca ha registrado una Compra de este Producto en Navision ! } } } { PROPERTIES { SectionType=Footer; SectionWidth=19650; SectionHeight=0; OnPreSection=BEGIN CurrReport.SHOWOUTPUT(nocompra AND ver); nocompra:=FALSE; END; } CONTROLS { } } } } { PROPERTIES { DataItemTable=Table2000000026; DataItemTableView=SORTING(N£mero) WHERE(N£mero=FILTER(1..)); DataItemVarName=Entero2; OnAfterGetRecord=BEGIN IF N£mero = 1 THEN Aceptar := MemIntTotDivisa2.FIND('-') ELSE Aceptar := MemIntTotDivisa2.NEXT <> 0; IF NOT Aceptar THEN CurrReport.BREAK; CurrReport.CREATETOTALS(totsal); CurrReport.CREATETOTALS(totini); CurrReport.CREATETOTALS(totent); CurrReport.CREATETOTALS(toti); CurrReport.CREATETOTALS(totot); CurrReport.CREATETOTALS(eloy); CurrReport.CREATETOTALS(navi); CurrReport.CREATETOTALS(salida); END; OnPostDataItem=BEGIN MemIntTotDivisa2.DELETEALL; END; } SECTIONS { { PROPERTIES { SectionType=Body; SectionWidth=19650; SectionHeight=0; OnPreSection=BEGIN //CurrReport.SHOWOUTPUT(ImprImportesEnDL); IF (navi=0) THEN CurrReport.SHOWOUTPUT(FALSE) ELSE CurrReport.SHOWOUTPUT(TRUE) ; END; } CONTROLS { } } { PROPERTIES { SectionType=Body; SectionWidth=19650; SectionHeight=0; OnPreSection=BEGIN CurrReport.SHOWOUTPUT(NOT ImprImportesEnDL); IF (navi=0) THEN CurrReport.SHOWOUTPUT(FALSE) ELSE CurrReport.SHOWOUTPUT(TRUE) ; END; } CONTROLS { } } } } } REQUESTFORM { PROPERTIES { Width=3850; Height=990; SaveValues=S¡; } CONTROLS { { 1 ;CheckBox ;3410 ;0 ;440 ;440 ;ShowCaption=No; CaptionML=ESP=Mostrar importes en DL; SourceExpr=ImprImportesEnDL } { 21 ;Label ;0 ;0 ;3300 ;440 ;ParentControl=1 } { 2 ;CheckBox ;3410 ;550 ;440 ;440 ;ShowCaption=No; CaptionML=ESP=P gina nueva por cliente; SourceExpr=ImpriSoloUnoporPag } { 22 ;Label ;0 ;550 ;3300 ;440 ;ParentControl=2 } } } CODE { VAR TipoCambDivisa@1103351000 : Record 330; MemIntTotDivisa@1103351001 : TEMPORARY Record 332; MemIntTotDivisa2@1103351002 : TEMPORARY Record 332; CabPedVta@1103351003 : Record 36; FiltClient@1103351004 : Text[250]; FiltroLinVenta@1103351005 : Text[250]; ImpPedVta@1103351006 : Decimal; ImpPedVtaDL@1103351007 : Decimal; ImprImportesEnDL@1103351008 : Boolean; NomPeriodo@1103351009 : Text[30]; ImpriSoloUnoporPag@1103351010 : Boolean; CdadPedPndte@1103351011 : Decimal; PedNuevo@1103351012 : Boolean; Aceptar@1103351013 : Boolean; Contador1@1103351014 : Integer; CodDivisa2@1103351015 : Code[10]; prove@1103351016 : Record 23; clie@1103351017 : Record 18; ver@1103351018 : Boolean; precio@1103351019 : Decimal; nocompra@1103351020 : Boolean; divisa@1103351021 : Text[10]; ptas@1103351022 : Decimal; totini@1103351023 : Decimal; totent@1103351024 : Decimal; totsal@1103351025 : Decimal; totot@1103351026 : Decimal; linventa@1103351027 : Record 37; eloy@1103351028 : Decimal; proveedor@1103351029 : Record 23; eloycompra@1103351030 : Decimal; produc@1103351031 : Record 27; lincompra@1103351032 : Record 39; navi@1103351033 : Decimal; salida@1103351034 : Decimal; lolo@1103351035 : Decimal; toti@1103351036 : Decimal; navi2@1103351037 : Decimal; totite@1103351038 : Decimal; pocho@1103351039 : Decimal; MovValor@1103351040 : Record 5802; BEGIN END. } }
0 -
Hi Darkhorse,
I noticed that you have a lot of logic in the OnPreSection of your report. I moved it into the OnAfterGetRecord.OBJECT Report 50130 Problem Report { OBJECT-PROPERTIES { Date=16/03/09; Time=10:15:16; Modified=Yes; Version List=ITSW1.4.02.01; } PROPERTIES { LeftMargin=1100; OnInitReport=BEGIN //Indica que usuarios no pueden acceder al report - Eloy. IF (USERID = 'RMERCADER') OR (USERID = 'MFERNANDEZ') OR (USERID = 'DMARTIN') OR (USERID = 'CGONZALEZ') OR (USERID = 'AGUTIERREZ') OR (USERID = 'JCVAZQUEZ') OR (USERID = 'ABRUSTENGA') OR (USERID = 'HLAMA') OR (USERID = 'AVACAS') OR (USERID = 'GGOROSTIZAGA') THEN ERROR('No tiene permiso para ejecutar este report'); END; OnPreReport=BEGIN //FiltClient := Cliente.GETFILTERS; FiltroLinVenta := "Sales Line".GETFILTERS; NomPeriodo := "Sales Line".GETFILTER("Shipment Date"); END; } DATAITEMS { { PROPERTIES { DataItemTable=Table27; DataItemTableView=SORTING(Vendor No.); PrintOnlyIfDetail=No; OnPreDataItem=BEGIN CurrReport.NEWPAGEPERRECORD := ImpriSoloUnoporPag; CurrReport.CREATETOTALS(ImpPedVtaDL,totent,navi,totsal,totini,eloy,totot,toti,salida); END; OnAfterGetRecord=BEGIN prove.INIT; nocompra := TRUE; precio := 0; ptas := 0; IF prove.GET("Vendor No.") THEN; ver := TRUE; totini := Inventory * "Unit Cost"; totent := "Unit Cost" * "Qty. on Purch. Order"; totsal := "Unit Cost" * eloy; navi := totini; totot := totini + totent - totsal; toti := totini - salida; navi2 := navi; END; ReqFilterFields=No.,Vendor No.,Familia,Inventory Posting Group,Location Code,Product Group Code; } SECTIONS { { PROPERTIES { SectionType=Header; PrintOnEveryPage=Yes; SectionWidth=19650; SectionHeight=1692; } CONTROLS { { 1 ;Label ;0 ;0 ;7500 ;423 ;FontSize=9; FontBold=Yes; CaptionML=ESP=C lculo previsi¢n Stock } { 2 ;TextBox ;15000;0 ;3150 ;423 ;HorzAlign=Right; SourceExpr=FORMAT(TODAY,0,4) } { 3 ;TextBox ;0 ;423 ;7500 ;423 ;SourceExpr='Fecha env¡o: ' + NomPeriodo } { 4 ;Label ;16950;423 ;750 ;423 ;ParentControl=5 } { 5 ;TextBox ;17700;423 ;450 ;423 ;CaptionML=ESP=P g.; SourceExpr=CurrReport.PAGENO } { 6 ;TextBox ;0 ;846 ;7500 ;423 ;SourceExpr=COMPANYNAME } { 7 ;TextBox ;15900;846 ;2250 ;423 ;HorzAlign=Right; SourceExpr=USERID } } } { PROPERTIES { SectionType=Header; SectionWidth=19650; SectionHeight=846; OnPreSection=BEGIN CurrReport.SHOWOUTPUT(ImprImportesEnDL); END; } CONTROLS { { 12 ;Label ;0 ;0 ;3000 ;423 ;CaptionML=ESP=Importes en divisa local. } } } { PROPERTIES { SectionType=Header; PrintOnEveryPage=Yes; SectionWidth=19650; SectionHeight=423; OnPreSection=BEGIN CurrReport.SHOWOUTPUT := (CurrReport.PAGENO = 1) AND (FiltClient <> ''); END; } CONTROLS { { 9 ;TextBox ;0 ;0 ;18150;423 ;SourceExpr='test' } } } { PROPERTIES { SectionType=Header; PrintOnEveryPage=Yes; SectionWidth=19650; SectionHeight=423; OnPreSection=BEGIN CurrReport.SHOWOUTPUT := (CurrReport.PAGENO = 1) AND (FiltroLinVenta <> ''); END; } CONTROLS { { 10 ;TextBox ;0 ;0 ;18150;423 ;SourceExpr='L¡n. venta: ' + FiltroLinVenta } } } { PROPERTIES { SectionType=Header; PrintOnEveryPage=Yes; SectionWidth=19650; SectionHeight=2115; OnPreSection=BEGIN //CurrReport.SHOWOUTPUT((CurrReport.PAGENO = 1) AND ((FiltClient <> '') OR (FiltroLinVenta <> ''))); END; } CONTROLS { { 13 ;Label ;8400 ;846 ;1800 ;846 ;HorzAlign=Center; VertAlign=Bottom; FontSize=8; FontBold=Yes; MultiLine=Yes; CaptionML=ESP=Existencias } { 44 ;Label ;0 ;846 ;3300 ;846 ;VertAlign=Bottom; FontSize=8; FontBold=Yes; MultiLine=Yes; CaptionML=ESP=Referencia } { 8 ;Label ;6750 ;0 ;5100 ;423 ;HorzAlign=Center; VertAlign=Bottom; FontSize=8; FontBold=Yes; MultiLine=Yes; CaptionML=ESP=STOCK INICIAL } { 22 ;Label ;13350;846 ;1800 ;846 ;ParentControl=21; HorzAlign=Center; VertAlign=Bottom; FontSize=8; FontBold=Yes; MultiLine=Yes } { 62 ;Label ;17850;846 ;1650 ;846 ;HorzAlign=Center; VertAlign=Bottom; FontSize=8; FontBold=Yes; MultiLine=Yes; CaptionML=ESP=Valor Stock } { 104 ;Shape ;0 ;1692 ;19500;423 ;BorderWidth=Hairline; ShapeStyle=HorzLine } } } { PROPERTIES { SectionType=Body; SectionWidth=19650; SectionHeight=846; OnPreSection=BEGIN CurrReport.SHOWOUTPUT := navi <> 0; END; } CONTROLS { { 24 ;TextBox ;0 ;423 ;6600 ;423 ;HorzAlign=Left; FontSize=8; FontBold=Yes; SourceExpr="No." } { 30 ;TextBox ;8400 ;423 ;1650 ;423 ;HorzAlign=Center; FontSize=7; SourceExpr=Inventory } { 21 ;TextBox ;13350;423 ;1800 ;423 ;HorzAlign=Center; SourceExpr="Unit Cost" } { 60 ;TextBox ;17850;423 ;1650 ;423 ;HorzAlign=Center; FontSize=8; FontBold=Yes; DecimalPlaces=3:3; SourceExpr=navi } { 63 ;TextBox ;15300;423 ;1050 ;423 ;Visible=No; HorzAlign=Center; SourceExpr=totini } { 76 ;TextBox ;16350;423 ;600 ;423 ;Visible=No; SourceExpr="Qty. on Purch. Order" } { 78 ;TextBox ;16950;423 ;750 ;423 ;Visible=No; SourceExpr="Qty. on Sales Order" } } } { PROPERTIES { SectionType=Footer; SectionWidth=19650; SectionHeight=2115; OnPreSection=BEGIN CurrReport.SHOWOUTPUT(ver); CurrReport.SHOWOUTPUT(NOT ImprImportesEnDL); END; } CONTROLS { { 64 ;Label ;0 ;846 ;2700 ;423 ;HorzAlign=Left; VertAlign=Bottom; FontSize=9; FontBold=Yes; MultiLine=Yes; CaptionML=ESP=Total Valor Stock: } { 67 ;TextBox ;2850 ;846 ;2250 ;423 ;HorzAlign=Center; FontSize=8; FontBold=Yes; DecimalPlaces=3:3; SourceExpr=navi } { 68 ;Label ;5550 ;846 ;2700 ;423 ;HorzAlign=Left; VertAlign=Bottom; FontSize=9; FontBold=Yes; MultiLine=Yes; CaptionML=ESP=T.Valor Entradas: } { 69 ;TextBox ;8400 ;846 ;2400 ;423 ;HorzAlign=Center; FontSize=8; FontBold=Yes; DecimalPlaces=0:3; SourceExpr=totent } { 70 ;Label ;11400;846 ;2550 ;423 ;HorzAlign=Left; VertAlign=Bottom; FontSize=9; FontBold=Yes; MultiLine=Yes; CaptionML=ESP=T.Valor Salidas: } { 71 ;TextBox ;14250;846 ;2400 ;423 ;HorzAlign=Center; FontSize=8; FontBold=Yes; DecimalPlaces=0:3; SourceExpr=salida } { 72 ;TextBox ;18150;846 ;600 ;423 ;Visible=No; HorzAlign=Center; FontSize=8; FontBold=Yes; DecimalPlaces=0:3; SourceExpr=totsal } { 73 ;Label ;11400;1692 ;2700 ;423 ;HorzAlign=Left; VertAlign=Bottom; FontSize=9; FontBold=Yes; MultiLine=Yes; CaptionML=ESP=Total Prevision: } { 66 ;TextBox ;14250;1692 ;2550 ;423 ;HorzAlign=Center; FontSize=8; FontBold=Yes; DecimalPlaces=0:3; SourceExpr=navi+totent-salida } } } } } { PROPERTIES { DataItemIndent=1; DataItemTable=Table37; DataItemTableView=SORTING(Document Type,Bill-to Customer No.,Currency Code) WHERE(Document Type=CONST(Order), Outstanding Quantity=FILTER(<>0), Document No.=FILTER(PV*|PM*)); ReqFilterHeadingML=ESP=L¡n. venta; OnPreDataItem=BEGIN CurrReport.CREATETOTALS(ImpPedVtaDL,ImpPedVta,eloy); END; OnAfterGetRecord=BEGIN clie.INIT; IF clie.GET("Sell-to Customer No.") THEN; divisa := prove."Currency Code"; eloy := "Outstanding Quantity"; PedNuevo := "Document No." <> CabPedVta."No."; IF PedNuevo THEN CabPedVta.GET(1,"Document No."); IF "Shipment Date" <= WORKDATE THEN CdadPedPndte := "Outstanding Quantity" ELSE CdadPedPndte := 0; ImpPedVta := ROUND("Outstanding Quantity" * Amount / Quantity); ImpPedVtaDL := ImpPedVta; IF CabPedVta."Currency Code" <> '' THEN BEGIN IF CabPedVta."Currency Factor" <> 0 THEN ImpPedVtaDL := ROUND( TipoCambDivisa.ExchangeAmtFCYToLCY( WORKDATE,CabPedVta."Currency Code", ImpPedVtaDL,CabPedVta."Currency Factor")); IF ImprImportesEnDL THEN BEGIN "Unit Price" := ROUND( TipoCambDivisa.ExchangeAmtFCYToLCY( WORKDATE,CabPedVta."Currency Code", "Unit Price",CabPedVta."Currency Factor")); ImpPedVta := ImpPedVtaDL; END; END; CodDivisa2 := CabPedVta."Currency Code"; IF ImprImportesEnDL THEN CodDivisa2 := ''; MemIntTotDivisa.UpdateTotal( CodDivisa2, ImpPedVta, Contador1, Contador1); totsal := "Unit Cost" * eloy; salida := totsal; lolo := eloy; toti := totini - salida; END; ReqFilterFields=Shipment Date; DataItemLink=No.=FIELD(No.); } SECTIONS { { PROPERTIES { SectionType=Header; SectionWidth=19650; SectionHeight=846; OnPreSection=BEGIN CurrReport.SHOWOUTPUT := navi = 0; END; } CONTROLS { { 87 ;TextBox ;0 ;423 ;6600 ;423 ;HorzAlign=Left; FontSize=8; FontBold=Yes; SourceExpr=Item."No." } { 89 ;TextBox ;8400 ;423 ;1650 ;423 ;HorzAlign=Center; FontSize=7; SourceExpr=Item.Inventory } { 90 ;TextBox ;13350;423 ;1800 ;423 ;HorzAlign=Center; SourceExpr=Item."Unit Cost" } { 94 ;TextBox ;17850;423 ;1650 ;423 ;HorzAlign=Center; FontSize=8; FontBold=Yes; DecimalPlaces=3:3; SourceExpr=navi2 } } } { PROPERTIES { SectionType=Header; SectionWidth=19650; SectionHeight=846; OnPreSection=BEGIN CurrReport.SHOWOUTPUT(ver); END; } CONTROLS { { 35 ;Label ;1350 ;423 ;1200 ;423 ;VertAlign=Bottom; FontBold=Yes; MultiLine=Yes; CaptionML=ESP=Doc } { 36 ;Label ;2700 ;423 ;5550 ;423 ;HorzAlign=Left; VertAlign=Bottom; FontBold=Yes; MultiLine=Yes; CaptionML=ESP=Cliente } { 41 ;Label ;8400 ;423 ;1650 ;423 ;HorzAlign=Center; VertAlign=Bottom; FontBold=Yes; MultiLine=Yes; CaptionML=ESP=Fecha Env. } { 52 ;Label ;10200;423 ;1650 ;423 ;ParentControl=51; HorzAlign=Center; VertAlign=Bottom; FontBold=Yes; MultiLine=Yes } { 37 ;Label ;12600;423 ;1350 ;423 ;HorzAlign=Center; VertAlign=Bottom; FontBold=Yes; MultiLine=Yes; CaptionML=ESP=Total Ped. } { 40 ;Label ;14400;423 ;1800 ;423 ;HorzAlign=Center; VertAlign=Bottom; FontBold=Yes; MultiLine=Yes; CaptionML=ESP=Pendientes } { 56 ;Label ;18000;423 ;1500 ;423 ;HorzAlign=Center; VertAlign=Bottom; FontBold=Yes; MultiLine=Yes; CaptionML=ESP=Sub.Valor } { 61 ;Label ;13350;0 ;5250 ;423 ;HorzAlign=Center; VertAlign=Bottom; FontSize=8; FontBold=Yes; MultiLine=Yes; CaptionML=ESP=SALIDAS PREVISTAS } } } { PROPERTIES { SectionType=Body; SectionWidth=19650; SectionHeight=423; OnPreSection=BEGIN //CurrReport.SHOWOUTPUT((PedNuevo) AND (NOT ImprImportesEnDL)); END; } CONTROLS { { 34 ;TextBox ;8400 ;0 ;1650 ;423 ;HorzAlign=Center; CaptionML=ESP=Fecha env¡o; SourceExpr="Shipment Date" } { 32 ;TextBox ;1350 ;0 ;1200 ;423 ;FontBold=Yes; CaptionML=ESP=N§ pedido; SourceExpr=CabPedVta."No." } { 38 ;TextBox ;12600;0 ;1350 ;423 ;HorzAlign=Center; SourceExpr=Quantity } { 39 ;TextBox ;14400;0 ;1650 ;423 ;HorzAlign=Center; FontSize=8; FontBold=No; SourceExpr="Outstanding Quantity" } { 15 ;TextBox ;2700 ;0 ;5550 ;423 ;SourceExpr=clie.Name } { 51 ;TextBox ;10200;0 ;1650 ;423 ;HorzAlign=Center; SourceExpr="Unit Price" } { 50 ;TextBox ;16050;0 ;150 ;423 ;Visible=No; HorzAlign=Center; FontSize=8; FontBold=Yes; SourceExpr=eloy } { 79 ;TextBox ;18000;0 ;1500 ;423 ;HorzAlign=Center; SourceExpr="Outstanding Quantity"*Item."Unit Cost" } } } { PROPERTIES { SectionType=Footer; SectionWidth=19650; SectionHeight=846; } CONTROLS { { 31 ;TextBox ;14400;0 ;1650 ;423 ;HorzAlign=Center; FontSize=8; FontBold=Yes; DecimalPlaces=3:3; SourceExpr=eloy } { 27 ;TextBox ;16050;0 ;300 ;423 ;Visible=No; HorzAlign=Center; DecimalPlaces=0:3; SourceExpr=totsal } { 80 ;TextBox ;18000;0 ;1500 ;423 ;HorzAlign=Center; FontSize=8; FontBold=Yes; DecimalPlaces=0:3; SourceExpr=salida } { 81 ;Label ;12450;0 ;1950 ;423 ;HorzAlign=Left; FontSize=8; FontBold=Yes; CaptionML=ESP=Total salidas: } { 83 ;Label ;16500;0 ;1500 ;423 ;HorzAlign=Left; FontSize=8; FontBold=Yes; CaptionML=ESP=Valor sal.: } { 88 ;TextBox ;12000;0 ;300 ;423 ;Visible=No; HorzAlign=Center; DecimalPlaces=0:3; SourceExpr=lolo } } } { PROPERTIES { SectionType=Footer; SectionWidth=19650; SectionHeight=846; OnPreSection=BEGIN CurrReport.SHOWOUTPUT := eloycompra <= 0; END; } CONTROLS { { 14 ;Label ;11100;0 ;3000 ;423 ;HorzAlign=Left; FontSize=8; FontBold=No; CaptionML=ESP=PV - Prevision Stock: } { 17 ;TextBox ;14100;0 ;1650 ;423 ;HorzAlign=Center; FontSize=8; FontBold=No; DecimalPlaces=0:3; SourceExpr=(Item.Inventory-lolo) } { 20 ;Label ;15750;0 ;1950 ;423 ;HorzAlign=Left; FontSize=8; FontBold=No; CaptionML=ESP=PV-Val. Prev.: } { 49 ;TextBox ;17700;0 ;1800 ;423 ;HorzAlign=Center; FontSize=8; FontBold=No; DecimalPlaces=0:3; SourceExpr=toti } } } } } { PROPERTIES { DataItemIndent=1; DataItemTable=Table39; DataItemTableView=WHERE(Document Type=FILTER(<>Quote)); OnPreDataItem=BEGIN CurrReport.CREATETOTALS(eloycompra,eloy); END; OnAfterGetRecord=BEGIN prove.INIT; precio := "Direct Unit Cost"; IF prove.GET("Buy-from Vendor No.") THEN; divisa := prove."Currency Code"; eloycompra := "Outstanding Quantity"; totent := Item."Unit Cost" * eloycompra; pocho := eloycompra navi2 := navi; totot:= (totini + totent) - salida; END; ReqFilterFields=Fecha confirmaci¢n; DataItemLink=No.=FIELD(No.); } SECTIONS { { PROPERTIES { SectionType=Header; SectionWidth=19650; SectionHeight=846; OnPreSection=BEGIN CurrReport.SHOWOUTPUT := navi = 0; END; } CONTROLS { { 91 ;TextBox ;0 ;423 ;6600 ;423 ;HorzAlign=Left; FontSize=8; FontBold=Yes; SourceExpr=Item."No." } { 92 ;TextBox ;8400 ;423 ;1650 ;423 ;HorzAlign=Center; FontSize=7; SourceExpr=Item.Inventory } { 93 ;TextBox ;13350;423 ;1800 ;423 ;HorzAlign=Center; SourceExpr=Item."Unit Cost" } { 95 ;TextBox ;17850;423 ;1650 ;423 ;HorzAlign=Center; FontSize=8; FontBold=Yes; DecimalPlaces=3:3; SourceExpr=navi2 } } } { PROPERTIES { SectionType=Header; SectionWidth=19650; SectionHeight=846; } CONTROLS { { 47 ;Label ;1350 ;423 ;1200 ;423 ;VertAlign=Bottom; FontBold=Yes; MultiLine=Yes; CaptionML=ESP=Doc } { 46 ;Label ;2700 ;423 ;5400 ;423 ;HorzAlign=Left; VertAlign=Bottom; FontBold=Yes; MultiLine=Yes; CaptionML=ESP=Proveedor } { 45 ;Label ;8250 ;423 ;1950 ;423 ;ParentControl=18; HorzAlign=Center; VertAlign=Bottom; FontBold=Yes; MultiLine=Yes; CaptionML=ESP=Fecha Confirm. } { 29 ;Label ;10350;423 ;1800 ;423 ;ParentControl=28; HorzAlign=Center; VertAlign=Bottom; FontBold=Yes; MultiLine=Yes } { 43 ;Label ;12600;423 ;1500 ;423 ;HorzAlign=Center; VertAlign=Bottom; FontBold=Yes; MultiLine=Yes; CaptionML=ESP=Total Ped. } { 33 ;Label ;14400;423 ;1650 ;423 ;HorzAlign=Center; VertAlign=Bottom; FontBold=Yes; MultiLine=Yes; CaptionML=ESP=Pendientes } { 82 ;Label ;18000;423 ;1500 ;423 ;HorzAlign=Center; VertAlign=Bottom; FontBold=Yes; MultiLine=Yes; CaptionML=ESP=Sub.Valor } { 25 ;Label ;13350;0 ;5100 ;423 ;HorzAlign=Center; VertAlign=Bottom; FontSize=8; FontBold=Yes; MultiLine=Yes; CaptionML=ESP=ENTRADAS PREVISTAS } } } { PROPERTIES { SectionType=Body; SectionWidth=19650; SectionHeight=423; } CONTROLS { { 11 ;TextBox ;1350 ;0 ;1200 ;423 ;FontBold=Yes; SourceExpr="Document No." } { 19 ;TextBox ;2700 ;0 ;5400 ;423 ;SourceExpr=prove.Name } { 23 ;TextBox ;14400;0 ;1650 ;423 ;HorzAlign=Center; FontSize=7; FontBold=No; SourceExpr="Outstanding Quantity" } { 42 ;TextBox ;12600;0 ;1500 ;423 ;HorzAlign=Center; SourceExpr=Quantity } { 28 ;TextBox ;10350;0 ;1800 ;423 ;HorzAlign=Center; FontItalic=Yes; DecimalPlaces=0:4; SourceExpr="Direct Unit Cost" } { 18 ;TextBox ;8250 ;0 ;1950 ;423 ;HorzAlign=Center; SourceExpr="Fecha confirmaci¢n" } { 59 ;TextBox ;16200;0 ;300 ;423 ;Visible=No; HorzAlign=Center; FontSize=8; FontBold=Yes; SourceExpr=eloycompra } { 86 ;TextBox ;18000;0 ;1500 ;423 ;HorzAlign=Center; SourceExpr="Outstanding Quantity"*Item."Unit Cost" } } } { PROPERTIES { SectionType=Footer; SectionWidth=19650; SectionHeight=846; } CONTROLS { { 48 ;TextBox ;14400;0 ;1650 ;423 ;HorzAlign=Center; FontSize=8; FontBold=Yes; SourceExpr=eloycompra } { 65 ;TextBox ;17700;0 ;1800 ;423 ;HorzAlign=Center; FontSize=8; FontBold=Yes; DecimalPlaces=0:3; SourceExpr=totent } { 84 ;Label ;12150;0 ;2250 ;423 ;HorzAlign=Left; FontSize=8; FontBold=Yes; CaptionML=ESP=Total entradas: } { 85 ;Label ;16050;0 ;1650 ;423 ;HorzAlign=Left; FontSize=8; FontBold=Yes; CaptionML=ESP=Valor ent.: } { 100 ;TextBox ;11550;0 ;300 ;423 ;Visible=No; HorzAlign=Center; FontSize=8; FontBold=No; SourceExpr=pocho } } } { PROPERTIES { SectionType=Footer; SectionWidth=19650; SectionHeight=846; OnPreSection=BEGIN CurrReport.SHOWOUTPUT := (eloy <= 0); END; } CONTROLS { { 96 ;Label ;11400;0 ;3000 ;423 ;HorzAlign=Left; FontSize=8; FontBold=No; CaptionML=ESP=PC - Prevision Stock: } { 97 ;TextBox ;14400;0 ;1650 ;423 ;HorzAlign=Center; FontSize=8; FontBold=No; DecimalPlaces=0:3; SourceExpr=(Item.Inventory+pocho) } { 98 ;Label ;16050;0 ;1950 ;423 ;HorzAlign=Left; FontSize=8; FontBold=No; CaptionML=ESP=PC-Val. Prev.: } { 99 ;TextBox ;18000;0 ;1500 ;423 ;HorzAlign=Center; FontSize=8; FontBold=No; DecimalPlaces=0:3; SourceExpr=totite } } } { PROPERTIES { SectionType=Footer; SectionWidth=19650; SectionHeight=1269; OnPreSection=BEGIN CurrReport.SHOWOUTPUT := (toti <> 0) OR (totite <> 0); END; } CONTROLS { { 74 ;Label ;9600 ;0 ;4200 ;423 ;HorzAlign=Left; FontSize=10; FontBold=Yes; CaptionML=ESP=TOTAL Prevision Stock : } { 75 ;TextBox ;13800;0 ;1650 ;423 ;HorzAlign=Center; FontSize=9; FontBold=Yes; DecimalPlaces=0:3; SourceExpr=(Item.Inventory+eloycompra)-lolo } { 77 ;Label ;15450;0 ;2100 ;423 ;HorzAlign=Left; FontSize=10; FontBold=Yes; CaptionML=ESP=Valor Prev.: } { 26 ;TextBox ;17550;0 ;1950 ;423 ;HorzAlign=Center; FontSize=9; FontBold=Yes; DecimalPlaces=0:3; SourceExpr=totot } } } } } { PROPERTIES { DataItemIndent=1; DataItemTable=Table123; OnAfterGetRecord=BEGIN nocompra := FALSE; prove.INIT; precio := "Direct Unit Cost"; IF prove.GET("Buy-from Vendor No.") THEN; divisa := prove."Currency Code"; END; DataItemLink=No.=FIELD(No.); } SECTIONS { { PROPERTIES { SectionType=Body; SectionWidth=19650; SectionHeight=0; OnPreSection=BEGIN CurrReport.SHOWOUTPUT(ver); CurrReport.SHOWOUTPUT := (navi <> 0) AND ("Unit Cost" <> 0) OR (Item.Inventory <> 0) AND ("Unit Cost" <> 0) END; } CONTROLS { } } { PROPERTIES { SectionType=Footer; SectionWidth=19650; SectionHeight=423; OnPreSection=BEGIN CurrReport.SHOWOUTPUT(ver); CurrReport.SHOWOUTPUT := navi <> 0; END; } CONTROLS { { 53 ;Label ;0 ;0 ;3944 ;423 ;Visible=No; HorzAlign=Left; FontSize=8; FontBold=Yes; CaptionML=ESP=éltimo Precio de Compra : } { 54 ;TextBox ;3900 ;0 ;1500 ;423 ;Visible=No; HorzAlign=Center; FontSize=7; FontBold=Yes; DecimalPlaces=0:4; SourceExpr=precio } { 55 ;TextBox ;5400 ;0 ;1500 ;423 ;Visible=No; HorzAlign=Left; FontSize=7; FontBold=Yes; SourceExpr=divisa } } } } } { PROPERTIES { DataItemIndent=1; DataItemTable=Table32; DataItemTableView=SORTING(Entry Type,Item No.,Variant Code,Drop Shipment,Location Code,Posting Date) ORDER(Ascending) WHERE(Entry Type=FILTER(Purchase)); OnAfterGetRecord=BEGIN MovValor.SETRANGE("Item Ledger Entry Type","Item Ledger Entry"."Entry Type"); MovValor.SETRANGE("Entry No.","Item Ledger Entry"."Entry No."); IF MovValor."Cost per Unit" <> 0 THEN ptas := MovValor."Cost per Unit"; nocompra := FALSE; END; DataItemLink=Item No.=FIELD(No.); } SECTIONS { { PROPERTIES { SectionType=Header; SectionWidth=19650; SectionHeight=0; OnPreSection=BEGIN CurrReport.SHOWOUTPUT := ver and (Item.Inventory > 0); END; } CONTROLS { } } { PROPERTIES { SectionType=Body; SectionWidth=19650; SectionHeight=0; } CONTROLS { } } { PROPERTIES { SectionType=Footer; SectionWidth=19650; SectionHeight=423; OnPreSection=BEGIN CurrReport.SHOWOUTPUT(ver); CurrReport.SHOWOUTPUT := navi <> 0; END; } CONTROLS { { 57 ;Label ;0 ;0 ;7050 ;423 ;Visible=No; HorzAlign=Left; FontSize=8; FontBold=Yes; CaptionML=ESP=éltimo Precio de Compra Registrado (en euros) : } { 58 ;TextBox ;7050 ;0 ;1500 ;423 ;Visible=No; HorzAlign=Center; FontSize=7; FontBold=Yes; DecimalPlaces=0:4; SourceExpr=ptas } } } } } { PROPERTIES { DataItemIndent=1; DataItemTable=Table2000000026; DataItemTableView=SORTING(N£mero) WHERE(N£mero=FILTER(1..)); OnAfterGetRecord=BEGIN IF N£mero = 1 THEN Aceptar := MemIntTotDivisa.FIND('-') ELSE Aceptar := MemIntTotDivisa.NEXT <> 0; IF NOT Aceptar THEN CurrReport.BREAK; nocompra := FALSE; MemIntTotDivisa2.UpdateTotal( MemIntTotDivisa."Currency Code", MemIntTotDivisa."Total Amount", Contador1, Contador1); END; OnPostDataItem=BEGIN MemIntTotDivisa.DELETEALL; END; } SECTIONS { { PROPERTIES { SectionType=Body; SectionWidth=19650; SectionHeight=423; OnPreSection=BEGIN CurrReport.SHOWOUTPUT(nocompra AND ver); CurrReport.SHOWOUTPUT := navi <> 0; END; } CONTROLS { { 16 ;Label ;0 ;0 ;15750;423 ;Visible=No; HorzAlign=Left; FontSize=8; FontBold=Yes; CaptionML=ESP=éltimo Precio de Compra : Nunca ha registrado una Compra de este Producto en Navision ! } } } { PROPERTIES { SectionType=Footer; SectionWidth=19650; SectionHeight=0; OnPreSection=BEGIN CurrReport.SHOWOUTPUT(nocompra AND ver); END; } CONTROLS { } } } } { PROPERTIES { DataItemTable=Table2000000026; DataItemTableView=SORTING(N£mero) WHERE(N£mero=FILTER(1..)); DataItemVarName=Entero2; OnAfterGetRecord=BEGIN IF N£mero = 1 THEN Aceptar := MemIntTotDivisa2.FIND('-') ELSE Aceptar := MemIntTotDivisa2.NEXT <> 0; IF NOT Aceptar THEN CurrReport.BREAK; CurrReport.CREATETOTALS(totsal); CurrReport.CREATETOTALS(totini); CurrReport.CREATETOTALS(totent); CurrReport.CREATETOTALS(toti); CurrReport.CREATETOTALS(totot); CurrReport.CREATETOTALS(eloy); CurrReport.CREATETOTALS(navi); CurrReport.CREATETOTALS(salida); END; OnPostDataItem=BEGIN MemIntTotDivisa2.DELETEALL; END; } SECTIONS { { PROPERTIES { SectionType=Body; SectionWidth=19650; SectionHeight=0; OnPreSection=BEGIN //CurrReport.SHOWOUTPUT(ImprImportesEnDL); CurrReport.SHOWOUTPUT := navi <> 0; END; } CONTROLS { } } { PROPERTIES { SectionType=Body; SectionWidth=19650; SectionHeight=0; OnPreSection=BEGIN CurrReport.SHOWOUTPUT := NOT ImprImportesEnDL; CurrReport.SHOWOUTPUT := navi <> 0; END; } CONTROLS { } } } } } REQUESTFORM { PROPERTIES { Width=3850; Height=990; SaveValues=Yes; } CONTROLS { { 1 ;CheckBox ;3410 ;0 ;440 ;440 ;ShowCaption=No; CaptionML=ESP=Mostrar importes en DL; SourceExpr=ImprImportesEnDL } { 21 ;Label ;0 ;0 ;3300 ;440 ;ParentControl=1 } { 2 ;CheckBox ;3410 ;550 ;440 ;440 ;ShowCaption=No; CaptionML=ESP=P gina nueva por cliente; SourceExpr=ImpriSoloUnoporPag } { 22 ;Label ;0 ;550 ;3300 ;440 ;ParentControl=2 } } } CODE { VAR TipoCambDivisa@1103351000 : Record 330; MemIntTotDivisa@1103351001 : TEMPORARY Record 332; MemIntTotDivisa2@1103351002 : TEMPORARY Record 332; CabPedVta@1103351003 : Record 36; FiltClient@1103351004 : Text[250]; FiltroLinVenta@1103351005 : Text[250]; ImpPedVta@1103351006 : Decimal; ImpPedVtaDL@1103351007 : Decimal; ImprImportesEnDL@1103351008 : Boolean; NomPeriodo@1103351009 : Text[30]; ImpriSoloUnoporPag@1103351010 : Boolean; CdadPedPndte@1103351011 : Decimal; PedNuevo@1103351012 : Boolean; Aceptar@1103351013 : Boolean; Contador1@1103351014 : Integer; CodDivisa2@1103351015 : Code[10]; prove@1103351016 : Record 23; clie@1103351017 : Record 18; ver@1103351018 : Boolean; precio@1103351019 : Decimal; nocompra@1103351020 : Boolean; divisa@1103351021 : Text[10]; ptas@1103351022 : Decimal; totini@1103351023 : Decimal; totent@1103351024 : Decimal; totsal@1103351025 : Decimal; totot@1103351026 : Decimal; linventa@1103351027 : Record 37; eloy@1103351028 : Decimal; proveedor@1103351029 : Record 23; eloycompra@1103351030 : Decimal; produc@1103351031 : Record 27; lincompra@1103351032 : Record 39; navi@1103351033 : Decimal; salida@1103351034 : Decimal; lolo@1103351035 : Decimal; toti@1103351036 : Decimal; navi2@1103351037 : Decimal; totite@1103351038 : Decimal; pocho@1103351039 : Decimal; MovValor@1103351040 : Record 5802; BEGIN END. } }
Hope this helps.
Albert
PS. You may have to change Yes to Si and also the Date,Time and Version List0 -
Thanks for reply. I've to do serveral testings yet but I think it's solved!!!!.
Thank you very much for your help and time. =D>0 -
Hi DarkHorse,
Glad to help
Albert0
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