Options

Processing only report with preview option

mabl4367mabl4367 Member Posts: 143
Hi all!

What is the best way to create a processing only report with a preview option?

I have created a report for updateing wich implies it should have it's processing only property set to "Yes". However I want the user to be able to get a preview before letting the updates be written to the database.

When the user has seen the preview and is confident that the korrect updates will be preformed he or she usualy don't need a printout.

The only thing I can come up with is to make the report processing only and add a button to the request form that when pushed launches another report that creates the preview. This is not a very elegant solution since it requiers another report object with lots of duplicated code and the sending of keystrokes to immediately make it go into preview mode.

Any ideas?

Comments

  • Options
    ShedmanShedman Member Posts: 194
    You could create a report that shows the users which changes will be made. After a confirm in the OnPostReport trigger you can call the procedures to perform the update.
  • Options
    einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    You can also disable printout by
    IF NOT CurrReport.PREVIEW THEN
      CurrReport.QUIT;
    

    But maybe it is better to use a form based on a temporary table to show the possible changes to the user and add a button on that form to agree to the changes.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • Options
    mabl4367mabl4367 Member Posts: 143
    A form based on a temp table would be nice but it is not supported in nav 3.70 that we are on.
  • Options
    SogSog Member Posts: 1,023
    If that is the limitation, the currreport.preview is your golden if.
    IF it is preview then show the user what will change, if it is not then calculate and process the report.
    But the processingonly property has to be false.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • Options
    mabl4367mabl4367 Member Posts: 143
    Perhaps i could use an integer data item to go through the oter data items twice and make a confirm-dialog appear after the first run.
  • Options
    mabl4367mabl4367 Member Posts: 143
    If it's not the preview the user must have hit the print button. Then I can do the updates but I will also get a printout that I don't want :(
  • Options
    AndreDAndreD Member Posts: 1
    In such cases I use the Request From and a boolean variable.

    So the user can decide to just run the report and see what would be changed or if the variable is true the changes are made and he can print what the report did.
    But you have to start the report twice.

    The OnPostReport Trigger is much better than this but our users prefer this way.
  • Options
    mabl4367mabl4367 Member Posts: 143
    I tried the confirm in the OnPostReport trigger. The preview is still empty when the confirm dialog pops up, so the user still don't know what changes will be made and therefore doesn't know what answer to pick in the dialog.
Sign In or Register to comment.