Jump to content
Changes to the Jaspersoft community edition download ×

How to generate jasper report as accordance to user request?


Radha2049
Go to solution Solved by arif3hosain,

Recommended Posts

I have created a table as my jasper report which holds more than one million arsenic data with various arsenic levels. The requirement of my project is:

[1] User should give inputs through simple html forms and submit buttons

[2] User should select data which has arsenic level (AL) <10 , 10<AL<=50 , AL<50

[3] Now he should click submit button

[4] Now after clicking the submit button, the report should should be dispayed as per the user inputs (AL <10  or 10<AL<=50 or AL<50)

How to do this?

 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

  • Solution

Beautiful question---

 Firstly create your report using iReport/JasperStudio. Secondly, create parameters based on your required fields. Upload the report to the jasperserver including Input Control. 

Thanks & Regards

Arif Hosain
Skype: Arif.3hosain

 

Link to comment
Share on other sites

  • 1 month later...
hozawa
thank you so much for reply. i already have viewd lots of documents related to input control but got stucked. i want to generate the jasper report at the run time. report should be generated after the user input. i have checked "Input Control" functionality but they all create the static jasper reports but i want dynamic one. for small amount of datas and to create few reports i have used following query:
 
<?php
require_once __DIR__ . "/vendor/autoload.php";
require_once "jrs-rest-php-client/src/Jaspersoft/Service/QueryService.php";
use JaspersoftServiceQueryService;
use JaspersoftClientClient;
 
if($_SERVER['REQUEST_METHOD'] == 'POST'){
$district = $_POST['district'];
$format = $_POST['format'];
$depth_used = $_POST['depth_used'];
  $conc_arsc = $_POST['CONC_ARSC'];
 
header('Content-Type: application/pdf');
 
$c = new Client(
        "localhost",
        "8080",
        "jasperadmin", 
        "jasperadmin",
        "/jasperserver"
      );
 
if($depth_used == "0-19"){
if($conc_arsc == "0-9"){
$report = $c->reportService()->runReport('/reports/Arsenic_Reports/DepthUsed_0_20_ConcArsc_0_10','pdf');
echo $report;
}
if($conc_arsc == "10-50"){
$report = $c->reportService()->runReport('/reports/Arsenic_Reports/DepthUsed_0_20_ConcArsc_11_50','pdf');
echo $report;
}
if($conc_arsc == ">50"){
$report = $c->reportService()->runReport('/reports/Arsenic_Reports/DepthUsed_0_20_ConcArsc_51_100','pdf');
echo $report;
}
}
} else{
echo "Failed to generate pdf";
}
?> 

this extracts the static reports that have been previously created in jasper report server but i am stucked how to make my reports dynamic? please help me.its very urgent.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...