subodhjoshi82 Posted November 26, 2012 Share Posted November 26, 2012 Hi ,I created a Simple report with the help of iReport Designer4.8 and query is part of this report or DynamicWithQuery.jrxml file .Right now I have wrote this Java Method to Generate the report. Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); Connection conn = DriverManager .getConnection("jdbc:sqlserver://localhost\dev:1444;databaseName= dev;user=dev1;password=dev1"); InputStream input = getClass().getClassLoader() .getResourceAsStream("DynamicWithQuery.jrxml"); JasperDesign jasperDesign = JRXmlLoader.load(input); JasperReport jasperReport = JasperCompileManager .compileReport(jasperDesign); Map parameters = new HashMap(); parameters.put("userId", "SA"); JasperPrint jasperPrint = JasperFillManager.fillReport( jasperReport, parameters, conn); JasperViewer.viewReport(jasperPrint);,>,>Can it possible to Get query from the Jrxml page and pass paramter to that query and result set to report rather than passing connection ?Note:-I dont want to remove query from Jrxml file Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now