Passing filter paramteres to report

nikeman77nikeman77 Member Posts: 517
hi everyone,

i would like to pass a parameters (filters) from form to reports, but unfortunately my reports are using only integer data item,

based on the filter set from forms (eg: g/l accnt, dimension views) i would then run the reports, customs the column layout/ caption accordingly prior to export to excel.

Answers

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Did you try by creating a function in report and passing filters via that funtion before running the report?
  • nikeman77nikeman77 Member Posts: 517
    hi mohana,

    i did, but it doesnt seems to work ..
  • nikeman77nikeman77 Member Posts: 517
    hi mohana,

    resolved it already, i cant call the functions and passparameters as i run the report calling the request forms... how silly
  • nikeman77nikeman77 Member Posts: 517
    meaning.. i cant call the functions, because in another line i am running a report, with calling request forms set as yes in the report.run parameters..
  • kmkaotkmkaot Member Posts: 261
    Dear I got some help already from our friends.

    Please my post and replies.
  • kmkaotkmkaot Member Posts: 261
    Dear,

    Please check..

    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;

    GLAcc.setrange("Date filter",fromdate,today);
    REPORT.RUN(6, false,TRUE,GLAcc);
    GLAcc record var of table 15
  • 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');
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    kmkaot wrote:
    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');
    Comment the above code and run the process..

    Go to path and check whether file is created or not..
  • kmkaotkmkaot Member Posts: 261
    [code
    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\SalesInvoice.html';

    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\SalesInvoice.html');

    smail.Send;

    MESSAGE('mail send');][/code]
Sign In or Register to comment.