Report parameters

kmkaotkmkaot Member Posts: 261
Dear all,

can anybody help me as I need to send Parameters dynamically from form or codeunit

I need to know how to pass dates range

REPORT.RUN(Number [, ReqWindow] [, SystemPrinter] [, Record])

how give parameter record with dates ex 01.01.11..31/12/11

Warm Regards
KMK

Comments

  • vijay_gvijay_g Member Posts: 884
    Did you check how is posted voucher report running from general ledger entry form.\

    Try it..
    Record.setrange("Posting Date")
    REPORT.RUN(Number [, ReqWindow] [, SystemPrinter] [, Record])
    
  • kmkaotkmkaot Member Posts: 261
    Dear Mr. Vijay,

    Thank you advice.

    your caption is very nice.

    do you want create record as global variable?
    what type?

    Warm Regards
    KMK
  • vijay_gvijay_g Member Posts: 884
    Doesn't matter if it is global or local only the thing it must be in used in report dataitem.

    PS: Check posted voucher report being print from gl entry form.
  • kmkaotkmkaot Member Posts: 261
    Sorry vijay I forgot to tell you that I need pass parametrs to my Trial balance from code unit.
    as shown below



    fromdate :=0D;
    // Accounting period table
    acp.reset;
    acp.SETFILTER(acp."New Fiscal Year",'yes') ;
    IF acp.FINDFIRST THEN
    REPEAT
    IF DATE2DMY(WORKDATE,3)=DATE2DMY(acp."Starting Date",3) THEN
    fromdate:=acp."Starting Date"
    UNTIL acp.NEXT = 0;

    // Now I have two dates available

    //Record.setrange(fromdate,today);
    REPORT.RUN(6, false,TRUE,Record);

    It looks silly for you, as I am just functional worker.

    Warm regards
    kmk
  • vijay_gvijay_g Member Posts: 884
    Try this...
    GLAcc.setrange("Date filter",fromdate,today);
    REPORT.RUN(6, false,TRUE,GLAcc);
    GLAcc record var of table 15
    
  • ssinglassingla Member Posts: 2,973
    vijay_g wrote:
    Doesn't matter if it is global or local only the thing it must be in used in report dataitem.

    PS: Check posted voucher report being print from gl entry form.

    Be careful when you quote Voucher report to members of countries other than India. Its part of Indian localization and may not be available to other members. G/L Register or other standard W1 reports should be quoted.
    CA Sandeep Singla
    http://ssdynamics.co.in
  • kmkaotkmkaot Member Posts: 261
    I am getting an error

    'The Operating system cant access to the file 'd:\kmk\Sales Invoice.pdf'
    Verify the file type and Atrubutes are correct.'

    my code is
    ==================
    fromdate :=0D;
    acp.SETFILTER(acp."New Fiscal Year",'yes') ;
    IF acp.FINDFIRST THEN
    REPEAT
    IF DATE2DMY(WORKDATE,3)=DATE2DMY(acp."Starting Date",3) THEN
    fromdate:=acp."Starting Date"
    UNTIL acp.NEXT = 0;

    ltxtFileName:='d:\kmk\Sales Invoice.pdf';

    GLAcc.SETRANGE("Date Filter",fromdate,TODAY);

    REPORT.SAVEASHTML(6, ltxtFileName, FALSE,GLAcc);
    CLEAR(smail);
    smail.CreateMessage('ERP Admin','krishna@alotaiba.ae','kneni@hotmail.com','yr P and L',
    'Item 50005 has a inventory below minimum in',FALSE);

    smail.AddAttachment('d:\kmk\Sales Invoice.pdf');

    smail.Send;

    MESSAGE('mail send');
    ======================
    can anybody help
    KMK
  • skullaskulla Member Posts: 140
    In your code you are saving report as HTML not as PDF, change that to REPORT.SAVEASPDF or change the file name.
Sign In or Register to comment.