Jump to content
Changes to the Jaspersoft community edition download ×

Bypass Jasperstudio report building

Go to solution Solved by jgust,

Recommended Posts

Our workflow is:

1- Write and tune SQL query for report (using SQuirrel SQL)

2- Create report using query in TIBCO Jaspersoft Studio

3- Publish and check report on JasperReports server, fix if need be

4- Set schedule for exporting .csv on JasperReports server

After step 1 my report is finished. But to be able to export the report in step 4, I need to waste a lot of time on steps 2 and 3.

 Steps 2 and 3 take about 80% of the development time but add absolutely nothing to the end product which is just a csv.

Why does it take up so much time? Well:

For each field I have to manually place 2 textfields in the report. Exporting a 30 column table means repeating this 60 times. It is very very easy to make a mistake: to make the column too narrow to fit the values, or to misplace the textfield by one pixel and break the report completely.

Fixing errors is very time-consuming. Changing the width of column 4 means moving 26x2 textfields.

Reports are difficult to debug and if a database field changes name it is very time consuming to change the report (name is repeated in 6 different places.)

So, my question is, is there any way to bypass report-building and just go from query to export?



Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

  • Solution

Here is a low-effort way to create a CSV-designed report

1. Create a new blank report.
2. Modify the page format to be Ledger Landscape (you want as much canvas space as possible)
3. Click on the Detail band and change the layouts to "Spreadsheet Layout"
4. Repeat step 3 for the Column Header band.
5. Repeat step 3 for the Title band
6. Drag the fields from the Outline to the Detail band
7. Move the auto-created static text fields from the Column Header band to the Title Band
8. Delete the Column Header band
9. Run and export the report as CSV
10. Profit

The report canvas should look something like this on the design tab

The width and depth are of no concern to the CSV export format.  This is hard to read but you can use the Outline to find and select fields if modifications are needed.

Link to comment
Share on other sites

Thank you jgust!

Especially using Spreadsheet Layout and selecting all fields at once saves me days!

In addition I change Page Width to 2500 (Properties > Advanced > Report Page), this makes the report easier to read.

I've omitted the step of moving the static text from the Column Header to the Title Band, for me the column headers work fine in the Column Header band.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...