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

cbarlow3

Members
  • Posts

    504
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by cbarlow3

  1. Adrish, I'm actually glad to see you're designing your report like that. Whenever I create groups, the first thing I do is make sure it's wide enough for my group description AND the column header labels, and I delete the standard column header band. I don't like any information to come between column header labels and the data they describe, and I think it's worth an occasional repeat of those labels if it makes the report easier to read. Two other techniques I also use every time I group that I thought I'd share with you: 1. I check the "Reprint header" box property (you'll see it if you select the group header band) and I also set the "Min height to start new page" property to 80 or something like that (enough for my 40-high group header and two detail bands of 20 high each, for example), to avoid ending a page with a new group header. 2. Where you have "Data 1 Title", I actually drag two copies of that into the group header band and have them overlap. That may seem odd, but here's why: first I set a "Print when expression" on each copy that is mutually exclusive and is based on the automatic count variable you get when you create a group: I make one of them be $V{GroupName_COUNT}==0 and the other be $V{GroupName_COUNT}>0. Now the first instance will display when I break from one group to another, while the other version will only print if I am continuing a group at the top of a subsquent page. Now I can make them look/behave slightly differently. I usually make the ==0 version bold and I also create a PDF bookmark for it, while the >0 version, all I do is add " (continued)" to the end of the Text Field Expression. I use these two techniques so much with groups that it's really second nature and goes by very fast now. Good luck! Carl
  2. Yes, you actually answered your own question, largely: you CAN add a band conditionally by using the Print When Expression of the band itself, but you are also correct that it's very difficult (impossible?) to know if you're on the last page or not. You can control when a Text Field element is evaluated, but you can't control when a VARIABLE like $V{PAGE_COUNT} is evaluated in an expression like this. The only real advice I have is that maybe you've overlooked the grayed out band "Last Page Footer", which is a band that JasperSoft automatically renders as a replacement for a normal page footer if it's the last page. Because the page footer comes after all the other data on the page, iReport knows it's safe to do this kind of "last page" test in this one band only, so it's built in. Hope that helps. Carl
  3. I rarely have the need to delete an "organization" in the repository, but one of our clients has rethought how they'd like their organizations named, and I need to delete one. I've gone into the jasperserver-pro/login.html and logged on as superuser and tried to delete the organization in question (which has worked before), but I get an error message "Organization was not deleted due to referential integrity." Fine. Nothing should be pointing to anything in this organization, but apparently something is. I don't know a way to get it to tell me what in the repository is pointing to something in this organization, so I just went into the iReport Repository Navigator and deleted as much as I could from the organization to narrow down what it was that I couldn't delete. I turns out that I can delete everything within the organization except for an empty Oganizations | Folder Template folder. I don't know what outside this one organization would be pointing to that folder, so I'm a little stumped how to clean it up. It doesn't do a lot of harm to have a nearly empty organization in the repository, but it might cause some confusion down the road to users who have visibility into the repository from the supueruser level. Carl
  4. I agree with the previous response (although I think he meant to put it in its own java.util.Date field, not a text field--the date format doesn't work if the field is still a string). If you don't like having it as a separate date field because it's too hard to embed in the middle of surrounding text, then you can also try keeping the text expression, but make it something like this: "Text before date " + new StringBuilder(new SimpleDateFormat("MM/dd/yyyy").format($F{EXPECTEDSTARTDATE})) + " and text after date." Carl
  5. Drag a text field from the palette into the Page Header band, and set the Text Field Expression to: $V{PAGE_NUMBER}==1 ? "ORIGINAL" : "COPY" You're lucky: it's a lot easier to know you're on the first page than it is to know that you're on the last page! :) Hope that helps. Carl
  6. Interesting. Actually, I'm using DB2 9.7, but I believe it's a keyword in DB2 SQL as well (not specifically for SELECT, but...). I'll have to look into this when I get a chance in the next few days. And that's a good tip about the JasperServer log. I never look there. Carl
  7. An excellent suggestion, but the results were very frustrating. I cut out the bands that I wasn't really using, and I cut out all the fields in the SQL query except for the first two and the two that seemed to be causing trouble, and everything worked fine. Okay, so maybe I go the other way: add sections at a time until I get it to break? I had added all but one field back and it was still working fine. I figured maybe I had somehow deleted a typo and not re-introduced it, so I was hopeful when I added the last field back...and it broke. I didn't see anything wrong with the last field I added (which was payment frequency), but I took it back out, determined that if it worked again, I would at least send this version of the topic to my client to use until I could figure it out. Except now that version didn't work. A few more hours of that kind of testing drove me a little crazy. This morning I built the topic up from scratch: started with the letter template in iReport, deleted unused fields, used the SQL query but none of the jrxml from the old version of my topic, and didn't add any <property name="adhoc.display" value="easier to read field name"/> tags to my <field> containers, and...it worked. At least in my test environment. So I've sent this version up to the client for testing. Of course, what any of these changes have to do with the strange error message, I'm still no closer to understanding. My next thought is that maybe the value for property "adhoc.display" has a maximum number of characters or has a restriction that the value must be unique (sensible) within the first x characters (not quite as intuitive). Again, why that would only be a problem when you add a specific field as filter, and why it would manifest itself as some kind of security/privileges error associated with saving the report specification, I'm sure I don't know. If I can get a really short version to fail, I'll post it. And of course, if I get any closer to a solution, I'll post that as well. Carl
  8. I normally write reports using iReport, but I also have to be able to support clients who write reports using a Topic directly within JasperReports Server. One of the Topics (which joins together information from our LOAN table and a few related tables) I created has a strange problem: if I create a report and even add a filter from a normal field like "Loan Open Date", I can save it and run it just fine. But I have two fields that any time I try to add them as a filter, I am unable to save the report. Instead, I get the error "You do not have permission to write to this location. Please choose another folder, or contact your system administrator." The really strange thing is that I have another topic which is nearly identical, except that the main table I am looking at is our SHARE table (a "share" in credit union parlace is like a checking account, savings account, certificate of deposit, etc.). That topic works just fine, even when I add one of these two filters that is causing problems in the LOANS topic. Aside from the fact that the error message doesn't seem to have anything to do with the change I'm making (how does adding a specific filter have anything to do with writing to a location?), I also can't figure out why writing a report from the Loans topic is having a problem, while writing one from the Shares topic is not. The two relevant sections of the jrxml that have to do with one of these fields that is a problem to filter from is as follows: CASE WHEN LOAN.CLOSE_DATE IS NULL THEN 'No' ELSE 'Yes' END AS LOAN_CLOSED_FLAG, ... <field name="LOAN_CLOSED_FLAG" class="java.lang.String"> <property name="adhoc.display" value="Loan Closed Flag"/> <fieldDescription><![CDATA[]]></fieldDescription> </field> I've attached copies of the Share topic jrxml file (which works) and the Loan topic jrxml file (which works until I try to add either the Loan Closed Flag or the Loan Charged Off Flag as a filter, after which I can't save the report based on that topic anymore. Any ideas??? Carl
  9. Are you sure that $P{end_date} is set to have a data type of java.util.Date? It looks like you have the right syntax to me. You might need to make sure that you've handled the case of no user input correctly, but otherwise, I don't see a problem. Have you tried changing your query to this: select $P{end_date} as end_date, $P{end_date} - 5 days as earlier_date from (values(1)) as t and then output $F{end_date} and $F{earlier_date} just to see how they evaluate? Maybe the date subtraction is working fine and the problem is just that the the receiveddate values in your database aren't what you think they are. Just to be certain: your query is looking for all jobs that were received MORE than five days before the specified end_date, correct? Not more recently than. Also, do all jobs even have a receiveddate value, or might some of them be NULL? Also, in my above example, I used "from (values(1)) as t", which is a little cheesy, but you need to select from something, and there's no reason in this troubleshooting example to use a real table that has more than one row, so I used a temporary table that I know only has a single row! Carl P.S.: If you use my troubleshooting technique and drag these two fields into a detail record, don't forget to format them with an appropriate Date pattern.
  10. I found a solution this morning for my issue as well: I originally had six detail records and then a dummy group so that I could specify that I wanted all six detail records to always be kept together. Changing the split type settings on the detail records didn't help with the page totals at all. So I increased the size of my main Detail band and moved all the content into the single detail. Luckily, each detail already consisted of a frame with various elements in it, so it wasn't time consuming at all to cut/paste/reposition each of the five frames from the other detail bands. I then set the Split Type for this one remaining detail band to "Prevent". It looks like the page totals are working correctly now...no sneak preview of the next detail! Carl
  11. Interesting. When you change the two parameters to type java.util.Date, are you sure that the data type agrees between the two reports? When you're in the "Link parameters" tab of the Hyperlink dialog box, the Expression on the right that gets passed to the destination parameter needs to have the same data type as the parameter in that destination report. And of course, you have to spell the destination parameter name exactly right as well, since iReport has no notion in design view of what parameters are defined in the destination report and therefore no dropdown list is provided. Carl
  12. Did you add $P{Date1} and $P{Date2} to your main report, to report3 (the report you are hyperlinking to) or both? My comment on12/01/2010 in the following post: http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=43651&topid=81377 gives my step-by-step notes on how to pass parameters back and forth between hyperlinked reports for a drill-down or drill-up effect. Good luck! Carl
  13. I posted a similar question on 3/26: http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=96897. I haven't heard an answer back, and even your information that it is affected by "Stretch" split type is news to me. I'm going to try changing my split type right now to see if it helps in my situation. I think in the past two years of writing reports via iReport, I only have this ONE report that prints page totals--and wouldn't you know, it also has SIX detail records that print as a group, while most of my reports only have one line of detail per result row. Not a good combination. Anyway, you might want to go to my post and "Monitor" it in case anyone answers it. I'm doing the same for your posting. Good luck. Carl
  14. 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
  15. I think the problem is that the value you are pulling is in Unix Time format, rather than being a Java.util.Date. I don't use MySQL, but I found this link: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_from-unixtime, which seems to imply that you have a FROM_UNIXTIME() function available that can convert the time stamp long int to a character representation directly within your SQL query. If you still need an actual date so you can also do date arithmetic, you might also try to combine this with a str_to_date() function. I would have thought there would also be a function that would take a long int UNIX TIME and return a SQL DATE value, but I didn't find a single function that does that. Carl
  16. Well, it's two years later, and I've now written a few hundred reports in iReport, but I've still never successfully created a dashboard that includes a report with an input control. I've set a default value for the date parameter in iReport (I used new Date(), although I really want the default value to be null so I can recognize when the user hasn't input a date and I can treat that as a special case like I do when it's a stand-alone report), and it's not a mandatory parameter, although it is visible. I've unchecked the box in JasperServer that says "Always prompt", and even though I still get the error when I drag the report onto the dashboard designer pane, the input control does show up under "Special Content" as expected under either the Singel Report Controls or Multiple Report Controls, depending on whether I only have a single report in the dashboard or multiple with the same parameter name. And yes, I can click on the arrow next to that special content version of the input control and get it to show up in the design pane, and then I also add a standard submit button and save the dashboard. But even with all that, when I go to run the dashboard, in the area where the report should be, I get the same error as when I was designing, and if I enter a date in the date input control and click submit, it seems to have no effect at all. A report that works perfectly well as a stand-alone and has been modified to try to appease the default-needy dashboard still won't run inside the dashboard. Carl
  17. One improvement I use on this idea is to use a Frame element and put the conditional formatting on the Frame itself instead of on each individual element that you want to appear in that row. Then I just drag my elements into the Frame (or cut and paste them into the Frame if I've already created the elements on the design view before I thought to create the frame). This way, the alternating color takes on the size and shape of the frame, regardless of whether or not the different elements are actually touching or not, regardless of whether or not you have conditional printing on some of the elements (like turning printing off for repeated values), etc. AND you get the bonus of not having to go set the Style of reach individual element inside the frame. Just set it once and forget it. I do so many column style reports that I have this as part of the template I use. That keeps my reports looking standardized, with the same color every time for the alternating bands, etc. Carl P.S.: I just realize that I should probably mention that "Frame" is NOT the same as "Rectangle". Rectangle is just a visible box but has no hierarchical properties. When you put element in a Frame, they "belong" to the frame: the Top and Left of an element are in reference to the top left corner of the frame (not the band), and you can drag a frame from one position in the band to another, and it will automatically move all the elements that are logically part of the frame. If you're not sure if an element is really part of a frame or if it's just overlapping it visually, look a the tree in the report inspector pane. Post Edited by cbarlow3 at 04/06/2012 15:38
  18. Can you attach a sample of your jrxml file? You are talking about the format of a date field in your output, not in a prompt, correct? You can format a date field into a character within SQL, but then you can no longer treat it as a date directly--you can't do date arithmetic, easily check the month, day, or year of that field, sort by that field (although sorting would work if the character version still has yyyy/MM/dd order and pads MM and dd to two digits each). I do like to do as much calculation as is practical within the SQL statement, but reformatting a date is a loss of information, so I prefer to do it as late in the process (right before displaying) as possible. Another issue is that different versions of SQL support slightly different functions and syntax. So Oracle and PostgreSQL both have TO_CHAR functions, for example, while some other versions do not. Nevertheless, you asked for how to do it in SQL...here are a variety of date formats that work in DB2 version of SQL. You will have to test to see which ones work in Oracle: SELECT ACCOUNT.OPEN_DATE AS OPEN_DATE, SUBSTR(CHAR(ACCOUNT.OPEN_DATE),9,2) || '/' || SUBSTR(CHAR(ACCOUNT.OPEN_DATE),6,2) || '/' || SUBSTR(CHAR(ACCOUNT.OPEN_DATE),1,4) AS SUBSTR_DATE_CHAR, CAST(DAY(ACCOUNT.OPEN_DATE) AS VARCHAR(2)) || '/' || CAST(MONTH(ACCOUNT.OPEN_DATE) AS VARCHAR(2)) || '/' || CAST(YEAR(ACCOUNT.OPEN_DATE) AS VARCHAR(4)) AS CAST_DATE_CHAR, CHAR(ACCOUNT.OPEN_DATE,ISO) AS ISO_DATE_CHAR, CHAR(ACCOUNT.OPEN_DATE,USA) AS USA_DATE_CHAR, CHAR(ACCOUNT.OPEN_DATE,EUR) AS EUR_DATE_CHAR, CHAR(ACCOUNT.OPEN_DATE,JIS) AS JIS_DATE_CHAR FROM CORE.ACCOUNT AS ACCOUNT Produces the following output on my server: OPEN_DATE SUBSTR_DATE_CHAR CAST_DATE_CHAR ISO_DATE_CHAR USA_DATE_CHAR EUR_DATE_CHAR JIS_DATE_CHAR 2010-03-31 31/03/2010 31/3/2010 2010-03-31 03/31/2010 31.03.2010 2010-03-31 2010-04-13 13/04/2010 13/4/2010 2010-04-13 04/13/2010 13.04.2010 2010-04-13 2011-01-25 25/01/2011 25/1/2011 2011-01-25 01/25/2011 25.01.2011 2011-01-25 2011-01-31 31/01/2011 31/1/2011 2011-01-31 01/31/2011 31.01.2011 2011-01-31 2009-11-30 30/11/2009 30/11/2009 2009-11-30 11/30/2009 30.11.2009 2009-11-30 2009-12-01 01/12/2009 1/12/2009 2009-12-01 12/01/2009 01.12.2009 2009-12-01 etc. Carl P.S.: I could not resist throwing in one more technique that uses the DIGITS() function...I do not know which versions of SQL support it or how consistent they are in how many digits they produce (my version of DB2 SQL produces character output of ten digits), but it works better for me than CAST() because it pads the MM and dd to two digits each. I still think that using a pattern within iReport is safer than any of these. Post Edited by cbarlow3 at 04/04/2012 14:54
  19. I see now that you are the one who posted the question about specifying an operator in the parameter itself, probably like this: SELECT LOAN.ID, LOAN.BALANCE FROM CORE.LOAN AS LOAN WHERE LOAN.BALANCE $P!{RelationalOperator} $P{InputAmount} where I have defined RelationalOperator as a String with a default value of "=", but at runtime the operator could set the parameter to "<", ">=", etc.. I do not know for certain if that will work, although it does at least pass the syntax checker. Personally, I do not like the idea of replacing part of the SQL query with a parameter value as is done with $P!{RelationalOperator} above, but it seems that several people are using this kind of technique. Carl
  20. On the contrary, I apologize for only being able to reply in English. I can read a little French, Italian, and Spanish, but can not write any of them without a lot of research! :) Yes, one of the main reasons to use a parameter is so you can then compare that value to values in your database, often in the WHERE clause, assuming you are using SQL. For example, if you define a parameter of type java.util.Date called CutoffDate (DateButoir in French?), then the JasperSoft syntax for referring to a parameter in your SQL query or in one of the properties is $P{CutoffDate}, so you might have your SQL query look for birthdates that are on or earlier than this date: SELECT COALESCE(PERSON.LAST_NAME, '') || COALESCE(',' || PERSON.FIRST_NAME, '') AS PERSON_NAME, PERSON.BIRTH_DATE FROM CORE.PERSON AS PERSON WHERE PERSON.BIRTH_DATE<=$P{CutoffDate} Hope that helps out. Define the parameter first before you use it in the query. That way the report query dialog will show the available fields as in the attached screenshot instead of giving an error that $P{CutoffDate} is not defined. Good luck! Carl
  21. If the field in your database is a DATE datatype, then it is not really STORED in either YYYY/MM/DD or DD/MM/YYYY format. The issue is really just about how you control the DISPLAY of a date once you have retrieved it from the database. In iReport, you can drag your date field $F{anee} onto the detail band of the design view, and then for the Properties, set the "Pattern" to Date pattern "dd/MM/yyyy" as shown in the enclosed screenshot. Carl
  22. Am I the only one who gets an uneasy feeling when I read all the posts that want part of the main SQL query to be replaced by parameterized values? Table names, operators...is nothing sacred? SELECT * FROM $P!{TableName} ??? Really? How on earth do you even use the returned rows from that if you can't predict the column names you're going to get back at runtime? I see these examples cropping up more regularly on this forum, and every time I think to myself "just because you can, doesn't mean you should". I really can't fully articulate why I am so loathe to jump on the bandwagon, but I AM starting to wonder if I'm the only one who thinks it's a dangerously kludgy trick? I've done things like made my sort order be based on a parameter, but I still do it indirectly: I have them choose a sort order from a dropdown of choices, I then make a derived column in my SELECT that is based on a CASE statement that references the parameter value (although I have to be careful to make sure that my various sort key options all ultimately end up being converted to the same data type, which almost invariably means a sortable format of string). Then my ORDER BY uses the derived column, not a piece of SQL text directly from the parameter. I realize that in this case of a dropdown single select from list of values (to use the JasperSoft Server implementation of input controls), I can control the possible values that are passed to the query and in theory make this perfectly "safe", but I just really hate having a parameter contain any SQL code. So...if anyone is prepared to either talk me into why it's a good idea or else join my support group of people who are horrified by it, here's your chance. As with any thread I participate in, I hope that all concerned will refrain from using the over-used word "idiot". I really am curious whether I'm just being too old-fashioned or whether there is a best-practice that is generally agreed upon by experienced SQL coders. Thanks. Carl
  23. You might try: new StringBuilder(new SimpleDateFormat("dd MMM yyyy").format($F{OPEN_DATE}).toUpperCase()) (or whatever your date field is called, naturally). Hope that helps, Carl
  24. 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
  25. 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
×
×
  • Create New...