Hi,
in customer card there is an option to setup customer wise document layout.
but when I want run from Sale order for report 1305 for sell-to-customer , it is not working for custom layout. I am getting result for RDLC report.
I think there is some confusion in the communication
I have several report layouts (word) for one report example 1305. for example I have agreement (sales order) for prepaid contract and post paid contract. from the sale order I update layout code in 9657 table and I run report. It is okay working in Sales quote page but not in Sales order page.
In sale Order
-----------------------------------
on page action
Salesquote.CustomerReportLayout("Sell-to Customer No.","Document Type",Segment);
COMMIT;
DocPrint.PrintSalesOrder(Rec,Usage::"Order Confirmation");
Function
-----------------------
External] CustomerReportLayout(CustNo : Code[20];Doctype : 'Quote,Order,Invoice';Segm : Code[10])
Segmas.RESET;
Segmas.SETFILTER("Segment Id",Segm);
IF Segmas.FINDSET THEN
BEGIN
IF (Segmas."Quote Report Layout"<>'') AND (Doctype=Doctype::Quote) THEN
BEGIN
custlay.RESET;
custlay.SETRANGE(Usage,18);
custlay.SETRANGE("Source No.",CustNo);
custlay.SETRANGE(Usage,custlay.Usage::"S.Quote");
custlay.SETRANGE("Report ID",1304);
IF custlay.FINDFIRST THEN
custlay.VALIDATE(custlay."Custom Report Layout Code",Segmas."Quote Report Layout")
ELSE BEGIN
custlay.INIT;
custlay.VALIDATE(custlay."Source Type",18);
custlay.VALIDATE(custlay."Source No.",CustNo);
custlay.VALIDATE(custlay.Usage,custlay.Usage::"S.Quote");
custlay.VALIDATE(custlay."Report ID",1304);
custlay.VALIDATE(custlay."Custom Report Layout Code",Segmas."Quote Report Layout");
custlay.INSERT;
END;
END;
IF (Segmas."Order Report Layout"<>'') AND (Doctype=Doctype::Order) THEN
BEGIN
custlay.RESET;
custlay.SETRANGE(Usage,18);
custlay.SETRANGE("Source No.",CustNo);
custlay.SETRANGE(Usage,custlay.Usage::"S.Order");
custlay.SETRANGE("Report ID",1305);
IF custlay.FINDFIRST THEN
custlay.VALIDATE(custlay."Custom Report Layout Code",Segmas."Order Report Layout")
ELSE BEGIN
custlay.INIT;
custlay.VALIDATE(custlay."Source Type",18);
custlay.VALIDATE(custlay."Source No.",CustNo);
custlay.VALIDATE(custlay.Usage,custlay.Usage::"S.Order");
custlay.VALIDATE(custlay."Report ID",1305);
custlay.VALIDATE(custlay."Custom Report Layout Code",Segmas."Order Report Layout");
custlay.INSERT;
END;
END;
END;
Can anyone help me
Warm Regards
Krish