How to make a blob field appear on Crystal Report XI? - crystal-reports

Within our database we have invoices being saved and uploaded as a PDF; however within Crystal Report the field is marked as a blob. When attempting to drag this field onto the report it comes out blank, is there a way to have the image appear on CR XI, from a blob field?
I am using Crystal Report 11.5.11.1470
I am using a SQL Database, Syntax is SQLServer

Based on my research, and experience, you cannot display a blobulized PDF in a Crystal report.
https://scn.sap.com/thread/3207588
Please note that Crystal Reports does not support anything other than 'Images' in Blob fields. If that Blob field has text, pdf file, doc file or just anything other than an image, Crystal Reports will return Blank.
There is a false statement floating around that you can add an OLE PDF object to Crystal and then change the location of the PDF to reflect the Blobulized field, but this does not work - a blob field cannot be used in a formula.
One option would be to use another program/utility to retrieve the PDF from the blob, run the Crystal Report and export to PDF, then combine both of the files. Depending on the report and the blob, that may not work.
Otherwise, you could possibly convert the blob to another data type and then use Crystal to display the data.

Related

Reports in Jasper have no results when export in XLSX

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.

Jasper Report Excel-CSV Export: Prevent executing excel formula

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);

Crystal Reports clipping data on export to Excel

I'm using Crystal Reports XI.
One of the text fields exports only data visible in the field. Other fields are fine: it doesn't matter what size are the fields on the design, they will still export full content to excel.
This is the only field I know that behaves this way. The only way I could find to preserve the data is to either:
expand the field to accommodate the longest possible description (which is not always possible even on A2 size), or
allow the field to grow (which results in exporting to multiple lines).
Is there any way to stop data from being clipped?

number format changed while exporting from 2008 Crystal Report to excel .csv file

From 2008 Crystal Report view, the number format reads as 580015704027 in which is correct.
When exporting data from .rpt to .csv, that number format changes to 5.80016E+11.
How do I make it stick so that it will be exported correctly while on automation?
Thank you,
Holly
Here is the solution.
This solution works if you are using a database field with number format.
Right click on the filed go to Format Field.
Move to tab Number.
select last option (1,123.0000)
Now export to .CSV format.

Crystal Report export to excel data in wrong column due to null fields

I try to export a crystal report to excel. The report is list of data. Some date may be omitted but, of course, the column order must be respected. But with an empty field all the data are shifted to the left and the column is not right any more.
How can I setup the crystal report to add empty cell for an empty data field ?
I put a blank text file field same height and width Over the field with the issue.
Then moved the field to the back. It worked, all data is aligned correctly in the Excel spreadsheet.
You'll need to experiment with the report's Excel-export options (File | Export | Report Export Options...). Consider 'Data Only (XLS)'.
I usually use TTX format, as it seems to work better than XLS.
Try add export option .ExcelUseConstantColumnWidth = false;