Jump to content
We've recently updated our Privacy Statement, available here ×

sameernori

Members
  • Posts

    10
  • Joined

  • Last visited

sameernori's Achievements

Apprentice

Apprentice (3/14)

  • Week One Done
  • One Month Later
  • One Year In
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Preparing your Report before Exporting This article covers the necessary settings required in order to utilize the improved Excel export options in Jaspersoft Studio 6.20.3. One of the first steps is to setup a data source in Jaspersoft Studio to go against the CSV data source if one is being used. The process to do this is very similar to setting up a connection against any other data source. Below are a couple of screenshots that show this process: Once the report is developed and the layout is in place a few settings need to be enabled in the designer to enable the export to Excel and make use of the improved Excel export options. Specifically the improvements provide the ability to group and ungroup data cells within Excel and the ability to maintain row or column headings while scrolling through an Excel sheet. For the group and ungroup settings the setting that needs to be set is the net.sf.jasperreports.export.xls.outline.level prefix followed by a suffix representing the outline level. This is set through the expression editor in Jaspersoft Studio or by editing the XML file for the particular report. More information is available on the following page: http://jasperreports.sourceforge.net/sample.reference/xlsfeatures/index.html#xlsfeatures The necessary settings to ensure the report uses the export capabilities are set under the Windows-> Preferences menu within Jaspersoft Studio. In this window under Jaspersoft Studio select the tab called "Export options" and select the Excel option. Under the Common tab the following changes should be made: Check the Detect Cell Type option (Cell tab)Freeze pane on row (Common tab) - In the example report being exported the need is to maintain the column heading while scrolling through rows- we input 3 here which is the row for the column heading. The export output of the report once exported to Excel is shown below
  2. JasperReports Server and Jaspersoft OLAP in CE Under our Open Source, Community Edition (CE) product, JasperReports Server and Jaspersoft OLAP are together in the same package. So, if you download JasperReports Server, you get both JasperReports Server and Jaspersoft OLAP. JasperReports Server and Jaspersoft OLAP in Pro In our Professional, commercial product, Jaspersoft OLAP has additional commercial functionality and is sold as an add-on to JasperReports Server. What is Jaspersoft OLAP? In general, Jaspersoft OLAP refers to the Business Analysis capability found in JasperReports Server. Business Analysis is also known as OnLine Analytical Processing (OLAP), and is enabled via the Open Source projects Mondrian and JPivot. What is JasperReports Server? Typically, JasperReports Server refers to both the core server functionality (creating and managing users and roles, assigning permissions, scheduling reports, etc) and to the Business Reporting functionality which is enabled by JasperReports.
  3. There are potentially several ways to load reports with a subreport to JasperReports Server. The following recommendation is taken from Section 8.5.4 of the JasperReports Server Pro Ultimate Guide. Create the Reports in iReport Designer Create the subreport; give it a descriptive name (e.g. "subreport.jrxml"). Create the main report; give it a descriptive name (e.g. "mainreport.jrxml"). Drag a Subreport component from the Palette into the main report's Detail band. Follow the Subreport wizard: Use an existing report: Browse to locate the file you created in step 1 (e.g. "subreport.jrxml"). Use the same connection used to fill the master report (Parameters) Store the directory name in a parameter: $P{SUBREPORT_DIR} + "subreport.jasper" Finish Save the main report locally. Do not close the file; you want the main report open. You will use it later.Upload the Report Unit to JasperReports Server If it's not already open, display the Repository Navigator: Window > JasperReports Server Repository. Browse through the Repository Navigator. Right-click the folder into which you want to upload the report unit. Click Add > Report Unit. Enter a descriptive Name and Description for the report unit (the report unit includes the main report, subreport(s), and any other resources). For the Main JRXML, click "Get source from current opened report". For Locate Data Source you can select a datasource that's already loaded into the JasperReports Server repository. If you don't yet have a data source, you can click Locally Defined and follow the wizard. Click Finish. The JRXML validation box appears. Accept all its proposed changes.JasperReports Server Converts the Subreport ExpressionResult: the most significant change is that upon loading the report unit in step 12, JasperReports Server stores the subreport as a report resource and converts the Subreport Expression. For example the Subreport expression specified in step 4.4, above when the file was worked locally within iReport: $P{SUBREPORT_DIR} + "subreport.jasper" becomes "repo:subreport.jrxml" when uploaded as part of a report unit to the shared JasperReports Server repository. Suggested ReadingTo learn the basics of creating subreports, refer to Subreports!. More information is available in Chapter 11 of the iReport Ultimate Guide. You can purchase the Jaspersoft Ultimate Guides at http://www.jaspersoft.com/ultimate-guides.
  4. [toc on_off::hide=1] You will often want to prompt users to restrict the data they retrieve based on a date range. This article assumes you design the report in iReport Designer and publish it to JasperReports Server for shared use. In iReport Create two parameters in your report. Name: start_date Parameter class: java.util.Date Use as prompt: checked Default Value Expression: leave blank/null Name: end_date Parameter class: java.util.Date Use as prompt: checked Default Value Expression: leave blank/null or you can use new java.util.Date() to populate the parameter with the current date Add this to your query: WHERE <your_table.column> BETWEEN $P{start_date} AND $P{end_date}</your_table.column> Save and then test by clicking Preview in iReport.Assuming it runs well, you can load the file to JasperReports Server. You can stay within iReport Designer to do this. Open the Repository Navigator and navigate to a folder where you want to save the report. Right-click the folder and click Add > Report Unit. Enter the name, label etc. and click Next. Click the Get source from current opened report button and click Next. Locate the Data Source from the repository (e.g., Dev01) and click Finish.When prompted if you want to open the file from the server, click yes. In JasperReports ServerHere you will add the Input Controls that map run-time values (generally user input) to the report parameters. There are several ways to add input controls. This is just one of them. Switch to JasperReports Server and login as an administrator (jasperadmin or superuser, for example). Right-click the report in the Repository browser. Select Edit, then click Controls & Resources on the left sidebar. Click the Add Control button. Unless you already have the input control defined, click Locally Defined. Enter the following for Input Control Details and when done click Next. Parameter Name: start_date [Note: it is important that the parameter name exactly matches the parameter defined in the report definition] Prompt Text: Enter a start date Type: Single Value Mandatory: (optional) Read Only: (optional) Visible: checked Locate Datatype: Click From the Repository and select one of the sample date types that Jaspersoft includes, e.g., /organizations/organization_1/datatypes/date. Click Next. Repeat steps 2-4, but enter end_date for the Input Control name. Click the Always prompt checkbox. You can display the Controls layout on the "Top of page" if you like. Click Finish, then Save.Test the reportYour report should run with a calendar input control, as shown below.
  5. JasperReports Server Authentication and PasswordsIntroductionJasperReports Server makes extensive use of Spring and uses the Spring sub-project, Acegi Security, for authentication and authorization. Acegi works through optional filters that can be wired together in a wide variety of ways. The start of Acegi security is the security filter that is configured in your web.xml. The same mechanism can be used for Web and Web services applications. <filter> <filter-name> securityFilter </filter-name> <filter-class> org.acegisecurity.util.FilterToBeanProxy </filter-class> <init-param> <param-name> targetClass </param-name> <param-value> org.acegisecurity.util.FilterChainProxy </param-value> </init-param> </filter> You can secure the parts of your application by defining the URLs you want to apply the security filter to. By default in JasperReports Server, we secure all pages - note the url-pattern below. <filter-mapping> <filter-name>securityFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>Next we define our FilterToBeanProxy in a Spring configuration file. Here is the default one in JasperReports Server. The filterChainProxy gets a bit more complex in JasperReports Server v5.1 onwards. <bean class="org.acegisecurity.util.FilterChainProxy" id="filterChainProxy"> <property name="filterInvocationDefinitionSource"> <value> CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON PATTERN_TYPE_APACHE_ANT /**=httpSessionContextIntegrationFilter,authenticationProcessingFilter, basicProcessingFilter,anonymousProcessingFilter,exceptionTranslationFilter, filterInvocationInterceptor </value> </property> </bean> The list of filters are applied in order. Since we are focusing on authentication, let's follow the exceptionTranslationFilter first. This filter deals with unauthenticated users/interactions. Getting Credentials for Authentication<bean class="org.acegisecurity.ui.ExceptionTranslationFilter" id="exceptionTranslationFilter"> <property name="authenticationEntryPoint"> <ref local="authenticationProcessingFilterEntryPoint"></ref> </property> </bean> <bean class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint" id="authenticationProcessingFilterEntryPoint"> <property name="loginFormUrl"> <value>/login.html</value> </property> <property name="forceHttps"> <value>false</value> </property> </bean> This configuration forces form-based authentication. Unauthenticated users will be forced to go to /login.html to enter their credentials. When they enter this, the authenticationProcessingFilter will be invoked. <bean class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter" id="authenticationProcessingFilter"> <property name="authenticationManager"> <ref local="authenticationManager" /> </property> <property name="authenticationFailureUrl"> <value>/loginerror.html</value> </property> <property name="defaultTargetUrl"> <value>/flow.html?_flowId=listReportsFlow</value> </property> <property name="filterProcessesUrl"> <value>/j_acegi_security_check</value> </property> </bean> In this case, Acegi will authenticate using the authenticationManager when the login form posts to /j_acegi_security_check. It is easy to use non form-based authentication, like HTTP Basic or HTTP Digest, as Acegi comes with filters that can be wired up to implement those protocols. Authentication ManagerSo now we are finally at the authentication configuration. The authenticationManager in the authenticationProcessingFilter is a pluggable bean. Acegi comes with a variety of implementations. JasperReports Server by default authenticates against the metadata repository, so it uses a custom service which is part of the JasperReports Server API. <bean class="org.acegisecurity.providers.ProviderManager" id="authenticationManager"> <property name="providers"> <list> <ref local="daoAuthenticationProvider" /> <ref local="anonymousAuthenticationProvider" /> <!-- ref local="jaasAuthenticationProvider"/ --> </list> </property> </bean> <bean class="org.acegisecurity.providers.dao.DaoAuthenticationProvider" id="daoAuthenticationProvider"> <!-- <property name="userDetailsService"> <ref bean="inMemoryDaoImpl" /> </property> --> <property name="userDetailsService"> <ref bean="userAuthorityService"></ref> </property> </bean> The anonymousAuthenticationProvider allows anonymous access. In the above XML, you can have beans that provide alternative implementations of the authenticationProvider or userDetailsService, which looks up users. External Authorization StrategiesThe following is intended for JasperReports Server versions prior to v5.1. (See the attached jasperreportsserver-auth-cookbook-4.0.pdf) For v5.1 and on, please refer to The new JasperReports Server Authentication Cookbook v5.1 or JasperReports Server Authentication Cookbook v5.2 (HTML) (found in our Docs Area) for a comprehensive guide to implementing External Authorization using LDAP, CAS or external databases. LDAP<bean class="org.acegisecurity.providers.ldap.DefaultInitialDirContextFactory" id="initialDirContextFactory"> <constructor-arg value="ldap://monkeymachine:389/dc=acegisecurity,dc=org" /> <property name="managerDn"> <value>cn=manager,dc=acegisecurity,dc=org</value> </property> <property name="managerPassword"> <value>password</value> </property> </bean> <bean class="org.acegisecurity.providers.ldap.search.FilterBasedLdapUserSearch" id="userSearch"> <constructor-arg index="0"> <value /> </constructor-arg> <constructor-arg index="1"> <value>(uid={0})</value> </constructor-arg> <constructor-arg index="2"> <ref local="initialDirContextFactory" /> </constructor-arg> <property name="searchSubtree"> <value>true</value> </property> </bean> <bean class="org.acegisecurity.providers.ldap.LdapAuthenticationProvider" id="ldapAuthProvider"> <constructor-arg> <bean class="org.acegisecurity.providers.ldap.authenticator.BindAuthenticator"> <constructor-arg> <ref local="initialDirContextFactory" /> </constructor-arg> <property name="userDnPatterns"> <list> <value>uid={0},ou=people</value> </list> </property> </bean> </constructor-arg> <constructor-arg> <bean class="org.acegisecurity.providers.ldap.populator.DefaultLdapAuthoritiesPopulator"> <constructor-arg> <ref local="initialDirContextFactory" /> </constructor-arg> <constructor-arg> <value>ou=groups</value> </constructor-arg> <property name="groupRoleAttribute"> <value>ou</value> </property> </bean> </constructor-arg> </bean> <!-- We would finally wire this into the authentication manager via: --> <bean class="org.acegisecurity.providers.ProviderManager" id="authenticationManager"> <property name="providers"> <list> <ref local="ldapAuthProvider" /> <ref local="anonymousAuthenticationProvider" /> </list> </property> </bean> For full details, see: Acegi Security - LDAP authentication. There is a useful thread on the Spring forums that show LDAP authentication against Lotus Domino, Oracle Internet Directory 10g and Microsoft Active Directory - see LDAP directory integration on the Spring forums. For More on LDAP and MS Active DirectoryHow to integrate JasperReports Server with MS Active Directory (LDAP)JAAS<bean class="org.acegisecurity.providers.jaas.JaasAuthenticationProvider" id="jaasAuthenticationProvider"> <property name="loginConfig"> <value>/WEB-INF/login.conf</value> </property> <property name="loginContextName"> <value>FileLogin</value> </property> <property name="callbackHandlers"> <list> <bean class="org.acegisecurity.providers.jaas.JaasNameCallbackHandler" /> <bean class="org.acegisecurity.providers.jaas.JaasPasswordCallbackHandler" /> </list> </property> <property name="authorityGranters"> <list> <bean class="org.appfuse.web.JaasAuthorityGranter" /> </list> </property> </bean> See AlsoConfiguring JAAS with JasperReports ServerJAASAcegi Security- JAAS authenticationOther Authentication ServicesA variety of authentication providers come with Acegi, or are easily integrated: JasperReports Server Authentication with JBoss SSOSiteMinderIntegrating CAS with JasperReports ServerTomcat realmStatic/in-memoryCustom database lookupX509Changing Database PasswordsYou may want to change the database passwords used by JasperReports Server to connect to the repository. ReferencesJasperReports Server Authentication Cookbook v5.2 (HTML)JasperReports Server Authentication Cookbook v5.1 (PDF)JasperReports Server Authentication Cookbook v4.7 (PDF)See Acegi ReferenceSearch URL: Keywords: Authentication+JasperReports ServerSearch URL: Keywords: LDAP jasperreportsserver-auth-cookbook-4.0.pdf
  6. Here is a set of instructions on how to build JasperReports Server source code. There are 2 ways to build JasperReports Server Community Edition: directly with sources from subversion from Jaspersoft communityfrom the source package, that can be downloaded from JasperReports Server > Releases section. For detailed instructions please also refer to the TIBCO JasperReports Server Source Build Guide for additional information. The most current Source Build Guide can be downloaded from the downloads area too.Getting Source from Public SVNSources can be checked out from http://code.jaspersoft.com/svn/repos/jasperserver. Depending on your requirements, there are different options for which revision to use: trunklatest version of codetags/lastSuccessfulBuild-trunk-celatest version of code that successfully built and past all automated testing.tags/lastReviewed-trunklastest version of code that got reviewed by QAtags/js-tag for a specific release of JasperReports Server community edition Example for svn via command line: To get a tagged source revision svn checkout --username anonsvn --password anonsvn http://code.jaspersoft.com/svn/repos/jasperserver/tags/lastReviewed-trunk jasperserver To get the trunk source: svn checkout --username anonsvn --password anonsvn http://code.jaspersoft.com/svn/repos/jasperserver/trunk jasperserver Sources retrieved via IDE/SVN UI client Point the svn client to the desired repository, enter credentials: username:anonsvnpassword:anonsvnand checkout the sources. Getting Source from the Downloads AreaFor major releases, we include a source code package as a zip file. You can check the downloads area and look for a file like jasperserver-cp-{version}{ver}-src.zip. (Click the Release menu item for the downloads area.) Pre-Requirements for Source buildTo build JasperReports Server, you will need to following tools: Java JDK 1.6+ (recommeded: 1.7)Apache Ant 1.8.4+ (recommended: 1.9.4)Apache Maven 3.0.4+ - 3.2.xTo verify that appropriate versions are installed or to check the installation, run the following commands on command line. If the versions are matching the requiements above, you're good to go and build JasperReports Server. java -version ant -version mvn -version The JasperReports Server community source distribution comes with a pre-configured ant which contains all required libraries. If you check out JasperReports Server from the community, you will need to provide these libraries to your ant class path (e.g. /lib). The required additional ant module is ant-contrib library. It can be found in buildomatic/install_resource/extra-jars/ant-contrib-1.0b3.jar. The instructions below contain all ant commands utilizing jasperserver internal ant script js-ant, if you use a different ant version, replace this with the appropriate ant executable. Once JasperReports Server is built, you might want to deploy it. In order to run JasperReports Server you needApplication Server (ie Apache Tomcat 7)Database Server (ie MySQL 5.5)A full list of supported platforms is available in the Jaspersoft Platform Support document available in the documentation section. Prepare to Build SourceThe JasperReports Server source code comes with a set of Ant scripts that can automatically configure the JasperReports Server source build with a single property file. These Ant scripts are known as the buildomatic scripts. Before building JasperReports Server, buildomatic needs to be configured in a properties file. To get started, copy a sample property file and configure it to match the environment: There are two sample in buildomatic folder that can be used: sample_conf/source/mysql_master.propertiessample_conf/source/postgresql_master.propertiesExample copy/rename: cd buildomatic cp sample_conf/source/mysql_master.properties default_master.properties Note: the file should be named "default_master.properties" Edit buildomatic configuration fileYou will need to add local settings to the default_master.properties file. Example Settings: appServerType = tomcat7 appServerDir = /home/user/apache-tomcat-7.0.39 dbType = postgresql dbHost = localhost dbUsername = postgresdb Password = postgres maven.build.type = community maven = /usr/bin/mvn js-path = /home/user/jasperserver Take a look at the sample files and at the JasperReports Server Source Build Guide pdf for additional options and documentation. Important: If you build a version earlier than JasperReports Server community 5.1, you will need to add an additional property js-repo-path:. This needs to point to the location where the required jars are stored in a maven repository. If you download the source distributiion it will be located in {jasperreports-server-sources}/jasperserver-repo. If you build directly from subversion, you need to checkout the maven repository too from http://code.jaspersoft.com/svn/repos/maven2. maven.build.type = repo repo-path = /path/to/jasperserver-repo Build and Deploy JasperReports ServerNote: If you would like to run the unit-tests, you will need to create the sample databases "foodmart" and "sugarcrm" (included in steps below). Note: You should have your database running in order to execute the unit-tests. Note: You should have your app server turned off before you deploy JasperReports Server. cd buildomatic ./js-ant gen-config ./js-ant add-jdbc-driver ./js-ant build-ce ./js-ant create-js-db ./js-ant create-sugarcrm-db (for sample data) ./js-ant load-sugarcrm-db (for sample data) ./js-ant create-foodmart-db (for sample data) ./js-ant load-foodmart-db (for sample data) ./js-ant update-foodmart-db (for sample data) ./js-ant build-js-ddl-ce ./js-ant init-js-db-ce (add schema to database) ./js-ant run-integration-tests-ce (run tests, add core and sample data to DB - depends on sample DBs) ./js-ant deploy-webapp-ce (deploy jasperReports server to your app server) Troubleshooting ProblemsYou can take a look at the Trouble-Shooting Appendix C in the JasperReports Server Source Build Guide pdf for helpful hints. If you have trouble running the unit-tests you can load the "core" data by doing the following: ./js-ant import-minimal-ce And you can even load the sample data this way: ./js-ant import-sample-data-ce Logging into JasperReports ServerYou can now login to JasperReports Server via you web browser. The default administrator user is the following: Username: jasperadmin Password: jasperadmin You can login using the following example URL: http://localhost:8080/jasperserver Change Administrator PasswordYou can change the password for the jasperadmin user by going to Manage > Users menu itemClick on the jasperadmin userclick the Edit button,and set the new passwordAdditional NotesBuildomatic creates your Maven setup automatically. You can find your maven setup file at the following location: buildomatic/build_conf/default/maven_settings_community.xml There are other configurations present that allow custom maven configurations as well as maven configurations involving a central artifacts server. To utilize these, set the maven.repo.type property to the required value. (Applies to all version from 5.0) "build_conf" is the folder that is generated by buildomatic to automatically setup all your properties for jdbc URL, database connections, etc. A number of these configuration files get copied to your application server when the "deploy-webapp-ce" target is executed. Section 4 of the TIBCO JasperReports Server Source Build Guide has more information on how buildomatic works. If you have a mistake in your default_master.properties, you can edit the file and correct the error (ie incorrect path). Buildomatic will automatically regenerate your "build_conf" set of files next time you run a target. If you would like to explicitly reset your buildomatic auto-generated config files, you can run the following targets: ./js-ant clean-config ./js-ant gen-config Update noteThis page has been updated on May 1, 2013. If not mentioned otherwise root folder for all instruction is jasperserver. As of version 6.0.x of JasperReports Server client side java script handling is modified: if sources are checked out from svn and build from there javascript resources are pulled in as maven dependencies. See <src>/jasperserver-war/pom.xml for details on artifact jrs-ui. In order to modify javascript resources, create an overlay for this archive.if sources are downloaded from source bundle, javascript are unpacked into <src>/jasperserver-war/src/main/webapp. Any modifications can be performed directly in the folder.
×
×
  • Create New...