Emerjoin / Hi-Framework-features

Java EE Framework
5 stars 1 forks source link

HighReports - the ultimate reporting technology #54

Open emjunior258 opened 8 years ago

emjunior258 commented 8 years ago

HTML is stored on views and views are loaded from actions of controllers. The trick is: the reports data is loaded asynchronously when the use is interacting with the application. When it's time to print, the report data comes from the action. There is not asynchronous data fetch. The report printer class will get user cookies and will pass them to the wkhtmltopdf so that it can gain access to the url. After saving the PDF file.

On the controller class:

@Printable(name="reportName")
public void controllerAction(Map Params){

    if(params.contains("$print")){
             //fetch data and pass to the view
            return;
    }

    //just call the view and let the report be filled asynchronously
}

When it's time to print:

Boolean success = HighReports.pdfy("reportName", "save/to/path",optionsMap);