Wrapping text in crystal so that it does not add extra row in excel - excel

I have a field in crystal reports that has a lot of text. For that I went into Format editor and allowed wrapping of text for that field. Now when I export my report in pdf, it looks fine, but when I export it to excel it adds an extra row below a record that has more text in that field. How can I make it so that it does not add a extra row, but wraps the text in single cell only.

I have the same problem with extra rows and columns in my Crystal Reports exports. From what I can tell from my searching that it is caused by fields not lining up or being different sizes. You might be able to fix your issue by making all your fields in the row larger so they are the same height as the field with the large amount of text.
See this page:
Blank columns appear when exporting to Excel.

Related

SSRS how to set a merged column to be split in excel

I have an issue that I know is solve-able, I just cant find the setting or work out how to do it. I have a report where I have merged two columns. Lets say these are columns a and b. I want that when the report is exported to excel that you can click into column A, and it does not merge with column b. this would allow you to filter etc by the data under column a. The reason column a and b are merged in the first place is that the heading needs to go across two cells due to size.
I know this is do-able as it exists on a report i inherited, just i can't find the setting.
This is usually due to the misalignment of your header cells with your table cells. The Excel export tries to have everything formatted the same as in the report so it will sometimes use two columns for the table cells and merge them so it can align the columns to the header columns. This is problematic when it comes to manipulating, filtering and sorting the spreadsheet.
The best way to avoid this is to create an Excel renderer that doesn't render the header part of the report as described in my answer here.
However, if the cells need to be merged in your report deliberately then you aren't going to be able to do what you want to do using your current report as Excel will duplicate the formatting, including the merged cells.
Probably the only way to get something like what you are after is to create another report that is formatted the way you would like it to be in Excel. In the header of your original report put a text box (or an image with an Excel icon) with an Action on it to open the new, properly formatted, report in Excel, passing across parameters as appropriate. Now the user just need to click on the Action link in the original report to open the more user-friendly report in Excel.

SSRS - Columns Download to .CSV Despite Visibility Status

I have a Reporting Services 2012 table that hides certain columns based on parameter choices, since some choices will cause the dataset to exclude certain columns when run. So, a column such as PassportID would have a hiding criteria expression such as:
=IIF(Parameters!TransitMode.Value = "bus"
OR Parameters!TransitMode.Value = "train",True,False)
The columns are indeed hidden when the report is rendered, and when it is downloaded to Excel. The problem is that I need to download it to a .CSV file. The .CSV downloader in SSRS does not have a layout renderer that can preserve the hiding criteria the way Excel can.
I looked at the DataElementOutput property, but changing this from the "Auto" default only appears to be give the options of downloading or excluding unconditionally, rather than based on column visibility in the rendering.
Is there a way to exclude the entire rendered column from the downloaded .CSV?
The easy answer is to set the displayed value to a formula, using the Render format function. If the Render format is CSV, then set the "Displayed value" to be an empty string. The field will still be exported, but won't contain data.
That is, set the value of the textbox to something like:
=iif(Globals!RenderFormat.Name="CSV", "", Fields!MyDataField.Value)
A little bit more info:
SSRS 2012 and CSV export
Change the DataElementOutput from Auto to NoOutput.
DataElementOutput controls whether or not the data is included in the export. Column headers are already excluded by CSV and names of columns for CSV are derived from the name of the textbox for a data element. Visibility properties are not considered in the CSV export since visibility is a formatting feature.

Export and customize a crystal report in excel

