I have a JRXML with an SQL query inside the template. If I try to generate report (from java and Tibco Jasper Report) the preview and the pdf show me the correct data. The Excel version instead show me only the tables, without any rows (that I see in the preview). Alle the tables are designed with jr:table.
Anyone know why this happens?
Thanks
Luigi
Solved!
The issue was a tiny text field (most probably a type during cut and paste inside the jasper report tool) overlapped on the jr:table.
Removed this, the report is correctly rendered also on xlsx.
Related
I am using Jasper Report API 4.5 (ready to update if required for this solution). With Jasper Report I am exporting report to HTML, Excel, CSV and PDF. A situation I came across is that if data is having valid excel formula then on exporting data to Excel and CSV and viewing file to MS Excel, it executes excel formula. This causes a security issue as some data is having excel formula to perform some action on local computer then it may harm system.
We can not validate data at the time of insertion, doing so may fix the problem. But currently there is no data validation as such to prevent inserting excel formula. Preferred solution to me is to manage from Jasper Report.
My question is, is there any mechanism or export parameter which can prevent excel formula to be executed? Or is there any way to print data as is and ignore excel formula?
For Excel export:
We can use Apache POI or SmartXLS API to set cell type to Text externally in order to get same result from database.
For Apache POI, we can set cell format type as "#", here is the link from Apache POI javadoc.
For SmartXLS, we can set workbook range style to set format type as Text, code snippet for it would be like below:
RangeStyle rangeStyle = workBook.getRangeStyle(1, 0, 50, 0);
rangeStyle.setCustomFormat("#");
For CSV Export:
Upgraded JasperReport 6.3. There is a feature to add enclosure to csv field. By default excel have single quote (') as field enclosure, so that may execute the field as formula. To avoid that we can set enclosure field to (`).
SimpleCsvExporterConfiguration reportExportConf = new SimpleCsvExporterConfiguration();
reportExportConf.setFieldEnclosure("`");
reportExportConf.setForceFieldEnclosure(true);
I have a crystal report where I need to mail the users the data in the excel as an attachment but with the condition that filters are enabled in each columns of the excel report .
If I have 10 columns in excel , user doesn't want to apply filter explicitly rather they want the filter already present so that they can filter based on any column .
If there is another better way of filtering the data on user side please suggest that too.
There is no way to do this from within Crystal reports. You can write an application, which will export the report to Excel, open the Excel file and add a filter.
There is a free version of R-Tag, which supports this feature. You can see it demonstrated here: http://www.r-tag.com/Pages/Preview_RTagAndBOE.aspx
Use the menu to jump to "Advanced report extensions" or go to position 5:26
If this works for you, here is the link to the free edition:
http://www.r-tag.com/Pages/CommunityEdition.aspx
I have 5 Webi reports and all these reports works fine. Out of the 5 reports , 3 reports i could export to available mode. But the other 2 reports too i can export to pdf or excel or excel 2007. Here come the problem. When i export to excel or excel 2007, i do not get the exact structure of the report, like the table and the values. What i get is complete blank with Report Tab name.
Have anyone gone through this kind of problem? If so please help me if i went wrong for this 2 reports alone.
Thanks
Niki.
First select the Table and Check in Vertical Table setting and if you see any Blank variable added into report, please delete.
So that report will extract without any error.
You can set preferences if you want to optimise export to Excel to preserve formatting or preserve data. Try configuring your preferences to preserve data or preserve formatting when exporting to excel and experiment.
Exporting to excel can be tedious, your webi report needs to be optimised to properly export to excel and preserve formatting and data
I have an SSRS Report in which few columns will be made visible programmatically. The Report gets generated succesfully, but when it's exported to CSV, the columns whose "visible" attribute has been handled programmatically doesn't get exproted to CSV.
Is there a work-around for this
issue?
What is the best way to implement
hide logic for columns in SSRS so
that there are no issues while
exproting to CSV/Excel?
See http://blogs.msdn.com/b/bimusings/archive/2007/02/07/reporting-services-why-aren-t-all-my-report-columns-exporting-to-csv-and-or-xml.aspx which explains that CSV (and XML) is a data format rather than a layout format. If the visibility is toggled via a formula as you're doing, it won't be rendered at all in CSV (even if the visibility setting makes it visible).
I can able to create Excel document using Jasper Report but the problem is that fields are not properly aligned in the cells of excel sheet and all the data are populated in the plain surface without any cells.i.e) I cannot see any cells in the data populated area.Can u please give me suggestion to make proper Excel document with cell alignment.
I had this same struggle and came up with the following. At the time, I was using iReport (3.0.0) and was able to generate a good xls file. It may be easier in newer versions of iReport and/or JasperReports. Here's what I did:
I created a new report using the new report wizard and chose a tabular template. This creates a report with all of the fields in a line with no gaps between them. It is very key that fields are vertically aligned, that all the same height, and that there are no gaps between fields.
I removed all of the extra objects created (title, extra lines) except for the fields and the headers. I then collapsed all of the bands except the column header and detail bands.
On the report properties, I checked "Ignore pagination"
I changed the text color of the header fields, otherwise it ends up as white on white.
The rest of the important options can be found by selecting Options -> Export Options from the menu and then scrolling down to the "XLS Exporter" section. I attached a screen shot of the options I chose. You can experiment with the settings, but I found (through trial and error) that the options I ended up with work pretty well. These options are not stored in the report def file, they are attributes of the thing generating the report. iReport takes care of it when testing in that environment. We are using custom Java to generate the report in production and we set the attributes there.
XLS Exporter Dialog http://www.imagechicken.com/uploads/1270760205041768200.png