Report.close or something?

ambamb Member Posts: 14
Hi,

I try to explain my problem:

I run a report. Now, I want to close this report, but not only quit or break. I want to close the window the report is inside.

Something like this: CurrReport.close

thx 4 help,
amb

Comments

  • krikikriki Member, Moderator Posts: 9,110
    What do you mean with:
    I want to close the window the report is inside.

    Normally I would use
    CurrReport.QUIT;

    or I may also try

    ERROR('');

    This last one is not advised because if the report is part of a batch of commands, this batch will be interupted.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • ambamb Member Posts: 14
    Hi kriki,

    thx, I mean:

    if I use CurrReport.quit the report stop, no problem, but I want to "close" the report in OnInitReport(). F.e. I want to close the window, in which I can setup the filter before I start the report.

    If I start the report and use CurrReport.quit, I must use "ESC" or something to see the form I´ve used before.

    I hope you understand what I mean.

    Regards,
    amb
  • krikikriki Member, Moderator Posts: 9,110
    If I understood correctly :
    you don't want to run the report, without showing the request-form or just the part for selecting a set of records

    -don't show the request form=>the report has a property "UseReqForm" : put this to No.

    -don't show the filters=>the dataitems have some properties:
    DataItemTableView : in this you put the key you want
    ReqFilterFields : don't put any fields in this one
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • ambamb Member Posts: 14
    No, I know the property.

    I save a report with a password. The inputbox, which is getting the password is loaded in OnInitReport().

    That´s my code:

    OnInitReport()
    window.OPEN('Passwort #1########');
    window.INPUT(1,Password);
    window.CLOSE;
    Login.INIT;
    IF NOT Login.GET('Reportentry') THEN
    ERROR('Benutzer: "Reportentry" existiert nicht!');
    Hash := Login.Kennwort;
    Login.VALIDATE(Kennwort,LOWERCASE(Password));
    IF (Login.Kennwort = Hash) THEN
    BEGIN
    END ELSE
    MESSAGE('Password false!');

    If the password is not correct, the user doesn´t see the request-form because he isn´t allowed to see the report.
    Something like "CurrReport.UseReqForm := no" instead of "MESSAGE('Password false!')" in my code can be a solution.

    thx,
    amb
  • krikikriki Member, Moderator Posts: 9,110
    If the user may NOT run the report, you can put

    ERROR('Password false!');

    instead of
    MESSAGE('Password false!');


    If the user may run the report, but may not see the requestform, you can put
    CurrReport.USEREQUESTFORM(FALSE)
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • ambamb Member Posts: 14
    thx kriki,

    that seems to be a good solution.

    thanks for replying.
  • afarrafarr Member Posts: 287
    If you want to close a report without showing the request form, you could use the following code in OnInitReport:
    CurrReport.USEREQUESTFORM := FALSE;
    CurrReport.QUIT;
    

    For some reason, CurrReport.QUIT on its own doesn't work, and RequestOptionsForm.CLOSE also doesn't seem to have any effect.

    See also my post at http://www.mibuso.com/forum/viewtopic.php?f=5&t=29159
    Alastair Farrugia
  • mootsoomootsoo Member Posts: 70
    Hi all
    I have one problem again.
    How i need to do show one form when closing report?
    It's mean report/form checkbox/-> preview-> report previewed->close report /click on "X"/ -> if form checkbox checked then form will show

    merry christmas & happy new year
    bye my work, bye navision
  • krikikriki Member, Moderator Posts: 9,110
    This is only possible doing it from the object that calls the report with a RUNMODAL-command. After running the report, you need to ask the report (through a function in it) which is the value of your boolean. If it is true, you run your form.

    In the report, create a function like this:
    FUNCTION ShowForm(): AS BOOLEAN
    EXIT(blnShowTheForm);
    END;

    In the object where you call your report:
    ...
    repTheReport.RUNMODAL;
    IF repTheReport.ShowForm() THEN BEGIN
    FORM.RUNMODAL(FORM::"The Form"); // you can also use RUN in stead of RUNMODAL
    END;
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • mootsoomootsoo Member Posts: 70
    Ok
    thanks kriki

    Regards
    bye my work, bye navision
Sign In or Register to comment.