Hidden column after export to excel when table has less than 4 columns (SSRS) - excel

I faced following problem with exporting ssrs report to excel.
When I create a table having 4 columns and then exporting it to excel I get the proper layout:
But when I remove at least one of the column in ssrs designer (when table consists of less than 4 columns), after exporting it to excel, one column is being hidden:
When I manually changed the width (by typing width in properties window) to at least 3 cm, after exporting it to excel the additional column disapeared (even if the table has less than 4 columns).
Does anyone know why this happens?
Any help will be appreciated.

Easy solution: Work in POINTS, not Inches or Centimeters.
Excel renders in points, so this prevents all roundoff in positioning. It is that easy.

It's an issue with the header.
To avoid this all together insert a row in your tablix (above everything else) and set the "RepeatOnNewPage" tablix property to 'True' (Advanced Mode >> select the static row groups you need to repeat >> RepeatOnNewPage).
This approach does the same thing as a header and you won't have to deal with those pesky extra columns any longer!

Try rectangle in to rectangle.
If this do not work - insert a list and insert your object in to list.
This should help - don't know why is that - but sometimes it take a lot of attempts and scenarios to work this out for one report... just keep trying with rectangles and lists - this is what I always do.

This is common problem in SSRS - the way how I removing this problem is to use rectangle's .
Insert rectangle then CUT your table/matrix PASTE inside rectangle - make sure there is not empty spaces.
If you using more than one table/matrix , then insert rectangle inside rectangle etc. ( my record is 14-th depth ) - this is VERY annoying but I know only this way.
- ALSO - fit everything to left side corner

It works fine for me ... what ver of excel do you use ?
Can you post here rdl file or code from file ?
Are you using report builder or Visual Studio ?
- Do you have any more objects on the report or just that table ?
D.

I find that if you have headings in your reports above the actual tablix, you will have to extend the width of the heading to match the width of the tablix (you should see the blue lines showing the alignments) and ensure that the headings also align with where the tablix begins. Basically, just make sure that everything is aligned. Hope this helps.

After struggling with this for a few days this blog post helped me out:
How to eliminate merged and hidden Cells issue from Excel Export of SSRS report - MSDN
The problem seems to be that pixels and centimetres (or inches) don't line up nicely. When you drag the columns around they get non-exact approximations of the value. When you put a nice round number (even like 3.25cm) they seem to play nicer. You'd probably want to use pixels or points (what Excel uses to store cell size) to prevent the last column compressing.
I hope this helped a bit...

Late to the game, as usual. But I played around with this for a while, and it looks to me like it's just going to end up being fairly random. Sometimes I can get them to go away, sometimes I can't. I don't always have the ability to change things to nice round numbers that represent an even number of points. And even when I do, it still doesn't always work. But I did notice this. If you zoom in closely, you can see that the lines are just slightly misaligned. Believe me when I tell you that mathematically that shouldn't be happening. But I wondered if that might help explain the problem.

Related

Custom format with custom Multiples Excel

I recently wanted to create an excel table to note all my electric components that I have so I can easily find the right component without searching every time for it.
The problem is, especially with capacitors, they come with a wide range of values generally for me between 220uF and 10pF, and I want to create a custom format to display the values properly in excel, for example if I put in a cell 0.00022 it shows 220uF or maybe 0.22mF (but 220uF is better) and not 2.2E-04 or any other format.
I tried the custom tool but I don't know how to add the micros, nanos and picos.
You can add conditions to the formatting, like:
[<0.00001] 0.00%%% "pF";[<0.001] 0.00% "uF";#
This will show 2.20%% uF in the cell (so you can multiply by using the percent sign, more details here).
Drawback: the percent signs are shown, and the Ctrl+J trick described on the link does not really work for me (and I personally find it as an ugly solution).
If I were you I'd add a new column called "Formatted" where I multiply the values with formulas. Like
=IF(A1<0.00001,A1*1000000 & "pF",IF(A1<0.001,A1*10000 & "uF"))
It's easier then to search in both columns (one is by formatted, like all "uF", other is by real Farad value. Also you could use the original column for sorting.

Fetching data from one sheet, to produce organised summary and display it in sections

