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

kchaudhry

Members
  • Posts

    248
  • 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

Posts posted by kchaudhry

  1. You can achieve this by creating a crosstab report. If you are not familiar with crosstabs, here are some steps to create a simple crosstab.

    1. The query below will show you the Name of the Sales person, the name of the items they have sold and the quantity of items they have sold. Place this query in the main report query section.

    select 'John Doe' as 'SalesPerson', 'Tennis Balls' as 'ItemsSold', 2 as 'Quantity'
    union all
    select 'Jane Doe', 'Baseball Gloves', 3
    union all
    select 'Jane Doe', 'Pool Table', 5
    union all
    select 'John Doe', 'Pool Table', 2

    2. Go to create new Crosstab and place this in your "Summary" band
    3. Select the available dataset. In this example it will be the main report query then click next
    4. Select the "SalePerson" field for Row group 1 then click next
    5. Select the "ItemsSold" field for Column group 1 then click next
    6. Select the "Quantity" field for Detail field and select "Sum" for Function and then click next. **Note** If you are already doing the  calculation in your query then you can set the Function to "Nothing".
    7. Depending on your requirement, select the appropriate group totals. For this example we will have both row and column totals then click next or finish
    8. Now run the report
    9. For formatting changes either go to the "crosstab-1" tab on the top or simply right click on click on "Go to crosstab design tab..."
    10. This is all you need to do to create a simple cross tab.

  2. One way of doing this is by creating a new column in your query where you can define your desired order of the months and then "Order By" that column. When you use this query you will have to check the "data is presorted" option in crosstab properties.

    Hope this helps

  3. For the background color of the cell are you using a style? If so, then do you have the mode set to "Opaque"? I have it set this way and it works for me in excel/pdf/html. For the second question simply right click on the band you want to supress and change the hieght to 0.

    Hope this helps.

  4. Eventhough "Data is Presorted" has always worked for me. One way of doing this is to create a new column and sort based on that column. For example you can use sort/decode like this

    select case when tablename.fieldvalue = 'Sample1' then 1

                          when tablename.fieldvalue = 'Sample2' then 2

                          when tablename.fieldvalue = 'Average' then 3 end orderfield

    from tablename

    order by  orderfield

  5. Yes, you can have crosstabs in groups. You just need to change the "Reset type" property to evaluate properly. For example if you are placing your crosstab in the group footer then right click on the crosstab then to go to crosstab properties > crosstab data > reset type and set that to "Group" and for "Reset group" select the name of your group and it should work. I have attached an example.

    Hope this helps!

  6. oops, I am using a very old version so wasn't aware of that. Here is what you can try.

    1. Create a new Text Field

    2. Right click on it and go to properties > font > check "is styled text" (do not check bold)

    3. Now go to Text Field tab and paste the following in textfield expression

    "<style isBold=\"true\" pdfFontName=\"Helvetica-Bold\">"+"Test"+"</style>"

    If this seems to work then simply replace "test" with your desired text.

    Hope this helps!

  7. 1. The query below will show you the Name of the Sales person, the name of the items they have sold and the quantity of items they have sold. Place this query in the main report query section.

    select 'John Doe' as 'SalesPerson', 'Tennis Balls' as 'ItemsSold', 2 as 'Quantity'
    union all
    select 'Jane Doe', 'Baseball Gloves', 3
    union all
    select 'Jane Doe', 'Pool Table', 5
    union all
    select 'John Doe', 'Pool Table', 2

    2. Go to create new Crosstab and place this in your "Summary" band
    3. Select the available dataset. In this example it will be the main report query then click next
    4. Select the "SalePerson" field for Row group 1 then click next
    5. Select the "ItemsSold" field for Column group 1 then click next
    6. Select the "Quantity" field for Detail field and select "Sum" for Function and then click next. **Note** If you are already doing the  calculation in your query then you can set the Function to "Nothing".
    7. Depending on your requirement, select the appropriate group totals. For this example we will have both row and column totals then click next or finish
    8. Now run the report
    9. For formatting changes either go to the "crosstab-1" tab on the top or simply right click on click on "Go to crosstab design tab..."
    10. This is all you need to do to create a simple cross tab.

  8. There a couple of ways you can show the value for 5. One way is to use the "case statement" in your sql or the other way is to use a "full outer join" in your sql. I prefer to do the case statements. Here is an example

     

    select sum(a.case1) 'Value 1',
                sum(a.case2) 'Value 2'

    from

    (select case when fieldvalue = 1 then 1 else 0 end case1,
                 case when fieldvalue = 2 then 1 else 0 end case2)a

    Just keep adding all the conditions. This is sql server syntax, you might have to adjust it for the database that you are using. As for your other question, why are you putting the variable in the detail band? Can't you put it in summary or group footer?

  9. On the add/modify group properties screen there is a property called "min height to start new page". You will need to change this for your subgroup. If you get the height of your subgroup header + the height of you details band and put the sum of these values for this property it will force the subgroup to be printed on the next page. You might have to play around with the numbers a little but it will work.

    Hope this helps!

  10. Unfortunately, I don't have that version so I won't be able to tell you the specifics. However, from the main report can you right click on the crosstab element and see if you get the option for "crosstab properties".

×
×
  • Create New...