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

mmflynn

Members
  • Posts

    82
  • Joined

  • Last visited

Community Answers

  1. mmflynn's post in Error in addDataSourceAws.jsp - JasperReports Server 5.2 on EC2 was marked as the answer   
    This issue has been resolved. Customers with active support subscriptions can contact Technical Support and request the hotfix for issue #33210. Note that this issue only occurs if you download JasperReports Server version 5.2.0 and install it on EC2.
    Mary Flynn
    Jaspersoft
  2. mmflynn's post in Input Controls on Jaspersoft AWS was marked as the answer   
    Hi John - Based on your reference to the Freight report, I assumed you're using iReport and not the Ad Hoc report designer. If you're using Ad Hoc, then I need a bit more info on exactly what you're doing. Otherwise, continue on.
    Mastering the input control is very liberating. What you ran into is the flip side of a feature that is flexible and powerful. Unfortunately it was not obvious.
    I'll use your suggestion of the Freight report as an example. When you edit the Freight report unit and click the Controls and Resources tab, you see three input controls: Country, RequestDate and OrderId. These input controls were created to be part of the report unit. You can think of them as tightly bound. I recommend that you NOT set them up this way, but as reusable controls, but you'll learn that when you get to the reference material at the end..
    To see how this input control is defined, click on it. The Locate Input Control opens, and as you note, there are two choices. The first is what you want, and it really should read "Define or Edit an Input Control in the next step." Click Next.
    On the Create Input Control page, you can type anything you want for the prompt. It could be as simple as "Country" or more elaborate, such as "Select a country from the list", etc. The really really important part to making the input control work with your report is to exactly match the Parameter Name. This value needs to be the same spelling and case as the parameter in your report. References on how to do this at the end of this post.
    Back to the example. The Type selected for this input control is "Single-select Query". Click Next. The Locate Query page appears. Again, the first option should read "Define or Edit a Query in the next step." With that selected, click Next. 
    The next three steps walk you through naming the query as a resource, selecting its data source (what are you going to query) and then the query itself. 
    After you click Save, you'll see the Set Parameter Values page. It's not important for our example, and it can be confusing or seem redundant. For our example, just click Submit. Now, I'll tell you the reason for this page. Assume for a moment that your database includes two columns - one for the Country name (e.g., type = varchar) and another for the Country code (e.g., type = smallint). For the sake of efficiency, maybe you want to use the Country code (e.g., smallint) in the database WHERE clause instead of the varchar. But to minimize human error, you want to present the list of country names (e.g., varchar) to the user. This page allows you to do that with the "value" and "visible" columns. In this hypothetical example, the visible column could be country name and the value could be country code. To make this work, the SQL statement on the previous page needs to include both columns, e.g., something like this: 
    select country, countryCode from ORDERS group by countryCode order by country
    I added the order by so the country names would be in alphabetical order for the humans. If your data is pre-sorted in the database it may not be necessary.
    Hopefully this gives you enough to accomplish your near-term goal. Here's more information to help you out:
    Online help: http://help.jaspersoft.com/js-help-v5-en//Default.htm#search-input control
    http://help.jaspersoft.com/js-help-v5-en//Default.htm#js-help/Query_based_Input_Contro.htm http://help.jaspersoft.com/js-help-v5-en//Default.htm#js-help/Input_Controls.htm JasperReports Server Administration Guide, sections 4.3 and 4.4: http://community.jaspersoft.com/documentation/jasperreports-server-administration-guide
    iReport Ultimate Guide, section 6.2.1 Using Parameters in a Query: http://community.jaspersoft.com/documentation/ireport-ultimate-guide
    I hope this helps.
    Mary Flynn
    Jaspersoft
  3. mmflynn's post in Input Controls on JasperServer Pro AWS Ad-hoc Views/Reports was marked as the answer   
    If the data type is numeric, then unfortunately you do not have the list-of-values filter operators. You could consider changing the source data type from numeric to varchar/text. Sorry I cannot think of a better alternative.
    Mary Flynn
    Jaspersoft
  4. mmflynn's post in PAGE_NUMBER with separate title page was marked as the answer   
    I read some earlier posts from Teodor and Giulio to get this for you:
     
    Create a new Report Group. size=312]http://www.jasperforge.org/components/com_joomlaboard/uploaded/images/resetPageGroup.png
    Select the Reset Page Number checkbox. You can leave everything else blank.
    After you click OK you'll be on the Groups dialog box. Click Move up to make your new group the first group.
    Create a new variable. You'll use this instead of the built-in PAGE_NUMBER in your footer.
    [file name=resetPageVariable.png size=16062]
    Variable Class Type: java.lang.Integer
    Calculation Type: Count
    Reset Type: Group
    Reset Group: the group you created in step 1
    Increment Type: Page
    Variable expression: new Integer(1) [/ul]
    Edit the expressions used to show Page x of x. Replace $V{PAGE_NUMBER} with the variable you just created.
    [/ol][/ol]

    Should work -- good luck.

    Mary
    Post edited by: mmflynn, at: 2008/04/30 18:54
  5. mmflynn's post in Conditional Style Based on TextField Value was marked as the answer   
    I found your post while doing a little work on styles myself. Better late than never?
     
    You should be able to solve your problem by creating a default style with a conditional expression.
     
    E.g.:
    1. Create a style named "normal" (or whatever)
    2. Click Default style
    3. Add a Style Condition
    4. Write a boolean expression that would result "true" for all the fields you want to apply the style to. (I'm not very good at this part...)
    5. Apply the new style to the fields you want to evaluate.
     
    I'm not an expert, but this might help!
     
    Mary
×
×
  • Create New...