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

To publish a report


mariarita

Recommended Posts

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

Assuming you have JasperReports Server installed, there are two main ways to deploy your report to the server:

1. If you use iReport and you have the Repository Navigator plug-in working, then you can see a tree-like view of the repository in this pane.  You can navigate to the folder you want under the appropriate organization (I have a subfolder called "Reports"), right click that "folder" (it looks like a folder, but it's really all just a database), and specify that you want to Add | Report Unit.  This brings up a dialog where you assign a resource Name (this can't be changed once you assign it), a label and description (these show up in the JasperReports Server repository/reports list...unfortunately, that list is automatically sorted by the invisible resource NAME, not by the label, so I usually make my name be exactly the same as what I want my label to be, only I make sure the resource name has no spaces).  Then in the next part of that dialog has you select the Main JRXML file.  You can browse to where that jrxml file resides on your hard drive, but if that file is already open and has focus in iReport, you can just click the "Get source from current opened report" button, which is a very handy shortcut.  In the next part of the dialog, you select a data source, usually from the repository (if you don't already have the repository set up with a data source and some basic folders, then you'll want to step back and think about setting that up).  Then you click "Finish", and if it's successful, you get a popup asking if you want to open the jrxml from the source (meaning open up the repository version).  Personally, I NEVER open that unless I'm sure that the version in the repository is for some reason more up-to-date than my hard drive version, and even then, I immediately save to my hard drive with a logical name (not a random-looking repository name), so I always have ONLY my hard drive version open at any one time, make changes, then deploy the changes.  If your report doesn't require any input prompts to fill in any parameters, you're probably done and ready to test in JasperReports Server.  Otherwise, you'll have to expand the new "folder" for this report and then right click the "Input controls" folder that automatically gets created in there and choose  Add | Input Control.  How you add the control depends on what kind of control it is, whether you're going to add it locally or link to an existing one you've created in some folder to be reusable, whether the input is a single value of a single data type or if it's a single or multi-select from a list of values or from a query.  Do yourself a favor and don't make the first report you try to deploy have any input controls!  Choose the simplest report you can so you're sure you understand all the OTHER steps and that you have JasperReports Server configured correctly.

