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

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;

Related

Crystal Reports not show numbers just blank field from XLS data source

I try to make a CR report from excel file. But the number fields are blank in CR (Like 97007244). If i put the cell one letter (Like X97007244), CR shows the field.
I tried to change cell type to text, but still not show.
What can I do?
Thanks!
The report probably assigned incorrect data type to that column.
Try to do Database, Verify Database...

Crystal Reports – Extra columns when exporting (Microsoft Excel (97-2003) format only)

When exporting a Crystal Report (2016) to excel format, I am getting extra columns in the report. This does not happen with any other export format. So empty data columns display in the first 30+ columns. How can I correct that?
This can get frustrating if the report is too complex, but if you design the report so that no fields overlap and there are no gaps between the fields, then the export should work better. However, if you have fields and objects in sections where the widths of things in one section differ from the width of things in another section, then you are going to get merged cells and empty cells in your export.
Sometimes its much easier to export the report using one of the (Data Only) Excel export options. This can help to force the export into single cells without merges and gaps, however, the exported spreadsheet will be unformatted and will require some manual formatting after the export when using this method.

Border around blank data in Crystal Reports

I'm currently creating a report in Crystal Reports and each item has a border. The problem is that some of the fields can have a NULL value. When a field has a value of NULL the border doesn't show up, leaving an unsightly gap in the data.
The only solution I was able to come up with is that I create a formula for each column that displays the value if it's not null or displays a blank space when it's not null to trick crystal into thinking there is a value. This would be a major pain and definitely be confusing to anyone trying to modify the report. Is there a better solution to this problem that I might have missed?
Note: I'm unable to modify the SQL.
You can change the report options to give the default value to the null fields. But it may be not desirable for other cases.
If you wanna try it, right click the report and select "report options". Check the options "convert database null values to default" and/or "convert other null values to default".
You can insert a textbox on the report, then place the field inside that textbox. The borders would be placed on the textbox and would always appear regardless of the field value.
A few drawbacks to this,
Formatting cannot be done on the field any more (e.g. if you needed to display 123 as $123.00 you'd need to create a formula to perform the formatting then insert that formula into the textbox)
Export the data to Excel would not respect the data type - any numbers would come over formatted as text (though displayed exactly as you formatted them on the report) with that little green arrow in the cell
I found that method from https://archive.sap.com/discussions/message/9923668#9923668

Display string formula not used when exporting from Crystal Reports XI

I've produced a report in Crystal Reports XI where I in one of the fields have used the display string formula to alter the apperance of some data as well as group similar data values to one value (e.g. "neg", "negative", and "-" now all displays as "negative" in the report.)
However, now when I export the report to CSV for delivery to a customer the raw data, and not the display string formula result, is in the export. I've tried all 4 settings with the checkboxes in the CSV export options.
Is there any way to make the display string formatted data beeing exported to the CSV?
Are there any alternate ways of achiving the desired formatting and getting the formatting preserved in CSV export?
Unfortunately, i've not found a way of using the display string formula and achieving the desired result.
Instead create a new formula and replace the object on the report with the new formula.
L

How to create Excel document with proper cell alignment using Ireport?

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