I am having an issue is that while exporting a report to excel sheet, there are lots of spaces and empty cells between the data, as well as, the cells are merged.
Is there is a way to export the report and each field will be in a cell or to control that exportation, suppose my report looks like this:
No Trans_No
1 123
2 333
In my excel sheet, I would like
A B
No Trans_No
1 123
2 333
, But currently it is showing a merging of the cells and spaces , so instead of Trans_No will be in CELL B, it is in D.
So, is there is a way to control o export that?
mohs, welcome to StackOverflow.
Crystal Reports and Excel have very different methods and data structures. When exporting a .rpt into .xls format, Crystal has to make many compromises and judgement calls. Here are some suggestions:
Do you absolutely need to use Crystal in this process?
A. You can import data directly from your data source into Excel (without using Crystal) using Data->Import External Data.
B. You can export from Crystal into CSV format. If the Excel file is being made just for a machine to read it, CSV is a better option.
Keep your Crystal Report very simple.
A. After you drag & drop fields onto your design, do not resize or overlap them.
B. Make sure in your options, you have snap to grid checked.
C. Are your fields horizontally aligned? If not, they will probably be put on different rows.
D. If you are grouping data, you may want to suppress the group headers & footers.
If you are finding empty rows between your data, you can filter these out in Excel:
Select column
Data > Filter (Excel 2010)
Dropdown > uncheck 'Blanks'
I don't use Crystal Reports, but could you export to a CSV file, then import into Excel. The import will allow you to specify the delimiters and should format your data better.
From experience with exporting from older versions of Crystal to Excel, a couple of options:
(1) Export to CSV and open the CSV file in Excel.
This had the disadvantage that instead of appearing at the top of the report above the data values, the column headings would appear on every line of the output before the column values - like so:
No Trans_No 1 123
No Trans_No 2 333
This issue may have been resolved in CR XI - if not, the workround we used for this was to suppress column headings (so that only the values were included in the output), then copy and paste a standard spreadsheet heading for the report into the output in Excel.
(2) Consistently format all fields to the same, minimum size (typically, two grid widths), with columns aligned by snapping the left edge of fields to guidelines.
This produces output which is almost unreadable in the standard report viewer, but which should align correctly in Excel.

Excel changes date formats

I run a process to produce a rather large CSV file of data. Sometimes I find it helpful to open the CSV in excel, make changes manually, and then re-save. However, if there are dates in the CSV, excel automatically reformats them. Is there a way to prevent excel from doing this? It would be helpful if I could turn off all text formatting altogether.
If you prepend an apostrophe ' to the beginning of any date string during the export process, Excel will read the value literally (i.e. as plain text) rather than trying to convert it to a date.
This particular solution is handled during the export process. I'm not sure how you would change Excel to treat the file differently at runtime.
Excel does some nasty tricks when outputting XML. One of its tricks is to drop left most column delimiters if 16 or so consecutive rows have no values for these columns. This means that if you're splitting the lines up based on commmas then these rows will have a different number of columns to the rest.
It will also drop any initial 0's so things like numeric Ids can become messed up.
Another risk you run is chopping the file off short since Excel can only support a maximum number of rows. (Prior to Excel 2007 this was around 65536)
If you need to do anything to a CSV file other than read it use a text editor.
When you import the CSV file into Excel, be sure to pre-format the date column as text. There's a frequently overlooked option in the parsing that allows you to control the format column by column. This also works well for preventing the leading zeros in New England ZIP codes from getting dropped in your contact lists.
If you used the excel file version which is 2010 or later (not sure lower version), you can set up to use current operation-system date format or not in Excel/CSV file.
Right Click cell with date value (e.g. '9/12/2013') in CSV file and pop up the menu
Click 'Format Cells' and open a pop up screen
Go to 'Number' tab and you can see 'Date' was selected in 'Category' (left side) and 'Type' on the right side
Observed that there are two types of Date format (one is with () and another is not with ()). Read the comment there and you can find that you can use the date format which is not with date. It means that your changes to the CSV file will not be applied with your current operation-system date format. So, I think date format won't be changed in CSV file in this case.

Different results exporting to CSV or Excel

I have a simple report that I want to export to a CSV file. There is only the detail line that is grouped by one field, no group header, and a group footer for totals. The problem is when I export to CSV format, the total row for a group is listed in front of every record?
If I export to Excel and then save as a CSV file, the total row is where it belongs. However one field is spread across 3 columns then those columns are "merged and centered" which adds two commas in the middle of the line. And one column is added at the beginning of the record and two at the end of the record, for 3 more extra commas.
It would be easy enough to write a macro to "clean up" the spread sheet and export as a csv file for my end users. However corporate "insecurity" will not allow the end users to have macros.
Any help, suggestions, pointers to where else to look greatly appreciated.
cheers
bob
The CSV generated by any standard reporting tool does a flat data structure and hence would repeat all data set.
The XLS generated by the reproting tools are typically to be opened in the XLS and its XLS default behaviour to put additional commas for every merged cell.
The best way is to create a report with a layout that has equal data length columns even for the header, ie while formatting the report do not put the header in the center with larger lenght, bold and italics etc, put it as the first column and match the lenght with the data in the detail record.
This way you would be able to create a report that does not look presentable in XLS but would give you required data in the CSV

Resources