Number display as # in generated Excel file - excel

I have an Excel file generated by JasperReports. What you can see here is the Excel's column will be display ### if the number is too long. I don't want to resize the width of column, i just want to display the number without seen as ### and stretch the height. I have tried set the column to Stretch with overflow and Stretch type = Relative to band height
This is the screenshot:

You will need to set the appropriate Jasper Reports excel property on your report element, or on the whole report iself. Documentation: http://jasperreports.sourceforge.net/sample.reference/xlsfeatures/
Specifically
net.sf.jasperreports.export.xls.column.width.ratio
If these properties are not available in your JasperReports version, you may have to simply fiddle around with the sizing to get something decent.

Related

Printing Long Spreadsheets on One Page (Excel to PDF)

I have a time based chart and I am trying to print it on one pdf page. The chart spreads from column 'B' to 'UR' ~ 560 columns. I have the print setup for that area and to fit one page. It prints till column JU and disregards the rest. Not sure if there is a work around or if I am missing something. And if there is a vba script that can help with it.
I tried some additional variations and did experience the cut off issue. I couldn't quickly work out what created the limit, but it wasn't the number of columns; a guess is there is a limit to the size of the hidden "canvas" on which the chart is painted before its scaled back to print and/or save as PDF ... hence is related to the width of the chart. However you can see (roughly) from the screen shots below a chart spanning from B to UR (limited by yellow in column UR); the chart is 319cm wide. Then the saved PDF. The page setup was A4 landscape with narrow margins. Cheers.

Extra column inserted before other columns when exporting to excel

I know how tricky it is to align things in a way that allows a clean export to excel, however, on this one I am stumped and have never seen it before.
Anyone know why the excel rendering extension insists on inserting a column like in the attached image?
Things that I have tried.
Set the table's position to 0,0.
Removed all borders and padding.
Set the report margins to 0,0,0,0
NOTE : I am using the EXCELOPENXML rendering format as opposed to EXCEL in order to support *.xlxs.
Groupings:
First Column in the Designer:
The report was being rendered as a sub report and was placed in a rectangle and aligned right in the main report, however, the rectangle was one twip off from left align. Once I aligned the rectangle in the main report, the phantom column disappeared.

TextBox data is cut off when exporting to Excel 2010 from SSRS 2008 [duplicate]

I have a Table in an SSRS report. one of the Table Cells contains the Descriptions of Parts in an order. these descriptions could vary in length and for that reson i have set the "CanGrow" Property to True. when i try to export the report to Excel im expecting that if the text length would exceed the width of the Cell then the height of the cell would grow and the whole text would be shown. Unfortunately the SSRS Excel Generator keeps the height as is and so only the part of the text which fits the width of the cell would be shown.
i would appreciate any help or input to solve this problem.
Thanks
I've found that instead of removing any elements before the tablix, you can change their width to match that of the page.
I found the solution of the same problem! :)
Set the "CanGrow" Property to False for all cells from one row.
And also set the "Height" Property to your specific size.
This is how the Report Viewer's Excel renderer works. You cannot change the way it exports the excel file, however, there are other ways to resolve your issue.
Write your own Excel Renderer (not a good idea -- time consuming)
Fix the column widths before exporting
After exporting to Excel, edit the Excel file via COM calls
My suggestion is #2 -- You can load the RDLC file in memory, and do your modifications there, then call the ReportViewer export function for that altered report.
If you have elements before your tablix this can stop the growth. I've found that removing all elements before the tablix will restore the desired row-growth/auto-fit behaviour. I have not found a better solution yet.

SSRS won't expand the row height when exported to Excel

I have a report I am doing with SSRS 2008 with some rows that have multiple elements inside them. On the preview the row automatically expands to support the extra elements but however when I export the report to Excel it appears only as a single row with just the one element displayed, although all the elements are there when I double click the row or manually expand it.
I've checked everything...Can grow is set to true and the properties on the text box allows it's height to increase however it seems to ignore these.
Here it is in the preview
http://tinypic.com/r/b4wbdg/8
In Excel
http://tinypic.com/r/r084g3/8
Sorry about the links to the pictures and not in this question
Both CanGrow and CanShrink properties should be set to false. There is nothing like CanGrow and CanShrink in Excel. By setting them to false it will display the height as it is. Otherwise it will set the height to a default value.
This worked for me. Check this Row height not preserved when exporting to Excel thread for more suggestions.
Came across this (again) recently and thought I'd share my take...
Whether Excel correctly renders the height has to do with merged columns. Take note of your column alignments throughout all objects on the page. Any objects not tied to the data table itself (or embedded inside the data table) must be aligned with the columns of the table in question, at least for the cells that need to wrap text. If there is any overlap causing the table columns to be split and the cells of wrapped text to be re-merged, Excel will not recognize the row height by either setting the CanGrow to True or snapping the row to fit within Excel.
In the original post, the user mentioned rows with multiple elements inside of them. It is possible that those elements caused the column to split for the surrounding subtotals or adjacent groups with wrapped text.
Setting the CanGrow to False will simply prevent any automatic sizing of the row height by default for both the web view and Excel export, so I don't know if that's the ideal solution to this problem.
Both CanGrow and CanShrink properties should be set to false
This must be done for all cells in the row of the Tablix!!
Otherwise the data is not properly exported.
reduce the widths of the rows and it fixed my problem
I remove the header of the report, and all works perfectly.
I have other reports and I see now that if I remove the textboxes that are included on the sheet when exporting to excel, then the row heights in excel are sized properly.
I know this is an old question but I've been struggling with it. My issue was that I had a second field in a column where I inserted a placeholder underneath the field in the column. When exporting to Excel I wanted it to be tall enough that the second field would show underneath the main field in the column.
To get it to work for me, I inserted a blank column next to it and made it just wide enough for a single character. Then I click and hit enter several times to force it to be multiple lines. When I export, I have a blank column but otherwise it worked for me.

IBM Cognos Cross Tab alignment

I have placed two crosstabs one below another. But They are not getting aligned. How to align the two cross tabs such that corresponding columns align perfectly.
The quick and dirty way is to use fixed widths on all cells.
This will work fine for PDF, but will not work for HTML if:
You're using a modern browser (IE9+, FF/Chrome from last 5 years)
The total width exceeds screen size
There is no total width set on the crosstab itself
It will then ignore the cell widths and try to force everything to the screen width, thus the crosstabs will not align again.
I wrote some JavaScript awhile back which will combine two tables into one so fixed width is not needed. The full blog post is here. This will only affect HTML outputs, so for PDF I created a second page and just conditionally rendered one depending on user selection.
Fixed width is the only viable solution )
But you can use Report Classes to have a single “width” definition and apply it everywhere. It actually makes your reports look way neater.
Use Blocks in the cross tab cells, you will need to unlock the report first to do this
Set the block size to be the same on both cross tabs and then select content is clipped (Size and overflow property of the block)
This will work for both html and pdf output
I was able to do this by doing the following:
Set the Size & Overflow > Width of BOTH crosstabs to the same width in pixels.
Unlock the report, select the crosstab Text items in BOTH crosstabs and set them all to the same width (or individual columns to the same width if needed).
With the report still unlocked, select the text items in the crosstab 'Rows' and set those to the same width.
It's not pretty, but nothing in Cognos ever is.

Resources