by Martin Laukkanen | Jul 25, 2014 | Reporting, SQL
I saw this issue when working with an old colleague Hammad Arif earlier this year and he came up with a solution written up here that worked nicely at the time, however I’ve come across this again and this time it proved more of a challenge.
Problem
When exporting to PDF Reporting Services reports containing multi-line text from a SQL datasource the first line of text loses all spaces between words, see screenshot taken from a PDF file:
Nope that’s not one particularly long German conjugation, that is the problem I’m talking about! It only seems to affect the first line of each multi-line based custom field value in the SSRS dataset and additionally when looking at the data in SQL or in the HTML source there is nothing different visible! However oddly on the affected projects a single odd character (​) does exist before the html <span>.
Resolution
After much head scratching it took a call to Microsoft to identify that hidden away in the database tables are some characters, specifically HEX ‘0B 20’ which turns out to be the Zero Width Space or in HTML (​), the same character you can see in the HTML. Now this makes sense as despite these being invisible in the SQL tables using a SELECT statement, they still exist and cause these symptoms in the PDF but not when viewed on the Web or exported to Word or other formats.
Fortunately the resolution for the report is nice and simple;
SELECT REPLACE(Problemstellung, NCHAR(8203), '') AS Problemstellung
Simply wrap each multi-line text field affected with the SQL REPLACE command removing the character completely!
To answer the question of where they came from, that is one I leave to the Microsoft escalation engineers. :)
HTH,
by Martin Laukkanen | Jul 6, 2014 | Misc
It’s something I’ve wanted to do for sometime now, but finally found the time and resources to do it! Have a look around the new modern design (I guess that’s not actually modern-ui, meh?) and please let me know if you find something that doesn’t work! :)
Martin.
by Martin Laukkanen | Jun 12, 2014 | Development, How to
Recently I spoke at a Microsoft Project Server event here in Switzerland on the topic of Extending Project Server and using small pieces of JavaScript with jQuery to make little changes for big effects. One of my demos was to correct the following annoyance that many of us have probably come across but have no out of the box way to fix.
Project Detail Pages column alignment issues
Example
In yellow I have highlighted the issue that I’m talking about in case it is not obvious in the screenshot. As you see the alignment is actually based on the length of the longest custom field displayed in the web part, so as in the above example where we have used separate webparts to break up the webpage with headings the width of each column is unpredictable.
jQuery to the rescue
This is a great example of using jQuery as it shows how ridiculously simple some things can be to change! So let’s walk through the solution here if you’ve not done this before, as you will see the possible usage of this kind of “fix” is vast.
“Debugging” in Chrome or IE
The first thing you need to do to here is to identify the html element(s) in question, so the easiest way to do that is to use the “Inspect Element” feature available in both IE and Chrome browsers (and probably all others too), you’ll find it on the right click menu
When selected the inspect element will open up the developer console of your browser and focus on the specific element under the mouse, in this case the “Description” field text label.
Now you can browse the page source and as you see each element is highlighted, neat!
Now we can start using jQuery to select our columns to modify, start by dynamically loading the jQuery library using the following script:
var jq = document.createElement('script');
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
Now that we have jQuery available you can again look at the source and think about what we need to ‘select’, in this case we can see that our Description label is in a h3 inside of a table (tbody > tr > td) and specifically it has a class of “ms-formlabel”. Cool so in jQuery we can now select all such elements like this:
$("tr td.ms-formlabel")
Best thing is that being JavaScript all elements are selected and can be used in an array, but even better we can directly update all items like this:
$("tr td.ms-formlabel").width("300px");
Neat hey? If you run that command in the console immediately all the columns will update to be 300px wide!
Permanently applying fix to the page
So now we have our script let’s add it to a Content Editor Web Part (CEWP) on the page itself, to do that we need to wrap our line in some html which loads the jQuery library and runs the script when the page is ready, like this:
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">
$( document ).ready(function() {
$("tr td.ms-formlabel").width("300px");
})
</script>
Now edit the PDP web part page, and add a Content Editor web part to it, then simply add the above HTML content to the web part HTML source like so:
First add the Content Editor web part and use the Edit Source ribbon option
Then paste in our html script
Now each time the page is loaded the script is run and all columns are aligned to 300px looking something like this:
Enjoy!
by Martin Laukkanen | May 29, 2014 | Project Online
I like surprises! So today I was happy to find a brand new surprise shiny feature in ProjectOnline!
Behold the New Project Wizard:
And when you click Finish:
Neat, although seems to be currently un-configurable apart from the standard ‘New Project’ PDP changes that can be made, however I can see more ‘tabs’ being added up the top (where currently the numbers 1, 2 are) assumedly perhaps linked to other PDP’s?
More hints of what to expect in PS2015 I guess.
by Martin Laukkanen | May 21, 2014 | Project 2013, Project Online
Microsoft Switzerland has a day devoted to Project Server 2013 in Zurich on the 11th of June 2014, and with my new TPG hat on I’ll be speaking about a Extending Project Server in the afternoon!
Event ID 1032573385 – Projektmanagement mit Project Server 2013
Its a German event, but don’t worry I won’t be putting the room though an hour of my German (!) so that session will be delivered in English, so I hope you come along!