Jump to content

cbarlow3

Members
  • Posts

    504
  • Joined

  • Last visited

 Content Type 

Forum

Downloads

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Events

Profiles

Posts posted by cbarlow3

  1. Well, I never could find my cache, but against all odds, the keytool command actually did the trick!  My boss gave me a copy of the certificate file (I never was able to find that on the server), and I blew off the alias part of the command, and now my Repository Navigator is back in business, only now through https/SSH/SSL.

    Carl

  2. Thanks.  Adding/accepting a certificate should be that easy.  My server connection is configured the same as yours (other than the I.P. address, naturally), but I can't seem to find the cache directory or an option in iReport to clear cache.  I'm running Windows 7 Professional and probably took the default install location for iReport--I find it's at c:\Program Files (x86)\Jaspersoft\iReport-Professional-3.7.1.1\.  But there's no var and/or cache directory anywhere from there down.

    Carl

  3. Thanks.  I'll look into that solution as well, but it sounds like a workaround, and I'd like to solve the problem that iReport is complaining about if possible.  I forgot to explicitly say what the error was:  when I try to open this server in my Repository Navigator tree, I get a popup that says "Error: ; nested exception is: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target".  This is AFTER I changed the properties for this server so that the JasperServer URL has https instead of http and has port 8443 instead of port 8080.  Oddly enough, I made that same kind of change to my database definitions under "Services" pane, and my Preview continues to work just fine, so I can use SSL to hit my DB2 database okay...I just can't use it to have the JasperServer plug-in hit the repository (which is on the same AIX server as the DB2 database, by the way).

     

    My latest theory is that my copy of iReport Professional 3.7.1.1 is using the version of Java in my C:Program Files (x86)Javajdk1.6.0_21 folder, and I think I need to get a copy of the self-signed certificate we're now using on our AIX server and add that certificate to my Java's jrelibsecuritycacerts file.  To do that, I think I go into my DOS prompt and make my way to that directory, make sure I have a copy of the certificate file in there called mycert.pem, let's say, and then run the following command:

    keytool -import -trustcacerts -file mycert.pem -alias mycert -keystore cacerts

     I haven't tried that yet because I'm not yet sure where the certificate file is!  I'll find it, but no luck so far.

    I’ve already used the following keytool command to get a list of the currently trusted certificates for this version of cacerts:

    keytool –list –v –keystore cacerts  (while in the same directory as the appropriate cacerts file)

    and that did indeed come up with a list of trusted certificates, so I think I might be on the right track if I can get a copy of the right certificate file...and assuming that iReport is complaining about the certificate not being in Java's cacerts instead of complaining that it can't even find the certificate.  If that's the problem, I sympathize (I haven't found it yet either, after all!), but I don't know what I would do about that.



    Post Edited by cbarlow3 at 12/06/2011 20:09
  4. I love the Repository Navigator feature in iReport, but I can't find it documented in the iReport Ultimate Guide, the JasperServer Ultimate Guide, or the standard documenation.  It doesn't work for me anymore now that our company changed all our connections to SSH.  I think the repository navigator plug-in has a problem with our self-signed certificate, but I don't have the first clue what to do about it!  Help!

    Carl

  5. I love the Repository Navigator feature in iReport, but I can't find it documented in the iReport Ultimate Guide, the JasperServer Ultimate Guide, or the standard documenation.  It doesn't work for me anymore now that our company changes all our connections to SSH.  I think the repository navigator plug-in has a problem with our self-signed certificate, but I don't have the first clue what to do about it!  Help!

    Carl

  6. First a disclaimer:  I mainly use iReport Professional 3.7 still, so I don't use Tables yet, but I have a fair amount of practice using Lists, which share a lot of the same concepts.  Looking at your report (I do have a copy of 4.0), it looks to me like you've defined the table datasource correctly if the subdataset dstest is supposed to be using the same database connection as your main query.  Is table ref_code (from your subdataset dstest query) from the same database as tables tables school, ref_region, ref_office, and report_history (in your main report query)?  If so, then I don't see the problem with how you've defined the data source for the subdataset.

    One thing that is a little odd is that I think the same exact table will be printed for every detail--you haven't yet passed any information from the main query into a parameter of the subdataset that you could then use as part of a WHERE clause in your subdataset.  For example, maybe you're supposed to pass the division_id to the subdataset and only select id,title when id=$P{division_id}.  But I'm guessing that's a refinement that there's no point in trying to add until you can get the table to display in the first place.

    Carl

  7. If I extrapolate to the case where there are potentially more than two records being returned, this looks almost like two separate reports that just happen to use the same query. Here's a way I think you might be able to accomplish it, though:

    1. Double the number of detail records your query returns by tacking on a UNION ALL and a repeat of the query, but also add another field to distinguish between the two sections returned, e.g. instead of

    SELECT t.field1, t.field2, t.field3 FROM table as t, you instead have:

     

    SELECT section, field1, field2, field3 FROM

    (SELECT 1 as section, t.field1 as field1, t.field2 as field2, t.field3 as field3 FROM table as t

    UNION ALL

    SELECT 2 as section, t.field1 as field1, t.field2 as field2, t.field3 as field3 FROM table as t) x

    ORDER BY

    section,

    whatever-else-you-want

     

    Step 2: Set a Print When Condition on Detail1 that $F{Section}==1 and set a Print When Condition on Detail2 that $F{Section}==2. You can also create a group based on $F{Section} if you want and make use of group headers and footers to help separate the "Band 1" (Section 1) part of your report from the "Band 2" (Section 2) part of your report.

     

    Hope that helps out.

     

    Carl

  8. I pretend like there's no such thing as subreports, even though lists (and to a lesser extent, tables) have some limitations that subreports could get around.  There are three reasons:

    1. All the code for a list is contained in a single jrxml file and therefore also compiled into a single jasper file, which is already loaded when you run the report.  This generally means it will run faster than a subreport doing the same thing, because another jasper file doesn't have to be loaded into memory at runtime.

    2. I am usually using the list in situations where a stand-alone report wouldn't make any sense, and I don't like cluttering up the JasperServer list of reports with ones that shouldn't be run as stand-alone (even though I could at least organize them into their own folder, and I'm sure that would be part of my strategy if I used them).

    3. We have JasperReports Server embedded into our application that we sell to credit unions, but right now we do not directly schedule or run reports from within our software except through the JasperReports Server framework, so subreports would work fine for our clients right now.  But eventually we want to build tighter integration between our product and JasperSoft, possibly taking over some of the responsibilities of JasperReports Server.  When that happens, we've tested the ability of a short, generic Java program to compile and run a jrxml file and even to get a list of parameter names and data types that the report requires, and the ability to export to PDF, but I don't yet know how we would get subreports to work.  It's probably easier than I'm imagining, but I'm hedging my bet at this point by not encouraging subreports within our product.

    I'd say that reason #1 is probaly the main reason you might prefer a list or table if they suit your purpose:  keeping it all in the single jrxml if it's really only a utility for one main report makes it easier to maintain and makes it run faster.  Naturally, if you find yourself using the same list over and over and that list might need occasional changes, then the opposite might be true:  it might be easier to maintain as a separate subreport shared by multiple stand-alone reports.

    Did I help, or just confuse? :)

     

    Carl

  9. I actually sometimes have problems when using a List that goes beyond the page I start it on--it just stops and doesn't display the rest of the data!  I'm on iReport Professional 3.7, so I have Lists but don't yet have Tables.  Judging from the documentation on tables, most of what you learn to do a List is directly applicable, but it looks like the Table might have some additional capabilities that would be useful.  One of those is the ability to define a table header and footer (only printed once for the whole table) and column header and footer (repeated every page).

     

    Carl

     

    P.S.: "List" and "Table" are report elements/components that you can drag from the Palette onto your design area that work off of subdatasets.



    Post Edited by cbarlow3 at 11/23/2011 16:22
  10. I've tried multiple ways, and I frequently see questions about this, but I've never seen a way to do it. As was pointed out in another recent post, if the goal is to print something special/different on the last page footer, that can be done, but having some random part of the report know whether or not it is on the final page can't be done, because current page number and final page number are never known at the same time. If you evaluate page number at the END of the report, you no longer know what it was "now". That's how "Page x of y" works: it prints the "current" page number twice -- once evaluated "now" (x) and once evaluated at the end of the report (y). But they can't be compared successfully.

     

    Carl

  11. I'm still unable to use iReport to install reports ever since we switched to an SSL connection.  I can use it to author, but then I have to go into JasperReports Server to install.  The iReport JasperServer plug-in is more convenient when I'm trying to copy a report from one organization to another (although I still have to go in and change the data source and relink any input controls that are organization specific--like those that use a query which in turn use an organization-specific data source).  Any advice?



    Post Edited by cbarlow3 at 11/23/2011 16:07
  12. Okay, I think I've finally worked out the details.  I won't bore you with the whole diary of my testing.  I've attached a parent and child report where the parent has a single parameter FavoriteColor that you want to prompt for when you run it as a stand-alone report.  The report lists U.S. state and territory names and lets you click on one to execute the child report.  When you execute the child report, you pass it two parameter values:  FavoriteColor (which the child report doesn't really care about but is remembering as a courtesy to the parent report) and StateAbbr (which the child report needs for filtering purposes).  The child report then lists various cities in the selected state and also displays the favorite color value just to prove it passed through okay.  It also has a hyperlink at the top of the report that lets you call the parent report, passing back the value of FavoriteColor.

    Within iReport, on the Parent report I said that FavoriteColor should be used as a prompt, and on the child report, I said that StateAbbr should be used as a prompt, but FavoriteColor should not.  I'm not 100% sure that has any effect on anything.

    Okay, that's actually the easy part--the part that is more of a mystery is how to handle the input controls in JasperServer.  First, I think you need an input control for every parameter, whether you are planning on actually displaying a prompt or not.  So in the parent report, it was pretty straightforward: I made the FavoriteColor prompt have the default properties:  not mandatory or read only, but visible.  For the child report, I set up StateAbbr the same way, but for FavoriteColor I set it to Read Only, not mandatory, and not visible, because I don't want a user to be able to set or change the value of favorite color from within the child report.  Either you still remember what was passed to you from the parent report or (if you ran the child report as a standalone) you're stuck with the default value for this parameter (I chose "null" as the default).

    When I tested this, it almost worked the way I wanted: I originally had the JasperServer properties for both reports say "Always prompt".  When I ran the parent report, it prompted for favorite color, then gave a list of state names, and when I picked "California", it ran the child report, but it prompted for state abbreviation (although it did have the value "CA" already filled in, which was nice).  It did not prompt for FavoriteColor, since I made that input control invisible.  I clicked "Okay" and the child report ran correctly, reflecting that the favorite color from the original parent report prompt had been passed through correctly, filtering based on the state abbreviation that had been passed through, and also having a link at the top for re-running the parent report.  When I clicked on that hyperlink, I was again prompted for favorite color, although this time the current value was already entered as the default.  If I click Okay, the parent report looks fine.

    So then I unchecked the "Always prompt" checkbox in the JasperServer properties for both of these reports and retested.  Now the two reports call each other just fine and pass the parameter values silently, but if I try to run either report as a stand-alone report, it first runs with the default value for the parameter, and I have to click on the "Report options" icon to set/change the value for the parameter. 

    So, the crux of the problem seems to be this:  how do I tell JasperServer that there's an input control that I want to prompt for before running the report when the report is run as a stand-alone, but I want to not prompt first if I'm being run from a hyperlink?  I don't know the answer to that one, although I can think of a work-around at least:  deploy two copies of the parent report to JasperServer.  They are identical except in three things:  resource name (of course), label and/or description (so a user can tell which one is which), and the value of "Always prompt".  The one where you have "Always prompt" checked is the one you want users to actually run from the menu of reports.  The other one is the report name you want to put in your child report hyperlink _report parameter to run.  Similarly, if you need your child report to be available as a stand-alone report, you might need two versions of it as well.  The one that does not prompt is the one you code into your parent report's hyperlink _report parameter.

    It would be nice if instead of "Always prompt" yes or no you had a little more flexibility in defining the conditions under which you want to prompt the user first, but I don't know of any way to do that.

    Carl

     

  13. So, the student (report) becomes the master (report), eh?  Okay, I understand most of your example, parent report has two input controls that are used for actual prompting of the user.  Then hyperlinks are created in parent report to call child report, passing a different value depending on which link is chosen, and the child report uses that as input for a parameter.  But the parent must also pass the two input values from the original prompts so that a single hyperlink can be created at the top (let's say) of the child report that will take you back (rerun) the parent report, remembering the two original input values.  Your constraints are as follows:

    1. If you run the parent report in JasperServer, you want to be prompted for the first two input values.

    2. When you click on a hyperlink in the parent report, you do not want to be prompted for the single input value that the child report actually uses.  You want to just pass the value and have the child report appear with no prompts.  (we also plan to silently pass the original two input values that the parent report used, even though the child report doesn't need them for the visible part of the report, because we anticipate that we want to remember these two values when we build the hyperlink in the child report)

    3. Similarly, when you click on the hyperlink in the child report that is supposed to take you back to the parent report, you do not want to be prompted for the two input parameters the parent report actually uses--even though you are prompted for those two values when you run the parent report as a standalone instead of from a hyperlink.

    4. I'm not clear on whether or not you have a requirement about what happens if you try to run the child report as a stand-alone report instead of through the hyperlink.  You stated that the two values that you're trying to remember for the parent "can't be input controls for the child", but I assume what you mean is that you don't want the user to be visibly prompted--at least not when they are running the report from a hyperlink, and I already stated that requirement in #2 above.

    So I'm going to try to work up a short example that meets criteria #1-3 above, and I'm not going to worry too much about #4 behavior until I can get #1-3 working, and then I'll just see what I end up with.  Stay tuned.

    Carl

  14. Sounds like one of two things is happening:

    1. Either you are getting an input control prompt for the child report when you click on the hyperlink (that doesn't happen in the example I wrote...the child report has an input control defined, but the parent report just passes the value behind the scenes the way you want it to), or

    2. You've gotten the child report to work correctly from the link, but you also want it to be run independently sometimes and not prompt for input (I think this is less likely...I would think that if you run it independently of the parent report, it would be okay to prompt).

    If #1 is the issue you're experiencing, then I reiterate that I don't have that problem with mine.  If I have time today, I'll try to come up with two reports that work even without a connection to a database, and I'l pay close attention to how I hook up the plumbing when I deploy to JasperServer.

    Carl

  15. If you're using JavaScript, getMonth() returns 0 through 11 instead of 1 through 12 to represent January to December.  And getYear() returns the number of years since 1900 (two digit years for 1900-1999 and three digit numbers from 2000 on.  But apparently there is also a getFullYear() function that returns the full four digit year.

    Hope that helps.

    Carl

  16. I think you need to create input controls on the child report as a way of making the child report accept input from the parent report into the appropriate parameters.  And I don't understand why that's a "waste" as you mentioned in another similar post.  BUT...if the problem is that your child report is getting the correct input AND still prompting, then there's an easy solution.  In JasperReports Server, say that you want to "Edit" the child report.  Go to the "Controls and Resources" page that lists your input controls, and make sure that the check box marked "Always prompt" is unchecked.  That worked for me, but if that doesn't 100% fit the bill, you might also look in iReport at how those parameters are defined.  There's a checkbox for each individual parameter called "Use as a prompt".  I have those checked, since the parameter value is coming from an outside source (the other report in this case), not being internally calculated based on prior variables, environment, etc.

    Hope that helps,

    Carl

  17. I posted on iReport forum also, since in my case this is about using the JasperServer plug-in, but since that topic really bridges two products, I'm posting here as well...

    We recently changed our product so that it can only be reached through SSL with an https:// URL on port 8443 instead of an http:// URL on port 8080.  We're using a self-signed SSL certificate, and it's working fine for our main application.  I also don't have problems with iReport running previews against our database on the AIX server, because the DB2 database connection is on port 50000.

    BUT...I've come to rely heavily on the convenience of the Repository Navigator pane provided by the JasperServer plug-in, and that requires that I configure a JasperServer URL to the repository, which used to be http://www.corelationlocal.com:8080/jasperserver-pro/services/repository.  Before I remembered to change anything, I got the following error:

    Error:

    ; nested exception is:

    Java.net.ConnectionException: Connection refused: connect

     

    Not a big surprise, really.  When I try to change only the http to https and the 8080 to 8443, I get the following error:

    Error:

    ; nexted exception is:

    Javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.

    So I assume that JasperSoft has a problem with the self-signed SSL certificate, and I have no idea what my best course of action is--I have no experience with SSL certificates, by the way.  Is there something I can do on our AIX server to make JaspserSoft/Java happy with our self-signed SSL certificate (if so, how do I do it?) and/or are there reasonably simple steps I can follow to get a non-self-signed SSL certificate installed that will take care of this?

    Carl

  18. We recently changed our product so that it can only be reached through SSL with an https:// URL on port 8443 instead of an http:// URL on port 8080.  We're using a self-signed SSL certificate, and it's working fine for our main application.  I also don't have problems with iReport running previews against our database on the AIX server, because the DB2 database connection is on port 50000.

    BUT...I've come to rely heavily on the convenience of the Repository Navigator pane provided by the JasperServer plug-in, and that requires that I configure a JasperServer URL to the repository, which used to be http://www.corelationlocal.com:8080/jasperserver-pro/services/repository.  Before I remembered to change anything, I got the following error:

    Error:

    ; nested exception is:

    Java.net.ConnectionException: Connection refused: connect

     

     

    Not a big surprise, really.  When I try to change only the http to https and the 8080 to 8443, I get the following error:

    Error:

    ; nexted exception is:

    Javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.

    So I assume that JasperSoft has a problem with the self-signed SSL certificate, and I have no idea what my best course of action is--I have no experience with SSL certificates, by the way.  Is there something I can do on our AIX server to make JaspserSoft/Java happy with our self-signed SSL certificate (if so, how do I do it?) and/or are there reasonably simple steps I can follow to get a non-self-signed SSL certificate installed that will take care of this?

    Carl

  19. Looks like I'm a liar.  You can definitely return values (usually totals, for example) from a SUBREPORT, because when you have focus on a subreport element, there's a place in the properties box where you can open up a dialog to control "Return values".  I see no such property on a list (I'm on Professional version 3.7).  You can definitely pass parameters, variables, etc. to a List, because I do that all the time, but I was a bit hasty in my generalization of how similar lists and subreports are, just because they both use datasets.  Sorry for the confusion and for raising your hopes.

    Carl

  20. Sorry to wait so long to reply...I appreciate your feedback.  If you still have that report that demonstrates a summary list extending to a second page, I'd love to get a copy of the jrxml.  Even though I probably won't be able to execute it, I'm hoping that if I hunt through the properties of the list, the summary band, etc., maybe I'll find out why mine gets chopped off.  The last time I just gave up and said "I guess you're not getting that handy list in your summary, are you?"  But predictably, I've run into another report where the user really is going to need a summary list that's likely to be just over one page long.

    Thanks!

    Carl

    P.S.: If I still can't get it figured out after I look at a working jrxml, I'll modify my example so that it doesn't actually hit a database but still has more than a page worth of data, verify that it still doesn't work for me, and I'll send you that example, just in case you think I'm crazy (you wouldn't be the first).

  21. Noticed an odd typo in my previous comment, which I'll fix.  The second of my three returned variables is named "SubTotByBranch", not "ButTotByBranch".  Not that it matters, but variable names can be helpful when they make sense!  I'll edit my earlier comment.

    Carl

  22. Luckily, I happen to have kept notes on this very situation from the last time I ran across it:

    ·         If you want a variable that is keeping a sum of this returned variable per group or per report, do not set these variables up with the usual Calculation of “Sum” and variable expression of $V{SubTotNegBal}, because the variable that it’s totaling won’t be evaluated until all the subreports have run.  Instead, set the Calculation to “System”, leave the Variable Expression blank, still set Reset type to “Group” (and set Reset group) or “Report”, etc. depending on what kind of subtotal you’re keeping.  Then create additional returned values for the subreport, the same way you created the original returned value, but this time using “Sum” as the “Calculation Type” instead of “Nothing”.  My main report NegSharesByBranch.jrxml defines three variables that are all returned from the subreport:  SubTotNegBal, SubTotByBranch, and GrandTotal.  They all have a Calculation of “System”, and in the subreport mappings, it shows that they all come from the same subreport variable, but the first one has a Calculation Type(in the subreport return values dialog) of “Nothing” and  the other two have Calculation Type  of “Sum”.  Additionally, in the main properties for these variables, the reset type of these three variables is “None”, “Group”, and “Report” respectively.

     

    As I re-read these notes, it took a while for it to be clear to me, so I've attached two jrxml files in case you need clarification.  The good news is that if you're already successfully returning the ONE value from the subreport to the main report, you've already done the "hard" part.  Hope that helps.

     

    Carl



    Post Edited by cbarlow3 at 08/31/2011 18:39
×
×
  • Create New...