I have an rdlc report in my application. The report looks good when seen on the web page, but when I choose the option of exporting to Excel, I get some columns merged in more than one cells. I don't want columns to be merged. How can I prevent this. I already saw this post, but the link provided in this post is not working.
Any help with this issue will be appreciated.
As the post you shared suggested, this is usually down to cells/textboxes not aligning in your report design.
SSRS will attempt to replicate the layout that you see in the report preview (or webpage in your case). To do this it will add additional columns to provide the correct spacing and then will merge cells that cross those boundaries.
Make sure that all your textboxes align with no horizontal gap etc. For example, if your report contains a table/matrix and a textbox with a title. Make sure that the title textbox starts and finishes exactly in line with a cell in the table/matrix.
Note that cells will still be merged if they cross the boundaries of columns (e.g. the title in this example, might be merged across several columns depending on it's width).
Sticking with our title scenario, if you need to stop it from merging under any circumstances then you could try this (untested).
Create two textboxes, one wide enough to fit the title in and another that is the same width as other data that shoudl be in the same column in the final excel output. For example, if you have a table with 6 columns, the first textbox will be the same size as those 6 columns but the smaller version will be aligned with the first table column only.
Set the location of both these textboxes to the same location (so they overlap).
Then in the hidden property set one to be hidden when Globals!RenderFormat = "EXCELOPENXML" and the other when this expression is not true. This way the short textbox will only get rendered when exporting to excel, and the logn one will only get rendered to screen.
Depending on version SSRS etc you will have to decide which render format(s) to check for.
See here for documentation on RenderFormat
https://learn.microsoft.com/en-us/sql/reporting-services/report-design/built-in-collections-built-in-globals-and-users-references-report-builder?view=sql-server-ver15
Related
I am using SSRS to report numbers and percentages and display them in a matrix using a column grouping (so new "rows" of data populate new columns rather than rows).
In order to make a "nice" header for each row that spans several rows I have created two tablixes, one for the headers and one containing the data. These two tablixes have both been dropped into a list in order to keep them aligned (being contained in a list is also essential if I want to use them within a multi-page report). The heights of each cell have been defined carefully to ensure that the two tables align and appear as one table.
When I view the report in SSRS everything appears more or less as I would expect. However, when I view the same report via IE the rows become misaligned.
Is there an easy explanation as to why this happens?
My best guess is that the heights I've specified in mm and cm are being converted into another unit and the inconsistency is being introduced via a rounding error.
i.e. the headers are 15mm height, numbers are 7mm height and percentages are 8mm high. Normally 8+7=15 but perhaps conversion(8)+conversion(7)=/=conversion(15)
If this is the case then it would be useful to know the native or "correct" units to use in SSRS if I want to avoid this kind of conversion error.
Having a report with 5 different tables and what i want is to have each of these tables starting at the top of a new page. These tables are currently in a rectangle each which has a hide/show expression. Surrounding these rectangles is a list which is doing the correct grouping for the tables and also doing page breaks after each group(3 groups in total: Association, Organization, and Type. There are 5 different types, one for each table(there's a filter on the tables).
When showing my report in regular preview mode there is no problem but when doing so in print layout preview I get the third table starting on the third page but not at the top and after that I dont know what is happening... all page breaks just stops working. Sometimes whole empty pages are rendered.
This is how the report layout looks like
This is some of the resulting pages (not in order)
Just so you know, I have been trying consumewhiteSpace, Checking the height and width on my report Height = 15,1cm and width 24cm and its just a horisontal A4 page.
The grey color is the list-rectangle. Why is it acting up like that and how do I make it work?
So it looks like the report is fixed. Don't really know what I did but I redid the report(like a houndred times before), really made sure that all the page breaks, filters, report margins and visibility conditions (not only in the tables visibility propery but also on every static row under advanced mode) were right. I made some table changes for example using stepped table instead of nested. And found some wrongs I had made previous considering the tables layout (guess everything has a purpos even hard work and long wait...).
Thanks for the help though!
I am having report in SSRS with two cell merged into one cell. While exporting this report to excel,
it shows me two different cells instead of merged one. The first cell is having value while other is blank. Kindly suggest solution to this issue.
Other report elements above or below your merged cell can cause what you are seeing. Make sure that any other tables or text areas on the page have have line up with the start/stop points of your columns on the table with the merged cells.
For example, if you have another table or text title that doesn't line up with one of your columns, Excel forces in an extra blank column. If you temporarily remove anything other than your table with the problem, you may see that it suddenly works.
Another trick is to use points as the unit of measure when specifying widths and heights. When you export to Excel, any measurements in inches are converted to points. Sometimes it ends up with partial points resulting in unexpected behavior. For details about the points measurements see - Microsoft's explanation here.
I have a table and a graph next to each other in a line.
I can choose one or more of 5 columns which can be displayed by using multiple values in parameters. But when I'll choose 4 of 5 I have white area between chart (graph) and tablix (table), what I don't want. I want to expand these columns to initial tablix size. And the same in case less number of columns. Is it possible expand them depending on chosen parameters?
(Edit:) Or how to change width of column depending on expression? If I can do this, my problem will be solved.
Or another idea is to expand chart on whole width - it could be between tablix and the end of page.
Any ideas how to do this?
This is unfortunately not possible in SSRS without the use of a hack. To quote the "accepted" answer from this MSDN thread:
This is a common request and I definitely see the value in it. However, we didn't get to this for SSRS 2008. Please feel free to file a feature request (or add votes to an existing request) on the connect.microsoft.com.
As far as I know this hasn't changed in SSRS 2012, though someone may correct me on this.
The thread mentioned above holds several workardounds, ranging from ugly to UGLY. One other lead (possibly even a duplicate question?) is this SO question where it's suggested to not hide the column but make the text have the same color as the background o.O
I am learning InfoPath 2010 and have a form that I am creating, but have two issues that I don't know what to do about. In the form I have created there are several columns (repeating tables). I pulled the data in from a database and have already set the conditions for what I want to be returned in the SQL, under the Data tab. So I have the correct data returning, however the issue is that the data is not in a consistent even row across the form (lines on a piece of paper) the lines begin to become offset by the second row and continue to the last. I have tried creating a table to put the data into and was hoping that this issue would go away, but that is not the case. How do I fix this cosmetic issue? OR where do I find the HTML code? When I select "Code Editor" under the Data tab, I am given VB code and there is not much code to work with.
Thank you for your help in advance.
CompGeekess
As I was continuing to find the resolution to my delima, I noticed that when a you have a column selected, Properties and Layout tabs appear at the top. In the Properties tab you can set the width and height of the column using in, and px. I noticed that not all of the columns had the same height in px, so I made each the same height, saved and previewed the form and now the rows are no longer offset. Interesting how something SO simple can make a huge different. The difference was only 2px off.
InfoPath actually creates an XML document, not HTML (if you right-click on a field in your Data Source you'll see a "Copy XPath" option). The best way to control your layout is using a Layout Table (Tools -> Design Tasks -> Layout)
I would recommend avoiding setting pixel values as well, and leaving control heights to "auto" whenever possible. If you're using a layout table and having alignment issues, right click in the table and go to Properties. You'll have Horizontal and Vertical cell alignment options (for the cell contents) in the Table and Cell tabs. You can also select multiple cells (just select the contents of them) and then assign that alignment to all in the same way.