ivana.cace Posted April 20, 2023 Share Posted April 20, 2023 Our workflow is:1- Write and tune SQL query for report (using SQuirrel SQL)2- Create report using query in TIBCO Jaspersoft Studio3- Publish and check report on JasperReports server, fix if need be4- Set schedule for exporting .csv on JasperReports serverAfter 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 More sharing options...
Solution jgust Posted April 22, 2023 Solution Share Posted April 22, 2023 Here is a low-effort way to create a CSV-designed report1. 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 band6. Drag the fields from the Outline to the Detail band7. Move the auto-created static text fields from the Column Header band to the Title Band8. Delete the Column Header band9. Run and export the report as CSV10. ProfitThe report canvas should look something like this on the design tabThe 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 More sharing options...
ivana.cace Posted April 26, 2023 Author Share Posted April 26, 2023 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 More sharing options...
jgust Posted April 27, 2023 Share Posted April 27, 2023 FYI, I have to use the Title Band because some of my reports have over 200k records. No sense in repeating the column names in the output file. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now