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

Create

Members
  • Posts

    25
  • 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 Create

  1. If you happen to be using Jaspersoft Studio 6.5.1, here's how you change your password and other JDBC settings. First get to the Repository Explorer tab. You might have to Menu to Window | Show View | Other | Jaspersoft Studio and select Repository Explorer. In the Repository Explorer tab under Data Adapters, right click your data adapter name (mine is named 'Links') and select Edit Data Adapter from the shortcut menu. Inside you can set your JDBC driver, JDBC URL, and Username and Password, as well as Connection Properties and Driver Classpath.
  2. I can't find any way to do this directly, but here's a workaround:1) First make the parameter's type String rather than Date. 2) Then enter a Default value expression for the date literal like this: "2018-01-23" 3) Finally, use something like the following, which might need to get adjusted for the type of SQL you're using: For MariaDB (or MySQL) SQL use: STR_TO_DATE($P{From},"%Y-%m-%d"), where you need to first replace 'From' with the name of your actual parameter.This allows you to easily edit the default value as a string, and then use it as a date type in your SQL.
  3. I am trying to put a page number in the page footer, but also find that when there is only a summary on the last page and no details records, that the page number doesn't get printed. Unfortunately the FAQ mentioned above is now missing, i.e. you get https://community.jaspersoft.com/search?query=uploads%20publish%20jasperreportswebsite%20trunk%20faq#FAQ12 ??
  4. Set the paramater MyField as follows: Class Type: java.lang.String Default Value Expression: "`Table1`.`Field_B1`" <-- Be sure to include the outer double quotes! (To mean it's the value of a string, not what creates a string) Then write the WHERE as follows: WHERE ifnull($P!{FieldName}, FALSE ) = TRUE Note the use of $P!{..} not $P{..}. TIP: It seems you can't insert a parameter between single back quotes, i.e. not this `$P..`, rather you must include the back ticks inside the parameter's value, i.e. "`table_name`.`field_name`".
  5. Q: Is it possible to use the value of a parameter (of class java.lang.String) as a field-name inside a function in a WHERE clause (that is, for the Dataset and Query Dialog, in the Query/text area)? Why needed: I'm trying to build a number of trivial master reports that each call a common complex subreport. These master reports each pass a different parameter to the common sub-report with the name of a certain boolean field to test in the WHERE clause. In other words in my underlying table I have several boolean fields, let's call them Field_B1, Field_B2, Field_B3. Master report #1 needs to test if Field_B1 is true and only print those records. Master report #2 needs to test if Field_B2 is true, and only print those records. Master report #3 needs to test if Field_B3 is true, and only print those records, etc. Otherwise the master reports are the same (and so use a common sub-report). Example: Let's say the sub-report has a parameter named MyField, with it's default value set to the following string: `Table1`.`Field_B1`. How do you write something like this: WHERE ifnull($P!{MyField}, FALSE ) = TRUE for it's WHERE clause? (If the field is null, assume its FALSE; then test if it's TRUE). What I've tried: So far I've tried $P and $P! (and even $!P). Also tried removing the back ticks. Tried just replacing the whole WHERE ... line with a parameter. Also I've tried setting MyField to both string and boolean. I guess I don't understand just how and where $P{} and $!P{} parameters can get put into a SQL statement. And I seem to be stumbling over the needed back quotes. Thanks.
  6. Create

    scriptlet

    From Jaspersoft web site, in: Home » Exchange » JasperReports® Library download jasperreports-6.6.0-project.tar.gz. Inside it under demo/samples/scriptlet are the following: ├── build.xml ├── docs │ ├── defaultAnt.png │ ├── index.xml │ ├── jasperviewer.png │ └── runServer.png ├── ivy.xml ├── readme.txt ├── reports │ └── ScriptletReport.jrxml └── src ├── ScriptletApp.java ├── Scriptlet.java └── SimpleExportProgressMonitor.java readme.txt says: On Debian the ant package comment is: And the ivy package comment is: Install the above two packages. Then when you run ant -p as they tell you in the readme.txt you get: Running ant test unfortunately gives: ant clean gives: ant compile also fails: Not sure which name they mean? So they say to check, and for me in /usr/share/ant/lib I'm seeing the following files: Is this what they mean by "the implementing library"? .. I'm lost and don't know where to go from here... ???
  7. Create

    scriptlet

    From Jaspersoft web site, in: Home » Exchange » JasperReports® Library download jasperreports-6.6.0-project.tar.gz. Inside it under demo/samples/scriptlet are docs/ reports/ and src/ folders.
  8. When I print from GNU/Linux, Debian 9.4 I get a fuzzy page offset to the left and top, and about 80% of full size. Solution for me was to Export to PDF (the little diskette symbol to the lower top toolbar, and the pull down arrow to the right of it). Then when I print the PDF it looks good. (This is good because I just spent a week learning JS Studio and designing a complex report with a whole bunch of sub-reports, and THEN when I finally got it done, it wouldn't print!!! I just about freaked out.. Till I figured out the export trick. :-) -- Cheers
  9. The following assume's all sub-report's totals are named Total, and their accumulated sub-total in their Summary band are named Total1. In the parent's report 1) Under Outline right click on Variables and add a new variable named Grand-Total. This will be where the sub-report's sub-totals will be accumulated (added together). Set the Initial Value Expression of Grand-Total to 0 (zero). 2) Under Outline, Detail 1, Subreport, Properties, Subreport tab, click the Edit Return Values button, and Add. Set the following: From Variable: To the name of the variable in your sub-report that has the total. In this case 'Total1'. (Still not sure how it got named that.)To Variable: To the name of variable in the parent report, in this case Grand-Total.Calculation type: Set this to Sum. Each time the sub-report runs, this adds Total1 to Grand-Total.3) Repeat step 2 for each additional sub-report. 4) In the parent's Summary band create a Text Field and set it's expressioin (value) to $V{Grand-Total}.
  10. [i'm sorry if this has been answered before, but I have looked at both the Jaspersoft Ultimate Guide and at many questions here, but so far I can't see how to do this.] I have sub-reports which produces a sub-total. Once that sub-total is computed, I want my parent report to get that sub-report's, sub-total for use in the parent report, to computer a grand-total. /* SUB REPORT 1: Detail band: +----------------------+ | Detail 1 2 | +----------------------+ | Detail 2, etc 5 | +----------------------+ Summary band: +----------------------+ | Sub-total: 7 | +----------------------+SUB REPORT 2: Detail band: +----------------------+ | Detail 1 1 | +----------------------+ | Detail 2, etc 3 | +----------------------+ Summary band: +----------------------+ | Sub-total: 4 | +----------------------+PARENT REPORT: Detail band: +----------------------+ | Subreport 1 7 | +----------------------+ | Subreport 2, etc 4 | +----------------------+ Summary band: +----------------------+ | Grand-total: 9 | <=== this is what I want to get, 9 = 7 + 4 +----------------------+*/[/code]Here's what I've done so far: 1) I can see that I can create a variable in Outline, Variables (both in the parent report, and in the sub-report). And I can read that variable within the report or sub-report it's defined in. But how to I set it? 2) And then how do I pass that variable from Sub-report to master-report? Specifics: In my sub-report's Summary band is Text box set to $V{Total1}. That's the total I want to give to the parent report. (I don't know how it got the name Total1 from the underlying field named Total. As I recall $V gets a total.) In my main report's Outline, Detail 1, Subreport, Properties, Subreport tab, Edit Return Values button, Add, what exactly do I enter for: From Variable:To Variable:Calculation type:Incrementer Factory Class:And what do these 4 fields do? Jaspersoft Studio is a pretty neat tool! Figuring out how to make it work has been difficult. But little by little I'm getting it to do cool stuff. Thanks!!
  11. From hozawa "If you're just getting syntax error in Jaspersoft Studio, just ignore it and save it. Most of the time, it's possible to execute even when Jaspersoft Studio shows syntax error if you are 100% sure that the sql statement is correct." - hozawa
  12. Jaspersoft Studio flags an error for these fairly standard conditional syntaxes: SELECT if( 1>2, 3, 4) As foo, CASE WHEN 1=2 THEN 3 ELSE 4 END in MySQL As Bar[/code]What's the workaround?
  13. Long time since you posted this. Did you ever get it to work? Or still need help?
  14. Yes, sub-reports can be nested. You nest them exactly the same way you hooked up the first one.
  15. First, use Position Type: Fixed to Top and the control will stay put and not be pushed down if things above it overflow. Or set it to Float to allow it to be pushed down by things above getting bigger. Fixed to Bottom is similar to Fixed to Top. Next, splitting appears to refer to how data is split, from one page to the next. It's discussed in The jasperreports-library-ultimate-guide page 118, in PREVENTING BAND SPLIT. Finally, from: http://jasperreports.sourceforge.net/schema.reference.html#reportElement stretchType Specifies the element stretch behavior relative to its element group siblings or element container stretch. Use: optional Base Type: string Values NoStretch The element won't stretch vertically beyond its natural stretch height, when the container stretches to display other elements.RelativeToTallestObject Deprecated. Replaced by ElementGroupHeight value.RelativeToBandHeight Deprecated. Replaced by ContainerHeight value.ElementGroupBottom The element will stretch to accommodate the overall natural growth of its group, but also taking into account the shifting Y position of the element within its group. See the elementGroup element, to see how to group elements.ElementGroupHeight The element will stretch to accommodate the overall natural growth of its group, without taking into account the shifting Y position of the element within its group. See the elementGroup element, to see how to group elements.ContainerBottom The element will stretch to fit the container height, while taking into account its new Y position. This results in the element preserving its distance to the container's bottom edge.ContainerHeight The element will stretch to fit the container height, but without taking into account its new Y position. This might results in the element being shifted up (due to collapsing elements above) or down (due to stretching elements above that push it downards) relative to the container bottom edge. In case the element its already pushed downwards, the additional stretch imposed by the container might actually throw it beyond the container's bottom edge, in which case the element will not render at all. Default: NoStretch
  16. Hi, Sorry, I can't help you as it sort of sounds like a bug. I'm trying to learn this too. Would you mind briefly saying what these split types do exactly, i.e. null, stretch, prevent, immediate? Also when you say you have 3 bands, what types are each band? Thanks. UPDATE - found A to my Q here on p118: https://community.jaspersoft.com/documentation/v64-v640/jasperreports-library-ultimate-guide
  17. In your main report you have to have a parameter set for each subreport. This is kind of confusing because there are two different types of parameters. In Outline | Parameters, these are the parameters that come IN to the master report. In Outline | Title | Subreport | Subreport click the "Edit Parameters" button to set up parameters that come from your master report and are given to the sub report. For example I have added a parameter Named ID with Expression $F{ID} . This gets the ID from my master report and passes it to the name "ID" in my sub-report. Then in the sub-report you use this parameter in a WHERE clause like: WHERE ID = $P{ID} This selects only sub-report records that match the primary report records. So when the master report is run it loops thru it's data source getting each record one at a time. It passes the ID to the sub-reports. The each sub report returns just the records for that record. Tip: 1) You must save your sub-reports (with ^S or File | Save) after editing them, and before running the master report! Otherwise any edits to them won't be seen by the master report. Hope this helps.
  18. I can't tell what you are trying to achieve. Can you spell out what the report output you hope to see would look like for your example data?
  19. Hi guys, I'm trying to understand how to control run-time vertical spacing, especially with embedded sub-reports which can display a variable number of records. I'm also confused by the terms 'Stretch' and 'Split' as used in the Jaspersoft documentation. Either I don't understand them, or they don't work as expected. To me 'Stretch' is like stretch-jeans, they get bigger when you put your legs in. Then there's a 'split' if things get too big inside. LOL. Ok, enough kidding, what do these terms mean in the Jaspersoft context? I'm already familair with the ability to vertically flow data from a variable number of input records with MS Access, HTML, Word, LibreOffice Writer, etc. So I'm hoping for similar functionality in Jaspersoft. It seems to work only some of the time. In Access for example, almost all controls have 'Can Grow' and 'Can Shrink' options to control page flow: * When Can Grow is true, and if there is more content then the bounding box grows larger, and everything below it is pushed down. * When Can Shrink is true, and if there is less content, or none, then the bounding box shrinks smaller, and everything below it scoots up. In HTML you can fix the size of a <div> .. </div> container, or you can let it's content determine the size. Everything that follows below it depends on it's run time vertical size. Does Jaspersoft have this sort of functionality, and if so how does one control it? For example a sub-report's appearance properties have "Stretch Type", but I can't seem to make this do anything. (I'm working on a sub-report with 1 to 4 possible lines in my Title band.) Bonus points if you will say what these mean under Size: Stretch type: No Stretch Relative to Talles Object (depreciated) Relative to Band Height (depreciated) ElementGroupHeight ElementGroupBottom ContainerHeight Container Bottom[/code]Thanks
×
×
  • Create New...