I am trying generate a summary page for a list of lessons from a different sheet.
I'm currently using the formula =UNIQUE(FILTER('Lessons NEW'!$E2:$E1009,(RIGHT(LEFT('Lessons NEW'!$E2:$E1009,5),1)="1")+(LEN('Lessons NEW'!$E2:$E1009)=3))) to do so.
This is displaying my list like so, with the code column being the only really important one, as the rest could be fetched from it's result.
This works, but there are two features that I want working that I've not been able to find a way to do;
Split the output into groups. I am after a title to each group/section, and a gap between them too. As in screenshot here.
Arrange it to display in multiple columns (As in have half the results in column B, and half in column G for example.) In the process of this, I'd prefer the resulting sections (as in point 1, aren't broken, and kept together instead of being split between columns.
I'm not sure if what I'm asking is too much, or very much doable, but keen for suggestions or ideas if there is a way.
Thanks in advance!
EDIT:
I've updated the formula (above) and added a title to the source column that it's fetching from. It's now producing this.
What I want it to do, is to break it further for aesthetics and for easy separation when others are looking at it, and to bolden the title row for each section. (I think I can work out the conditional formatting for the title row...)
This is what I want it to end up looking like.
Google drive link to demo sheet: https://docs.google.com/spreadsheets/d/1yx9LWeV7RHfmlldUpdUZjaU8eVdOsUVaeFrfoBypeDs/edit?usp=sharing

Update Excel ListObject header names without breaking pivots

