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

goober100

Members
  • Posts

    3
  • Joined

  • Last visited

goober100's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Hey, another thing you can do is to embed the crosstab report into the "Detail" section of a different report: Create a main report that would pull up an individual record/field that you would use as a parameter to help create your individual cross-tab report the parameter passed into the SQL statement of the cross-tab report, i.e. "lname = $P{lname}". Drag and drop a subreport from the pallette into the detail band, and when it asks select "Just Create the Subreport Element". Then in the properties for that subreport, you enter the name of your crosstab report in "Subreport Expression", use the connection expression in "connection type", choose the parameter "Report Connection" for the connection expression, and then set up whatever parameter that you need passed in from the main report to the subreport in the "Parameters" ... box. Let me know if you dig this and if you have any other questions
  2. Figured it out; I was lead to believe that you could only insert subreports as type columnar or tabular, not as a crosstab subreport. I was also lead to believe that you could only put crosstab reports in the "Summary" band. What you need to do is set up the crosstab reports as seperate reports and embed them into a main report. Here's what you can do: Create 3 individual reports (.jasper files) Report 1: Set up your main report to only pull the main values that you want to use to gather parameters to send to your subreport (that will contain it's own queries to pull all your sub-reporting data). Report 2: Create a seperate report all together, remove all bands accept for 'Summary' Band. Make sure that you add the parameters that you will need passed in from the main report in this report and that you put the parameters in the sql query (i.e. "where lname = $P{lname}"). In the summary band create and build the crosstab report that you want to show up as sub-reports in the main report. Report 3: (This is if you wanted a "Summary" crosstab report representing all of the detail "subreport" crosstab reports). Create a seperate report all together, remove all bands accept for 'Summary' Band. In the summary band create and build the crosstab report that you want to show up as the Summary cross-tab report in the main report. You would not use parameter values to build this report - you will put this report in the "title" band of the Report 1 and title section is seperate from queried data. Inside of Report 1: Drop and drag fields into the "Detail" band that you are using as parameters to pass to Report 2 (subreports). Drag a "subreport" icon from the pallette into the Detail band. Choose "Just Create The Subreport Element" and finish. With the subreport active, in the properties window, go down to subreports area. Here, you will populate the Subreport Expression field with the full name of the jasper report that is the Report2 in quotes (i.e. "jaspersubreport.jasper"). In the Connection Type field, choose "Use a connection expression". In the Connection Expression, use $P{REPORT_CONNECTION}. Choose the "..." next to Parameters field. Here, you need to add the parameters that will be passed in to your subreport from the main report. Click "add" and enter the name of the field as the parameter name, and then for expression, you need to put the $F{lname} format to tell it to use the field from the main report. If you wanted a Summary Crosstab report to show up one time before all the sub-reports, you drop and drag a subreport into the "Title" band of the main report. Follow all the same procedures for setting up the sub-report properties, but you will not do anything with the parameters - since it is in the title section this report will need to be completely self sufficient.
  3. I have a crosstab report that I need to create crosstab sub-reports for (one subreport for each row of the main report). Has anyone ever done this? thanks, Ed.
×
×
  • Create New...