2. As an alternative, if you're able to log onto JasperReports Server, you can view the repository (the look and feel varies from one version to another, so I can't tell you exaclty how to get there), and in a similar process, you right click on a "folder", choose Add Resource | JasperServer Report, then in the Wizard, give a name, label, and description and click "Next".  Then in the Main JRXML section, click the Browse button and find your jrxml file on your hard drive and select it.  Then on the Resource List section, you can skip it (if you don't have any input controls) and click Next.  For the Data Source, choose the radio button for "From the Repository" and choose the appropriate data source from the dropdown box (again, assuming you already have this configured) and click Next.  Skip the "Locate Query" section...just click the "Finish" button.  If all is well, it will come back with the message "The report was validated successfully".  That's nice, but you're not really done until you hit the "Save" button.

I hope one or both of these techniques helps out.  You should be able to get the standard JasperReports Server documentation, which probably goes over method 2 in more detail, including screen shots.

Carl

Link to comment
Share on other sites

Unfortunately, all my steps before were repeatable steps for each report once you already have JasperReports Server fully installed and configured on your server and iReport fully installed and configured on your PC.  I don't know how much of this is done and how much remains to be done, nor am I much of an expert on install and configuration (plus I've never used Oracle, but that shouldn't come into play here).  If you're not sure if you have Oracle itself running on your server, then that's presumably a question for Oracle.  If you're not sure if you have JasperReports Server installed and configured on your server, I believe the JasperServer install guide is free from the JasperSoft web site and provides better info than I could put together.  I can just tell you that in my install of JasperReports Server, I have a single JDBC DataSource defined that points to our DB2 database, and we have that configured with the Driver set to com.ibm.db2.jcc.DB2Driver and the URL set to jdbc:db2://localhost:50000/D0000T99 (I think DB2 uses 50000 as the default port for queries, and D0000T99 is the name of the database I'm connecting to).  Maybe there are some useful parallels for Oracle.  I wasn't the one who did the install of JasperReports Server, so I'm out of my depth on that one.

On the other hand, maybe your install of JasperReports Server is fine and you're asking about how to install the Oracle driver for iReport.  That, I believe is a little simpler (or at least I understand it better).  First, get a copy of the Oracle driver (in the form of a jar file, I believe).  The DB2 driver I use is called db2jcc.jar.  You can put that file anywhere on your hard drive, just remember where it is.  In iReport, go into Windows | Services.  Select the Databases node.  Select Drivers node, right-click it, and select "New Driver".  Browse your way to the driver file on your hard drive.

After you've added the driver in iReport, you have to also add a new connection for each database you are going to connect to:  Windows | Services, select Databases node, right-click it, and select "New Connection" to bring up the "New Database Connection" dialog box. I go into the Basic setting tab, and for "Name", I change the dropdown from the default of "JDBC-ODBC Bridge" to "IBM DB2 Universal Driver" (presumably you would have an Oracle option here once you had installed the Oracle driver).  For "Data Input Mode" radio button, I select "Direct URL Entry".  Then I enter a username and password that have the appropriate read credentials, and for JDBC URL, I have jdbc:db2://www.corelationlocal.com:50000/D0000T99 (but of course, none of that would be the same for you, except possibly the "jdbc:").  Click OK, and in the next dialog, confirm whether or not the Schema is set to the one you want, and click OK.

I forget the difference exactly between the Services Connection from the previous step vs. a data source, but I show that there is an additional step that for each database you want to connect to, you add a datasource:  Click the "Report Datasources" icon in the main iReport toolbar.  It's located to the right of the Undo and Redo arrows and to the left of the datasource dropdown box in my 3.7.1 Professional edition.  In the Connections/Datasources dialog, click the "New" button.  In the Datasource dialog, it asks you to "Select the datasource type".  I select "NetBeans Data connection" and click "Next".  In the "NetBeans Database JDBC connection dialog, enter a name like "Oracle Employee Database" or whatever accurately describes your database and distinguishes it from others you might also be connecting to.  Be sure to choose the appropriate connection from the dropdown box, particularly if you created multiple connections in the previous step.  Click "Test" to test the connection, and if it successful, click "Save".  Click "Close" to close the Connections/Datasources dialog box.

If your version of iReport already has a window avaialbe for the Repository Navigator, open that window/pane.  If this is the first time youv'e used it, you may not yet see a repository tree.  Instead you'll see some icons, one of which is a configuration icon.  Click that.  Give your repository a name like "JasperSoft Repository" or something.  For JasperServer URL, my PC has http://www.corelationlocal.com:8080/jasperserver-pro/services/repository.  Except for the IP name www.corelationlocal.com, you should have the same URL, I believe.  For Username and Password, it's looking for a JasperSoft username and password, not an operating system or Oracle username and password.  The default installation starts out with username/password of superuser/superuser or jasperadmin/jasperadmin.  If you haven't changed that yet (and you should at some point), use superuser as both the username and password in this dialog.

That's how I configure iReport for a new user.  Obviously, every one of those dialog box options is there for a reason--if one set of configuration options worked for everyone, there wouldn't be so many options, so I don't know how much of this applies to your situation and how much doesn't.  I hope just understanding the basic fact that there are these four steps in iReport (add the driver, add a connection, add a data source, configure the repository navigator plug-in) will give you a little structure.

Good luck!

Carl

Link to comment
Share on other sites

  • 3 weeks later...

I've just setup JasperServer to play with here (working on some drill down reports for our ERP data). I too am using 4.5.0 of JasperServer and, I believe, iReport 4.5.1.  I have the JasperServer plugin working in iReport and am the admin on JasperServer so I have access to both interfaces.

I have succesfully created, distributed to JasperServer, and run a basic report (no parameters). I've also got one of my top level drill down reports (with two parameters) distributed and running. I've created and distributed one of the reports drilled down to from the top level report, but can't seem to get the parameters to pass correctly.  This may be because I don't understand / can't execute the updating of reports once they are in the repository of JasperServer.

Right now, the only way I've found to update the report is to remove it from the repository and then re-add it.  I'm sure there's a better way, but I've yet to find it.  I have found that if I open the .jrxml file from the JasperServer plugin within iReport, I can make changes and save them in the repository (somehow, even though the documentation says the file is copied out of the repository and stored in a temp file on my local drive, so I'm not sure how it gets 'checked back into the repository' without me doing anything, but it seems to work..

If you have a better way, I'd like to hear it because adding the report over and over cannot be the most efficient method, and it was mentioned here that the repository version is never opened (or at least very rarely).

Thanks for the help in advance, I've learned quite a bit already reading through the comments.

-Todd

Link to comment
Share on other sites

If you are in iReport and you either open a local (C drive) version of your report or else you open a repository version and then save to your hard drive, then the "Save" functionality (which also happens automatically if you Preview) just saves to your hard drive.  Personally, I like that, because I like to make a few changes and run a few previews before I update the server version.  But if you go into Repository Navigator and expand the report so you can see "Main jrxml" (as well as the "Input controls" and "Resources" folders), then you can right click on "Main jrxml" and choose "Replace with current document"--always assuming that you do in fact have the jrxml file open and that it's the open file that currently has focus.  Assuming you aren't changing anything about the parameters/input controls or any other resources that the report needs, that's all you have to do to update an existing report in the repository.

The other way you can do it directly from within JasperReports Server is to right click on the report name within the repository and choose "Edit".  The first panel of the resulting Report Wizard displays the resource name and allows you to modify the Label and/or Description, while the second pane should tell you that the JRXML file has already been located, but gives you the opportunity to Browse for an updated version of the jrxml (or you can select from the content repository, which I assume would just copy a report from one resource name to another).

Carl

Link to comment
Share on other sites

Thank you Carl! So much better!

 

I too would much rather work in a non-production environment (local copies) and then publish them to a test server then finally to a production environment too. This is now working very nicely! I appreciate your quick reply.

 

Todd

Link to comment
Share on other sites

  • 3 weeks later...

The tool JDeploy! on http://sourceforge.net/projects/jaspertools/?source=directory

allows to deal with reports deployment on diferents environments (development, pre production, production). It dont touch the datasources when deploying a report, so the systems department can define it. It also defines a estandarized way to package the reports and subreports of a project on a zip file. And includes other utils to list reports, create datasources,...

I hope to helped you.

bye.

Link to comment
Share on other sites

  • 2 years later...

Hi,

 

While deploying jasper report using Jdeploy, its throwing error called"Error: Unable to access jarfile deploy you must enter a host. my input is below as a ref:

 

./deploy.sh /home/oracle/Downloads/jdeploy.v.02.00.00/jdeploy.v.02.00.00/Samples/catalogo1.zip -rd /Reports -ds HR -h localhost:8080

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...