I have an Excel sheet with a very wide table on it. Due to developer friendlyness I'd like to use a certain style of column header naming (much like proper Hungarian notation), where I suffix each header name with "column type" tags. This allows me to easily spot where e.g. apples and oranges are compared. There are also pivot table reports based on this table.
An example to illustrate this: say you have 2 monetary columns, column A being expressed in another currency than column B. The model should thus never combine them without first applying appropriate exchange rates. To spot this I name these columns e.g. Earned - Cur1 and Saved - Cur2. Any calculation like =[#[Earned - Cur1]] + [#[Saved - Cur2]] is illegal, but due to the tags this can be picked up easily in an audit. I have several such tag groups in use already, and they already prevented some errors creeping in.
However...
The file also needs to be distributed to lots of not-so-savvy end users, and they need to fill in this table and refer to some of the outcome columns. Most intermediate columns we already hide, but the column names are now far from being user-friendly (like: fill out Actual - NK/Q1/EC/%, please?).
And this needs to run in Excel 2010.
What are my options?
Option 1
Add an extra row above the table, putting human readable names in there, and just hide the table header row. This works, but not the users can't sort and filter the table anymore, so that's a no-go.
Option 2
Augment option 1 by prepending a newline to each column name, and make the table header row 1 character high. The header cells would still be there to drive sorting and filtering and the users have human readable names in the row above. The actual header cells would appear like 'empty' buttons. Could work, but then the complex formulas become unreadable due to all the newlines from the column names all over the place.
Option 3
Add a macro that switches the headers in the table by alternative headers in another row above the table. The macro should be ran just before sending out the file to the users, and ran again when they return them filled in and all. I happily coded this option into the file, and it works wonderfully! But then I realized this (and thus option 2 as well) breaks all the derived pivot tables, since Excel links the data by the names used in the table - update the name, and that section of the pivot will be dropped...
I'd really like the option of having our development-oriented column names in there when we ourselves work with the file, but being able to switch out the headers when needed. And of course without rebuilding all the pivots after each such switch.
An opening here would be that pivots seem to only drop the columns once they're refreshed. I could use this to update the header names, then do some magic on the pivots to remap their fields, and only then refresh them, but it seems there's no way from within VBA to accomplish that (PivotField.SourceName is read only).
Hopefully someone can think of an alternative, or am I SOL? I'm totally open to other workarounds.
Workaround 1
Insert null-terminating characters in the header names such that they do not show normally in the formulas, but do not show in the table header row. If only it were that simple though... Turns out Excel throws up from a =Char(0)&"abc", and things like =Char(8)&"abc" (tab anyone?) give Unicode replacement characters when pasted into a header cell... (?)
Workaround 2
A last resort seems to be to unzip the excel file, and plough through the xml data to update everything in one go there, then rezip the file. But this code also needs to be executed by less skilled users, and I see too many ifs and buts to make me feel safe using this setup.
Workaround 3
For now I just use a variation on option 2; I have some VBA that 'empties' the header cells instead of prepending a newline to them. By 'emptying' I mean setting the font size to 1, subscript, non-bold, and then make the font color identical to the background color, followed by setting it's row height to the default 14.5. The cryptic names do leak out however; column header cell drop down arrows for sorting&filtering show the cryptic name, as well as the pivot field settings and of course the formula bar when you just click such a cell. But I guess it's the best I can do?
And then again I'm probably just perfectionizing this thing faaar to much :) But from this point on it's about the challenge!
Make sure you Tick the Box "Add this data to the DataModel" when creating your pivot(s)
AFAIK when your Pivots are connected to the Datamodel instead of directly to the Range/Table you can change your column-names in the Table and your Pivot will stay fine. You could even use other names in your Pivot.

Chart always complains about invalid references - Excel 2007

I made a XY plot that shows points from one data set in two different colors, depending on a set of conditions. I achieved this by making the source table three columns instead of two. First column is the X. Second column is Y is one set of conditions apply, third column is Y is the other set of conditions apply. So the second and third columns have formulas like this in them, respectively:
=IF(ConditionApplies,YValue,"")
=IF(ConditionApplies,"",YValue)
(So the graph actually has two series, each of which is not a contiguous block of numbers - each is interspersed with "nothing")
When I make a change that affects the ConditionApplies, the table reacts properly. Then I switch to the chart (on a different sheet) and it always says: "A formula in this worksheet contains one or more invalid references...". Click OK.
The chart itself always looks the way I would expect, with two different sets of points according to the Conditions I devised. If I inspect the data source fields, all the references are intact and proper.
Basically everything works, I would just like to avoid this annoying pop-up.
Had the same problem. Deleted a data column and the chart that referenced it kept complaining.
Solution was to move the chart to its own page. then copy the chart and put it back into worksheet.
Hope it helps.
I 100% understand everything you've said here and, on the surface, it sounds like it's not any kind of bug. It seems like you are actually referencing something you shouldn't. If that's, in fact, the case that's obviously something you want to fix.
My first guess would be to look at your "ConditionApplies" formulas. Under certain cases, would they create invalid references (referencing data of the wrong type, dividing by zero, circular references, etc.). The most common cause of problems like that would be dragging formulas but not having the "$" signs in the appropriate places. So your cell references change when you expected they'd stay the same.
For example:
=SUM(A1:G25)
should be something like the following to prevent the column and row from incrementing when dragged:
=SUM($A$1:$G$25)
Recommendation
Look at the "ConditionApplies" formulas (or better yet, post them here) and aggressively place $ where ever they don't break things. Then "re-drag" your new formulas, updating the previous ones.
There is a microsoft KB 931389! about this problem with status "Confirmed, not fixed".
In my situation with chart and two series collection problem solved by adding a code to delete all seriesCollection before adding new data:
While Sheets(3).ChartObjects(1).Chart.SeriesCollection.Count > 0
Sheets(3).ChartObjects(1).Chart.SeriesCollection(Sheets(3).ChartObjects(1).Chart.SeriesCollection.Coun t).Delete
Wend

Hiding data points in Excel line charts

It is obviously possible to hide individual data points in an Excel line chart.
Select a data point.
Right click -> Format Data Point...
Select Patterns
Tab Set Line to None
How do you accomplish the same thing in VBA? Intuition tells me there should be a property on the Point object Chart.SeriesCollection(<index>).Points(<index> which deals with this...
Actually if you are going to use SpyJournal's answer it has to be =IF(b2=0,NA(),b2), otherwise Excel just recognizes it as text, not as an 'official' #N/A
"Describe it to the teddy bear" works almost every time...
You have to go to the Border child object of the Point object and set its LineStyle to xlNone.
As a general tip: If you know how to do something in excel, but don't know how to do it in VBA you could just record a macro and look at the recorded VBA-code (works at least most of the time)
There is a Non VBA solution as well that can also be controlled from the VBA code as well.
In excel a data point represented by a #N/A will not display. Thus you can use a formula - the easiest is an IF function - that returns an #N/A as text in the graph data. This data point will then not display which means you don't need to try and manipulate the format for it.
An example is simply to generate your graph data in a table, and then replicate it below with a formula that simply does this
=If(B2=0,"#N/A",B2)
This works when you want to stop line charts from displaying 0 values for example.
This is probably too late to be of assistance but the answer by SpyJournal, whilst easy and elegant,is slightly incorrect as it is necessary to omit the quotes around #N/A
Yes. It doesn't have to have the quotes to be a true not available cell content
but for me N/A still plot as 0 in my charts.
The only way I can get it not to plot is to have the cell blank.
I tried "#N/A" with quotes in Excel 207 and as a result the data point is shown like a zero in the graph. It Works without the quotes.

Resources