<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>blogs.flores.nl</title>
	<atom:link href="http://blogs.flores.nl/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.flores.nl</link>
	<description>Omdat we zoveel te vertellen (gaan) hebben.</description>
	<lastBuildDate>Tue, 21 May 2013 14:52:03 +0000</lastBuildDate>
	<language>nl</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blogs.flores.nl' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/9837bec33a23db79e6b5c22ac19cd557?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>blogs.flores.nl</title>
		<link>http://blogs.flores.nl</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blogs.flores.nl/osd.xml" title="blogs.flores.nl" />
	<atom:link rel='hub' href='http://blogs.flores.nl/?pushpress=hub'/>
		<item>
		<title>Drie manieren om foutcontrole in Excel uit te schakelen</title>
		<link>http://blogs.flores.nl/2013/04/23/drie-manieren-om-foutcontrole-in-excel-uit-te-schakelen/</link>
		<comments>http://blogs.flores.nl/2013/04/23/drie-manieren-om-foutcontrole-in-excel-uit-te-schakelen/#comments</comments>
		<pubDate>Tue, 23 Apr 2013 13:50:57 +0000</pubDate>
		<dc:creator>Martin Drenth</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[VBA]]></category>

		<guid isPermaLink="false">http://floresblogs.wordpress.com/?p=1031</guid>
		<description><![CDATA[Elke Excel-gebruiker kent ze wel, groene hoekjes rechtsboven in de cel om aan te geven dat er iets niet klopt &#8230;<p><a href="http://blogs.flores.nl/2013/04/23/drie-manieren-om-foutcontrole-in-excel-uit-te-schakelen/">Lees verder &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.flores.nl&#038;blog=32027457&#038;post=1031&#038;subd=floresblogs&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Elke Excel-gebruiker kent ze wel, groene hoekjes rechtsboven in de cel om aan te geven dat er iets niet klopt aan een formule. Net als bij de spellingcontrole van Word zit deze foutcontrole er ook wel eens naast. In dit artikel drie manieren om de foutcontrole uit te schakelen: handmatig voor een of meer cellen, voor altijd of via VBA.<span id="more-1031"></span></p>
<h3>Fout negeren</h3>
<p>Door te klikken op het uitroeptekentje dat verschijnt als een cel met een groen hoekje wordt geselecteerd, verschijnt een keuzemenu. Kies Fout negeren om het groene hoekje van deze cel weg te halen.<br />
<a href="http://floresblogs.files.wordpress.com/2013/04/foutcontrole-negeren.png"><img class="aligncenter size-full wp-image-1034" alt="Foutcontrole - Fout negeren" src="http://floresblogs.files.wordpress.com/2013/04/foutcontrole-negeren.png?w=480&#038;h=235" width="480" height="235" /></a><br />
Wanneer de formule wordt veranderd, zal Excel wel opnieuw een mogelijke fout markeren. Deze methode werkt ook voor een aantal cellen tegelijk. Selecteer eerst de cellen en klik op het uitroeptekentje en kies Fout negeren.</p>
<h3>Helemaal uitzetten</h3>
<p>Via Bestand &#8211; Opties &#8211; Formules &#8211; Foutcontrole kan de optie &#8216;Foutcontrole op de achtergrond inschakelen&#8217; worden uitgeschakeld. Dit is een redelijk permanente oplossing. Er wordt geen enkele fout meer gemarkeerd.</p>
<h3>In één keer uitzetten in VBA</h3>
<p>Met onderstaande VBA-code kan op het specifieke niveau van het soort fout de foutcontrole worden uitgezet. Dit heeft hetzelfde effect als de eerste beschreven manier; na het aanpassen van een formule markeert Excel eventuele fouten. Alleen wanneer in een lege cel in de range een nieuwe &#8216;foute&#8217; formule wordt ingevoerd zal deze de eerste keer worden genegeerd.</p>
<pre class="brush: vb; title: ; wrap-lines: false; notranslate">
Option Explicit

Sub RemoveErrorChecks(rng As Range)

    Dim i As Integer
    Dim arrXlErrorChecks As Variant
    Dim cl As Range
    
       arrXlErrorChecks = Array(xlEvaluateToError, xlTextDate, xlNumberAsText, xlInconsistentFormula, _
          xlOmittedCells, xlUnlockedFormulaCells, xlEmptyCellReferences, xlListDataValidation, _
          xlInconsistentListFormula)
        
    For i = 0 To UBound(arrXlErrorChecks) - 1
        For Each cl In rng.Cells
            cl.Errors(arrXlErrorChecks(i)).Ignore = True
        Next cl
    Next i
   
End Sub

Sub test()
    RemoveErrorChecks Range(&quot;A1:E10&quot;)
End Sub
</pre>
<p>Naar wens kunnen de verschillende soorten fouten al dan niet worden genegeerd. Hieronder een beschrijving van de foutsoorten.</p>
<table>
<tbody>
<tr>
<td>xlTextDate</td>
<td>The cell contains a text date with 2-digit years.</td>
</tr>
<td>xlNumberAsText</td>
<td>The cell contains a number stored as text.</td>
</tr>
<td>xlInconsistentFormula</td>
<td>The cell contains an inconsistent formula for a<br />
region.</td>
</tr>
<td>xlOmittedCells</td>
<td>The cell contains a formula omitting a cell for a region.</td>
</tr>
<td>xlUnlockedFormulaCells</td>
<td>The cell, which is unlocked, contains a formula.</td>
</tr>
<td>xlEmptyCellReferences</td>
<td>The cell contains a formula referring to empty cells.</td>
</tr>
<td>xlListDataValidation</td>
<td>The cell contains a value inconsistent with list data validation.</td>
</tr>
<td>xlInconsistentListFormula</td>
<td>The cell contains an inconsistent formula for a list.</td>
</tr>
<tr>
<td>xlEvaluateToError</td>
<td>The cell evaluates to an error value.</td>
</tr>
</tbody>
</table>
<h3>Kanttekening</h3>
<p>Het is niet aan te raden om een heel werkboek zonder meer alle fouten uit te zetten, want in veel gevallen kunnen ze duiden op inconsistenties. Maar wanneer deze foutcontroles bijvoorbeeld effect hebben op performance dan kan het helpen.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/floresblogs.wordpress.com/1031/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/floresblogs.wordpress.com/1031/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.flores.nl&#038;blog=32027457&#038;post=1031&#038;subd=floresblogs&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogs.flores.nl/2013/04/23/drie-manieren-om-foutcontrole-in-excel-uit-te-schakelen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/545c2c5ba99083299c7a136662c61128?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">martinitramflores</media:title>
		</media:content>

		<media:content url="http://floresblogs.files.wordpress.com/2013/04/foutcontrole-negeren.png" medium="image">
			<media:title type="html">Foutcontrole - Fout negeren</media:title>
		</media:content>
	</item>
		<item>
		<title>Publiceren met het Blog-template van Word</title>
		<link>http://blogs.flores.nl/2013/03/13/publiceren-met-het-blog-template-van-word/</link>
		<comments>http://blogs.flores.nl/2013/03/13/publiceren-met-het-blog-template-van-word/#comments</comments>
		<pubDate>Wed, 13 Mar 2013 08:16:33 +0000</pubDate>
		<dc:creator>Martin Drenth</dc:creator>
				<category><![CDATA[Office]]></category>
		<category><![CDATA[Word]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[weblog]]></category>

		<guid isPermaLink="false">https://floresblogs.wordpress.com/?p=919</guid>
		<description><![CDATA[In mijn onstilbare honger naar nieuwigheden in Office, loop ik regelmatig door de sjablonen heen die Word je biedt. Onder &#8230;<p><a href="http://blogs.flores.nl/2013/03/13/publiceren-met-het-blog-template-van-word/">Lees verder &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.flores.nl&#038;blog=32027457&#038;post=919&#038;subd=floresblogs&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><img alt="" src="http://floresblogs.files.wordpress.com/2013/03/031313_1148_publicerenm1.png?w=480" align="right" /></p>
<p>In mijn onstilbare honger naar nieuwigheden in Office, loop ik regelmatig door de sjablonen heen die Word je biedt. Onder File, New… krijg je een hoeveelheid sjablonen voor je kiezen waar de honden geen brood van lusten; het gaat dan om duizenden&#8230; Ik vraag me dan altijd af waarom er zoveel sjablonen überhaupt gemaakt worden en door wie? En al die sjablonen hebben een eigen stijl, dus hoe kan dat ooit overeenstemmen met de huisstijl van de organisatie waar je werkt? Of zijn ze gemaakt voor ZZP-ers die (nog) geen vaste stijl hebben? Of zijn ze dan alleen gemaakt voor particulieren, die vooral de &#8216;Birthday gift certificate&#8217; en de &#8216;Photo calendar&#8217; gebruiken? Maar goed, mijn oog viel op de &#8216;Blog post&#8217; en mijn interesse was gewekt. <span id="more-919"></span>Voor sommige mensen is bloggen uitgegroeid tot een manier waarop ze hun ervaringen delen met de wereld. Een blog (afkorting voor weblog) geeft individuen de mogelijkheid van het publiceren zonder een beroep te hoeven te doen op de traditionele media-uitlaatkanalen of gedrukte publicaties. Iedereen die iets te zeggen <img alt="" src="http://floresblogs.files.wordpress.com/2013/03/031313_1148_publicerenm2.png?w=480" align="right" />heeft, heeft de mogelijkheid om het te zeggen op het web. Het enige wat ze nodig hebben is de nodige serverruimte en de juiste software om de blog-inhoud online te plaatsen. Het schrijven van een blogpost kan heel tijdrovend zijn. Vooral het &#8216;opmaak&#8217; gedeelte van een blogpost. Toen ik met bloggen begon, gebruikte ik, bij gebrek aan kennis over andere vormen, de online editor van WordPress. Maar er zijn andere mogelijkheden, zoals het gebruik van Word. In mijn geval versie 2013. Sinds Microsoft Office 2007 biedt Word een eenvoudige manier om te bloggen. Word kan eenvoudig verbinding maken met WordPress (of een andere provider, zoals Blogger, SharePoint blog &#8230;) en biedt verder alles wat er nodig is om een blogbericht op te maken. De eerste keer na het openen van het &#8220;Blog post&#8221;-sjabloon, wordt gevraagd informatie over URL van het blog, evenals gebruikersnaam en wachtwoord. Uiteraard lukte mij dat niet in één keer, maar uiteindelijk lukte het. Onze URL voor blogs is flores.blogs.nl, dus ik probeerde eerst in &#8216;Blog Post <span style="text-decoration:underline;">U</span>RL&#8217; de waarde <a href="http://flores.blogs.nl/xmlrpc.php" rel="nofollow">http://flores.blogs.nl/xmlrpc.php</a>. Niet goed dus. Zonder opgaaf van reden zegt Word: <img alt="" src="http://floresblogs.files.wordpress.com/2013/03/031313_1148_publicerenm3.png?w=480" /></p>
<p><span style="color:#44546a;font-size:9pt;"><em>Een heldere boodschap<br />
</em></span></p>
<p>De More Information brengt hopelijk soelaas: <a href="http://office.microsoft.com/en-gb/word-help/help-with-blogging-in-word-HA010164021.aspx?ver=15&amp;app=winword.exe">Help with blogging in Word</a>. Onder de sectie &#8216;Help me fill out this section: WordPress, staat bijna wat ik nodig heb. Alleen de tekst &#8216;<em>Your blog post URL is the URL of your WordPress xmlrpc.php file, which is usually located in the root folder of your site. For example, if your site is <a href="http://www.contoso.com" rel="nofollow">http://www.contoso.com</a>, you type <a href="http://www.contoso.com/xmlrpc.php" rel="nofollow">http://www.contoso.com/xmlrpc.php</a>.</em>&#8216; gaat er volgens mij vanuit dat je WordPress zelf host, wat volgens mij zelden gebeurt… Maar goed, dan maar eens proberen de URL van de beheer-pagina van WordPress in te voeren: <a href="http://floresblogs.wordpress.com/" rel="nofollow">http://floresblogs.wordpress.com/</a>, met daarachter het magische xmlrpc.php bestandje. En ja hoor, het werkt (met de juiste User Name en wachtwoord). Top. Even uitproberen. Titel is Test, als tekst invullen &#8216;=Rand(10)&#8217; – leuk trucje om snel even wat tekst in je document te krijgen. En dan &#8216;Publish&#8217;. Nee hoor, dat was iets te makkelijk. De compleet &#8216;heldere&#8217; boodschap was: <img alt="" src="http://floresblogs.files.wordpress.com/2013/03/031313_1148_publicerenm4.png?w=480" /></p>
<p><span style="color:#44546a;font-size:9pt;"><em>Weer een heldere boodschap<br />
</em></span></p>
<p>Twee problemen: ten eerste mag ik niet direct posten, zonder dat de blog goedgekeurd is door onze strenge redacteuren <span style="font-family:Wingdings;"></span>.</p>
<p><em style="color:#44546a;"><img class="alignright" style="margin-top:.5em;" alt="" src="http://floresblogs.files.wordpress.com/2013/03/031313_1148_publicerenm5.png?w=400&#038;h=220" width="400" height="220" align="right" /></em></p>
<p>Ok, dan Publish Draft. Dat gaat bijna goed, behalve de plaatjes. Toch wel belangrijk. Ervan uitgaande, dat WordPress dit allemaal aankan, kies ik &#8216;My blog provider&#8217;. Het zal wel met mijn beperkte rechten te maken hebben, maar geen succes. Dan bij &#8216;My own server&#8217; proberen.</p>
<p><span style="color:#44546a;font-size:9pt;"><em><img style="margin-top:.5em;" alt="" src="http://floresblogs.files.wordpress.com/2013/03/031313_1148_publicerenm6.png?w=480" align="left" /></em></span></p>
<p>Na geruime tijd het internet te hebben afgestruind, op zoek naar de juiste instelling bij &#8216;Picture Options&#8217; kom ik er niet uit. Ik heb nog even geprobeerd met een tijdelijk Flickr account verder gaan, maar ik kwam er niet uit. Bij Picture Options kan je kiezen uit &#8216;My blog provider&#8217;. <strong>Wat blijkt nu:</strong> ik ben slechts &#8216;schrijver&#8217; (&#8216;contributor&#8217;), wat een nogal zielige rol is: je mag dan geen plaatjes (media) invoegen. Na het wijzigen van mijn rol in Auteur (&#8216;Author&#8217;) gaat het! Ik kan mijn blog in één keer publiceren. Geweldig.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/floresblogs.wordpress.com/919/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/floresblogs.wordpress.com/919/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.flores.nl&#038;blog=32027457&#038;post=919&#038;subd=floresblogs&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogs.flores.nl/2013/03/13/publiceren-met-het-blog-template-van-word/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/545c2c5ba99083299c7a136662c61128?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">martinitramflores</media:title>
		</media:content>

		<media:content url="http://floresblogs.files.wordpress.com/2013/03/031313_1148_publicerenm1.png" medium="image" />

		<media:content url="http://floresblogs.files.wordpress.com/2013/03/031313_1148_publicerenm2.png" medium="image" />

		<media:content url="http://floresblogs.files.wordpress.com/2013/03/031313_1148_publicerenm3.png" medium="image" />

		<media:content url="http://floresblogs.files.wordpress.com/2013/03/031313_1148_publicerenm4.png" medium="image" />

		<media:content url="http://floresblogs.files.wordpress.com/2013/03/031313_1148_publicerenm5.png" medium="image" />

		<media:content url="http://floresblogs.files.wordpress.com/2013/03/031313_1148_publicerenm6.png" medium="image" />
	</item>
		<item>
		<title>Risicomanagement van eindgebruikersapplicaties</title>
		<link>http://blogs.flores.nl/2012/11/20/risicomanagement-van-eindgebruikersapplicaties/</link>
		<comments>http://blogs.flores.nl/2012/11/20/risicomanagement-van-eindgebruikersapplicaties/#comments</comments>
		<pubDate>Tue, 20 Nov 2012 16:47:22 +0000</pubDate>
		<dc:creator>Martin Drenth</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[EUC]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[risicoanalyse]]></category>
		<category><![CDATA[risk]]></category>
		<category><![CDATA[spreadsheet]]></category>

		<guid isPermaLink="false">http://blogs.flores.nl/?p=881</guid>
		<description><![CDATA[Wij krijgen in ons vak zeer regelmatig te maken met organisaties, waarin werknemers in Office eigen applicaties hebben gemaakt. Dit &#8230;<p><a href="http://blogs.flores.nl/2012/11/20/risicomanagement-van-eindgebruikersapplicaties/">Lees verder &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.flores.nl&#038;blog=32027457&#038;post=881&#038;subd=floresblogs&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Wij krijgen in ons vak zeer regelmatig te maken met organisaties, waarin werknemers in Office eigen applicaties hebben gemaakt. Dit kan variëren van eenvoudige Word- of Powerpoint-sjablonen, tot zeer complexe Excel-werkboeken of Access-databases. Deze applicaties zijn vaak ontstaan vanuit een acute behoefte waarna iemand van de afdeling Sales, die toevallig veel van Excel weet, iets heeft gemaakt. Dit werd in de loop der jaren uitgewerkt en heeft een cruciale rol gekregen in het gehele sales-traject. Jammer dat de oorspronkelijke maker niet meer werkzaam is bij de organisatie&#8230;<span id="more-881"></span></p>
<p>Deze applicaties worden vaak EUC-applicaties of EUC&#8217;s genoemd: End User Computing-applicaties. En ze zijn overal. Dat is niet erg, wanneer maar wordt beseft wat de risico&#8217;s zijn en hoe deze risico&#8217;s kunnen worden beteugeld. Bij Flores Automatisering hebben we de afgelopen jaren veel ervaring opgedaan in het benoemen van de (technische) risico&#8217;s van EUC&#8217;s bij een aantal grote energiebedrijven. We hebben ze geholpen om de risico&#8217;s van EUC&#8217;s helder(der) te maken. Dat is een goed begin bij het verminderen van de risico&#8217;s.</p>
<h2>Ontstaan van het risico</h2>
<p>Veel afdelingen van organisaties baseren zakelijke en financiële beslissingen op spreadsheets (of andere EUC&#8217;s). Het gebruik van EUC-toepassingen heeft zich ontwikkeld van eenvoudige spreadsheets (zoals het bijhouden van facturen) tot geavanceerde en ingewikkelde analyse-instrumenten die het management gebruikt om belangrijke zakelijke beslissingen te nemen. Dit varieert van het genereren van zakelijke instructies, transactieberekeningen tot business cases voor grote investeringen.</p>
<p>Er zijn duidelijke voordelen en nadelen aan het gebruik van EUC-toepassingen. EUC-tools zijn vaak gemakkelijk te leren en te gebruiken, flexibel en goedkoop. Andere voordelen zijn de gebruiksvriendelijke interface van Office, eenvoudige numerieke manipulaties en scenario-analyses.</p>
<p>EUC-toepassingen worden echter dikwijls ontwikkeld en onderhouden door mensen met onvoldoende IT-ervaring op dit gebied. De kwaliteit van het ontwikkelwerk is af en toe goed, maar onderhoud (back-up, herstel, controle op wijzigingen, documentatie) zijn vrijwel nooit in orde. Dit proces is ook in strijd met de basisfilosofie &#8220;scheiding van taken&#8221;: de bouwer van de tool is vaker wel dan niet tevens de gebruiker van de applicatie.</p>
<p>Dit resulteert in een groot risico voor de organisatie en de gebruikers van deze tools, die vaak afhankelijk zijn van de goede werking van deze EUC&#8217;s bij het maken van de juiste, op feiten gebaseerde operationele of bedrijfsbeslissingen.</p>
<h2>Risico&#8217;s van EUC&#8217;s</h2>
<p>EUC&#8217;s, met name MS Excel-spreadsheets, hebben sterke beperkingen en zwakke punten in het omgaan met grote hoeveelheden data en gecontroleerde gebruikerstoegang. De risico&#8217;s van EUC&#8217;s zijn des te groter als de EUC-toepassing wordt gebruikt in een instabiele of slecht gecontroleerde omgeving. Een deel van de risico&#8217;s voor de EUC zijn:</p>
<ul>
<li>Slechte input, die leidt tot een lage kwaliteit van de gegevens;</li>
<li>Gebrek aan controle over gebruikerstoegang;</li>
<li>Gemaakte wijzigingen zijn onvoldoende getest en gedocumenteerd;</li>
<li>Gebrek aan documentatie met betrekking tot het gebruik;</li>
<li>Gebrek aan een audit trail van de genomen besluiten;</li>
<li>Onvoldoende versiebeheer en</li>
<li>Inefficiëntie, dubbel werk.</li>
</ul>
<p>Al deze fouten kunnen leiden tot onvolledig begrip van de gebruiker, onjuiste gegevensstromen, gebrek aan logica, gebruik van verschillende versies en andere gebreken die een negatieve invloed hebben op het nemen van de juiste bedrijfsbeslissingen.</p>
<h1>Risicoanalyse van EUC in de praktijk</h1>
<p>Een goed ontworpen werkboek heeft een lager risico, zeker wanneer universele ontwerpprincipes worden gehanteerd. Op basis van ervaringen uit de praktijk is een aantal ontwerpprincipes uitgewerkt in een checklist. Flores heeft voor enkele klanten de checklist gebruikt om te bepalen wat het risico is van een werkboek. Het risico van een werkboek kan worden ingeschat door aan elk van onderstaande items een score toe te kennen van Laag, Midden of Hoog. Het beste effect wordt bereikt als meer dan één persoon deze scores toekent, en een gemiddelde wordt genomen van de rapporteurs.</p>
<h2>Structuur werkboek</h2>
<p><em>Maak onderscheid tussen werkbladen met invoer, berekeningen en uitvoer.</em><br />
Onderscheid maken tussen werkbladen met invoer, berekeningen en uitvoer, maakt de werking van een werkboek inzichtelijker. Het werkboek wordt makkelijker in het gebruik: het is goed zichtbaar waar alle invoer moet worden gedaan. Door invoer te groeperen, zal minder snel invoer op verschillende plaatsen in het werkboek worden gedaan. Het is praktisch om de werkbladen (en cellen) een kleur te geven afhankelijk van hun functie (invoer, berekeningen en uitvoer).</p>
<div id="attachment_890" class="wp-caption aligncenter" style="width: 347px"><a href="http://blogs.flores.nl/2012/11/20/risicomanagement-van-eindgebruikersapplicaties/juistgebruikstijlen/" rel="attachment wp-att-890"><img src="http://floresblogs.files.wordpress.com/2012/11/juistgebruikstijlen.png?w=480" alt="Overzichtelijk gebruik van celstijlen: oranje cellen voor invoer, grijze cellen voor formules"   class="size-full wp-image-890" /></a><p class="wp-caption-text">Overzichtelijk gebruik van celstijlen: oranje cellen voor invoer, grijze cellen voor formules</p></div>
<p><em>Volgorde berekeningen</em><br />
Formules die afhankelijk zijn van (waardes of formules van) andere cellen kunnen over het algemeen binnen een werkblad het beste geordend worden van links naar rechts, van boven naar beneden en binnen het werkboek, van voor naar achter. Voor een mens is dit logischer te begrijpen en daarom makkelijker. Voor Excel zelf maakt het niet uit; formules die naar andere cellen verwijzen kunnen voor of achter de genoemde cellen worden geplaatst. Dit komt omdat Excel geen cellen berekent in een vaste volgorde, of rij of kolom.</p>
<p><em>Geef werkbladen duidelijke namen, gebruik (sub)kopteksten boven gegevens</em><br />
In een organisatie met Engels als voertaal, zelfs in het geval dat alleen zo is onder delen van het personeel, is het aan te raden om Engelse benamingen te gebruiken. Dit, in het kader van het eventueel uit handen geven van het beheer van de tool aan een derde partij. Daarnaast moeten werkbladen natuurlijk duidelijke beschrijvende namen hebben en niet Sheet1, Sheet2…</p>
<p><em>Eenvoudige formules</em><br />
Een geneste functie is een functie binnen een functie, zoals =ALS(D2&lt;10000;&#8221;Slecht&#8221;;ALS(D2&gt;=20000;&#8221;Zeer goed&#8221;;&#8221;Goed&#8221;)). Het gebruik van complexe geneste formules is af te raden, omdat waarschijnlijk alleen de opsteller van de formule deze goed begrijpt. Het verdient de voorkeur om een formule op te splitsen in verschillende kleinere berekeningsstappen. Eenvoudige formules zijn beter te controleren, te veranderen en ze zijn minder vaak incorrect. Om die reden, bij voorkeur niet gebruiken:</p>
<ul>
<li>Ingewikkelde IF-formules;</li>
<li>Ongebruikelijke Excel-functies;</li>
<li>Matrix (of Array-)formules (Matrix- of array-formules worden niet vaak gebruikt en er is dan ook weinig documentatie over beschikbaar. Bovendien kan het gebruik van grote matrixformules veel rekenkracht vergen op werkstations met minder verwerkingscapaciteit);</li>
<li>User Defined Functions (UDF &#8211; gebruikersgedefinieerde functies): de definitie van een UDF kan worden gemaakt in programmeercode (VBA) en moet ergens opgeslagen worden en beschikbaar zijn voor de gebruikers. Om code in een werkboek op te slaan, moet het werkboek worden opgeslagen als Excel-werkboek met macro&#8217;s (.xlsm), met daarbij de mogelijke veiligheidsrisico&#8217;s. Een mogelijke oplossing is de UDF&#8217;s op te slaan als invoegtoepassing (add-in). Dit heeft wel als praktisch probleem dat een invoegtoepassing voor alle gebruikers beschikbaar moet worden gesteld. Hierover volgt nog een nieuwe blogpost.</li>
<li>Verborgen rijen of kolommen, tenzij deze wijs worden gebruikt om complexe berekeningen (zie eerder) op te delen</li>
</ul>
<p><em>Named ranges</em><br />
Goed gebruik van named ranges (Excel-namen) maakt formules beter leesbaar. Een Named Range is een duidelijke beschrijving, waarmee het gemakkelijker wordt te begrijpen wat het doel is van een cel of een verzameling cellen. Voorbeelden van goed gebruik van namen zijn: <i>TariefBTW</i> of <i>Startdatum</i>. Deze namen kunnen in berekeningen in het gehele werkboek worden gebruikt. <a href="http://office.microsoft.com/nl-nl/excel-help/namen-definieren-en-gebruiken-in-formules-HA010147120.aspx">Zie ook dit artikel van Microsoft</a>.</p>
<p><em>Eenheden consistent vermelden</em><br />
Om verwarring over eenheden te voorkomen is het noodzakelijk dat bij elke kolom de gehanteerde eenheid wordt vermeld in de kolomkop: meter, liter, TW/GW/MW/kW/kWh, EUR, Y(ear), (Q)uarter, enz.</p>
<p><em>Datumkolom</em><br />
Een datumkolom wordt vaak gevuld door in elke cel een datumwaarde te zetten. Het is beter om een datum te laten berekenen ten opzichte van een datum (=MONTH(StartDatum)). Dit om verkeerd kopiëren te voorkomen.</p>
<p><em>Consistente opmaak</em><br />
Een van de meest onderschatte onderdelen bij het verminderen van risico&#8217;s die EUC&#8217;s met zich meebrengen is het consistent gebruiken van opmaak. Gek genoeg zijn veel mensen wel overtuigd van het nut van het consistent opstellen van een offerte in Word of een presentatie in PowerPoint, in Excel lijkt het soms het wilde westen als het gaat om opmaak. Iedereen hanteert zijn eigen kleuren, lettertypes, randen, enz., waarmee het werkboek zeer moeilijk is te vergelijken met andere werkboeken met een volledig andere opmaak. Het gebruik van celstijlen is zeer aan te raden. <a href="http://office.microsoft.com/nl-nl/excel-help/een-celstijl-maken-toepassen-of-verwijderen-HP001216732.aspx">Lees hierover meer in dit Microsoft-artikel</a>.</p>
<p><em>Gebruik van Excel-tabellen en gestructureerde verwijzingen</em><br />
Gegevenslijsten moeten altijd in een Excel-tabel worden gezet, omdat Excel dan zorgt voor consistentie binnen de kolommen. Een ingevoerde formule in een Excel-tabel wordt automatisch gekopieerd naar de hele kolom. Door gestructureerde verwijzingen te gebruiken worden celverwijzingen automatisch aangepast bij de meeste wijzigingen. Tip: druk op CTRL-L om gegevens om te zetten in een tabel. <a href="http://office.microsoft.com/nl-nl/excel-help/gestructureerde-verwijzingen-in-combinatie-met-excel-tabellen-gebruiken-HA010342999.aspx?CTT=1">Zie ook dit artikel van Microsoft</a>.</p>
<p><em>Invoercontrole</em><br />
De invoer van gebruikers kan worden gevalideerd met gegevensvalidatie (validatie op celniveau). Ook kunnen controleformules worden gebruikt; dit werkt vaak inzichtelijker omdat de formule ook in het werkboek staat. Controleformules kunnen ook gebruikt worden om de resultaten van (tussenliggende) berekeningen te controleren.</p>
<p><em>Bijzondere werkbladen</em><br />
Het is aan te raden om in elk werkboek een aantal vaste werkbladen aan te maken met  specifieke functies. Deze werkbladen hebben een rol bij het versiebeheer, controle van invoer en overzichtelijkheid van het werkboek.</p>
<li>Configuratiewerkblad</li>
<p>Op het configuratiewerkblad kunnen standaardwaarden, modelparameters en opzoektabellen worden geplaatst.</p>
<li>Controlewerkblad</li>
<p>Het controlewerkblad bevat controleformules om te kijken of de resultaten plausibel zijn. Het is aan te raden om gedurende de ontwikkeling van een werkboek telkens controles toe te voegen, in plaats van op het laatst te proberen te bedenken wat er allemaal verkeerd kan gaan.</p>
<li>Revisiewerkblad</li>
<p><a href="http://floresblogs.files.wordpress.com/2012/11/revisionsheet.png"><img src="http://floresblogs.files.wordpress.com/2012/11/revisionsheet.png?w=480" alt="" title="Revisiewerkblad"   class="aligncenter size-full wp-image-888" /></a>Een revisiewerkblad met een beschrijving van de wijzigingen, datum en auteur van de laatste versie is nuttig om samenwerken aan dezelfde EUC-toepassing mogelijk te maken. Dit is ook een goede plaats om beslissingen over wijzigingen op te slaan om later op terug te kunnen kijken.</p>
<li>Instructiewerkblad</li>
<p>Bevat een beschrijving over het gebruik, de betekenis van de werkbladen en het nut van werkboek.</p>
<li>Navigatiewerkblad</li>
<p>Een navigatiewerkblad kan gebruikt worden om het model inzichtelijk te maken, bijvoorbeeld door de werkbladen in een stroomschema op te nemen.<br />
<a href="http://floresblogs.files.wordpress.com/2012/11/navigationsheet.png"><img src="http://floresblogs.files.wordpress.com/2012/11/navigationsheet.png?w=480" alt="" title="Navigatiewerkblad"   class="aligncenter size-full wp-image-889" /></a></p>
<h3>Hulp bij spreadsheetmanagement</h3>
<p>Dit blogartikel geeft een globaal beeld van de risico&#8217;s van het gebruik van spreadsheets. We hebben een aantal aandachtspunten genoemd, waarop gelet kan worden bij het doen van een technische scan. Door een technische scan uit te (laten) voeren worden de risico’s van een spreadsheet duidelijk gemaakt en kunnen stappen worden genomen de risico&#8217;s te beteugelen, bijvoorbeeld door de EUC te verbeteren, te vervangen door een beter gecontroleerde applicatie of door de EUC buiten werking te stellen.</p>
<p>Wilt u meer weten over EUC’s,  onze risicoscan van Excel en het beheersen van  risico’s die EUC&#8217;s met zich meedragen, neem dan contact op met ons. Wij helpen u graag!</p>
<p>Martin Drenth<br />
Toon Michel</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/floresblogs.wordpress.com/881/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/floresblogs.wordpress.com/881/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.flores.nl&#038;blog=32027457&#038;post=881&#038;subd=floresblogs&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogs.flores.nl/2012/11/20/risicomanagement-van-eindgebruikersapplicaties/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/545c2c5ba99083299c7a136662c61128?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">martinitramflores</media:title>
		</media:content>

		<media:content url="http://floresblogs.files.wordpress.com/2012/11/juistgebruikstijlen.png" medium="image">
			<media:title type="html">Overzichtelijk gebruik van celstijlen: oranje cellen voor invoer, grijze cellen voor formules</media:title>
		</media:content>

		<media:content url="http://floresblogs.files.wordpress.com/2012/11/revisionsheet.png" medium="image">
			<media:title type="html">Revisiewerkblad</media:title>
		</media:content>

		<media:content url="http://floresblogs.files.wordpress.com/2012/11/navigationsheet.png" medium="image">
			<media:title type="html">Navigatiewerkblad</media:title>
		</media:content>
	</item>
		<item>
		<title>Useful webpages about Office template development</title>
		<link>http://blogs.flores.nl/2012/10/15/useful-webpages-about-office-template-development/</link>
		<comments>http://blogs.flores.nl/2012/10/15/useful-webpages-about-office-template-development/#comments</comments>
		<pubDate>Mon, 15 Oct 2012 14:09:16 +0000</pubDate>
		<dc:creator>Toon</dc:creator>
				<category><![CDATA[Office]]></category>
		<category><![CDATA[Word]]></category>
		<category><![CDATA[fields]]></category>
		<category><![CDATA[PowerPoint]]></category>
		<category><![CDATA[reference]]></category>
		<category><![CDATA[templates]]></category>

		<guid isPermaLink="false">http://blogs.flores.nl/?p=864</guid>
		<description><![CDATA[After some years of creating and modifying various templates I collected some useful links. Of course, by using any web &#8230;<p><a href="http://blogs.flores.nl/2012/10/15/useful-webpages-about-office-template-development/">Lees verder &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.flores.nl&#038;blog=32027457&#038;post=864&#038;subd=floresblogs&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://floresblogs.files.wordpress.com/2012/09/136px-gluehlampe_01_kmj.jpg"><img class="alignright size-full wp-image-872" title="Gloeilamp" alt="" src="http://floresblogs.files.wordpress.com/2012/09/136px-gluehlampe_01_kmj.jpg?w=480"   /></a>After some years of creating and modifying various templates I collected some useful links. Of course, by using any web search engine, you probably will find your answer about creating templates. But still I think it is good to know these fine resources about Office development. My favorite web resources for developing templates are the following:<span id="more-864"></span></p>
<p><a href="http://www.rondebruin.nl/tips.htm">Ron de Bruin</a><br />
The most comprehensive source for tutorials about customizing the user interface (ribbon and backstage view) of Office 2007, 2010, 2013.</p>
<p><a href="http://gregmaxey.mvps.org/word_tips.html">Greg Maxey</a><br />
A seasoned Word expert who wrote many articles about for instance using building blocks and merge fields in Word.</p>
<p><a href="http://word.mvps.org/index.html">Word MVP site</a><br />
MVP&#8217;s are Microsoft Valued Professionals. This website is the central storage place of many articles about Word by MVP&#8217;s. The site looks a bit outdated, but many articles are still valid.</p>
<p><a href="http://homepage.swissonline.ch/cindymeister/">Cindy Meister</a><br />
Another Word and mail merge expert.</p>
<p><a href="http://www.gmayor.com/word_pages.htm">Graham Mayor</a><br />
Graham Mayor, an expert in Word fields and macros.</p>
<p><a href="http://blogs.office.com/">Blogs Office</a><br />
Last news about new versions of Office. A lot of ooh&#8217;s and aah&#8217;s about Office 2013.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/office/cc313152%28v=office.12%29.aspx">Office development reference manual</a><br />
The official source on the Microsoft Software Developers Network (MSDN).</p>
<p><a href="http://www.powerpointninja.com">PowerPoint Ninja</a><br />
Last but not least, tips and tricks and best practices about creating PowerPoint templates.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/floresblogs.wordpress.com/864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/floresblogs.wordpress.com/864/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.flores.nl&#038;blog=32027457&#038;post=864&#038;subd=floresblogs&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogs.flores.nl/2012/10/15/useful-webpages-about-office-template-development/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/121433191c3f8ee84240282564fd22a3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">florestoon</media:title>
		</media:content>

		<media:content url="http://floresblogs.files.wordpress.com/2012/09/136px-gluehlampe_01_kmj.jpg" medium="image">
			<media:title type="html">Gloeilamp</media:title>
		</media:content>
	</item>
		<item>
		<title>Documentsjabloon in Word: macro&#8217;s of snelonderdelen kwijt</title>
		<link>http://blogs.flores.nl/2012/09/18/documentsjabloon-in-word-macros-of-snelonderdelen-kwijt/</link>
		<comments>http://blogs.flores.nl/2012/09/18/documentsjabloon-in-word-macros-of-snelonderdelen-kwijt/#comments</comments>
		<pubDate>Tue, 18 Sep 2012 09:04:42 +0000</pubDate>
		<dc:creator>Toon</dc:creator>
				<category><![CDATA[Office]]></category>
		<category><![CDATA[Word]]></category>
		<category><![CDATA[attached template]]></category>
		<category><![CDATA[documentsjabloon]]></category>
		<category><![CDATA[macro's]]></category>
		<category><![CDATA[quick parts]]></category>
		<category><![CDATA[snelonderdelen]]></category>

		<guid isPermaLink="false">http://blogs.flores.nl/?p=837</guid>
		<description><![CDATA[Macro&#8217;s of snelonderdelen raken soms verloren wanneer het sjabloon niet meer beschikbaar is. In dit artikel staat een aantal manieren &#8230;<p><a href="http://blogs.flores.nl/2012/09/18/documentsjabloon-in-word-macros-of-snelonderdelen-kwijt/">Lees verder &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.flores.nl&#038;blog=32027457&#038;post=837&#038;subd=floresblogs&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Macro&#8217;s of snelonderdelen raken soms verloren wanneer het sjabloon niet meer beschikbaar is. In dit artikel staat een aantal manieren om het documentsjabloon weer beschikbaar te maken, zodat de macro&#8217;s, snelonderdelen of aanpassingen in het lint weer terugkomen.<span id="more-837"></span></p>
<p>Een Word-document dat gemaakt wordt op basis van een documentsjabloon wordt vanzelf gekoppeld aan dat sjabloon. Daarmee worden in het document een aantal elementen uit het sjabloon beschikbaar (voor zover dit sjabloon deze elementen bevat):</p>
<ul>
<li>Bouwstenen/snelonderdelen (Building Blocks/Quick Parts)</li>
<li>Macro&#8217;s</li>
<li>Aanpassingen in het lint (Ribbon customizations)</li>
<li>Aanpassingen in de snelle toegang-knoppen (Quick Access Toolbar)</li>
<li>Sneltoetsen (Shortcuts)</li>
<li>Aangepaste opdrachten (Command settings)</li>
</ul>
<p>Er zijn verschillende mogelijkheden om de elementen uit het sjabloon weer beschikbaar te maken.<br />
<a href="http://floresblogs.files.wordpress.com/2012/08/documentsjabloon.png"><img class="alignright size-medium wp-image-859" title="documentsjabloon" src="http://floresblogs.files.wordpress.com/2012/08/documentsjabloon.png?w=295&#038;h=300" alt="Attached template in WOrd" width="295" height="300" /></a>1. Zorg dat het sjabloon op dezelfde plaats staat als het stond toen het document werd gemaakt. Een document is gelinkt aan het sjabloon met een padverwijzing. Via de knop Documentsjabloon op de tab Ontwikkelaars* is te zien waar Word verwacht dat het sjabloon staat.<br />
2. Plaats het sjabloon in de Opstarten-, Gebruikerssjablonen- of Werkgroepsjablonen-map (vraag systeembeheer dit te doen voor alle gebruikers bijvoorbeeld). De sjabloon-elementen worden dan overigens wel beschikbaar in álle documenten.<br />
3. Link het document aan het sjabloon op de nieuwe plaats (bijvoorbeeld als 1. niet lukt) via de knop Document template op de tab Ontwikkelaars (Developer)*.<br />
4. Plaats het sjabloon in dezelfde map als het document. Word zal de link automatisch aanpassen.<br />
5. Via het Word VBA-commando kan ook het documentsjabloon worden gelinkt. Gebruik daarvoor:<br />
<code>ActiveDocument.AttachedTemplate = "[pad]\[sjabloonnaam].dotx"</code></p>
<p>* Als de Ontwikkelaars-tab niet zichtbaar is:<br />
Bestand &#8211; Opties &#8211; Lint aanpassen<br />
Klik onder Het lint aanpassen op Hoofdtabbladen<br />
Schakel in de lijst het selectievakje Ontwikkelaar in en klik op OK.</p>
<p>Zie ook:<br />
<a href="http://office.microsoft.com/nl-nl/word-help/een-word-document-opslaan-als-sjabloon-HA101868862.aspx?CTT=1">Een Word-document opslaan als sjabloon</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/floresblogs.wordpress.com/837/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/floresblogs.wordpress.com/837/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.flores.nl&#038;blog=32027457&#038;post=837&#038;subd=floresblogs&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogs.flores.nl/2012/09/18/documentsjabloon-in-word-macros-of-snelonderdelen-kwijt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/121433191c3f8ee84240282564fd22a3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">florestoon</media:title>
		</media:content>

		<media:content url="http://floresblogs.files.wordpress.com/2012/08/documentsjabloon.png?w=295" medium="image">
			<media:title type="html">documentsjabloon</media:title>
		</media:content>
	</item>
		<item>
		<title>Ontwikkelen van een voor Office geschikte .NET library</title>
		<link>http://blogs.flores.nl/2012/08/17/ontwikkelen-van-een-voor-office-geschikte-net-library/</link>
		<comments>http://blogs.flores.nl/2012/08/17/ontwikkelen-van-een-voor-office-geschikte-net-library/#comments</comments>
		<pubDate>Fri, 17 Aug 2012 08:16:11 +0000</pubDate>
		<dc:creator>Victor Heijke</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Com]]></category>
		<category><![CDATA[DLL]]></category>
		<category><![CDATA[Regasm]]></category>
		<category><![CDATA[TLB]]></category>

		<guid isPermaLink="false">http://blogs.flores.nl/?p=843</guid>
		<description><![CDATA[Ontwikkelen van een voor Office geschikte .NET library Libraries bouwen in .NET is goed mogelijk, maar zorgen dat deze library &#8230;<p><a href="http://blogs.flores.nl/2012/08/17/ontwikkelen-van-een-voor-office-geschikte-net-library/">Lees verder &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.flores.nl&#038;blog=32027457&#038;post=843&#038;subd=floresblogs&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<h1>Ontwikkelen van een voor Office geschikte .NET library</h1>
<p>Libraries bouwen in .NET is goed mogelijk, maar zorgen dat deze library te gebruiken is in VBA levert vaak problemen op. In deze walkthrough is het ontwikkelen van een library voor Office met C# beschreven.<br />
<span id="more-843"></span></p>
<h2>Wat moet er allemaal gebeuren?</h2>
<p>Voor de programmeurs met de juiste kennis is dit wellicht al voldoende:</p>
<ul>
<li>Zorg dat er een constructor is (ook als je geen code daarvoor hebt).</li>
<li>Zorg dat de class een interface heeft.</li>
<li>Zorg dat de class gesigned is</li>
<li>Zorg dat de compiler directives voor COM aanwezig zijn in de class en in de interface.</li>
<li>Registreer met de juiste tools de class.</li>
</ul>
<h2>Gebruikte techniek</h2>
<p>Visual Studio 2010 (C#), Microsoft Word 2003 of hoger (VBA).</p>
<h2>Het project</h2>
<p>In dit voorbeeld wordt een library gemaakt die de uitslagen van de Nederlandse Olympische 2012 medailles kan geven. Deze library krijgt de naam OS2012NL.</p>
<ol>
<li>Start Visual Studio 2010 en start een nieuw C# Class Library project en noem het OS2012NL.</li>
<li>Hernoem de class1.cs bestand naar naar Medals.cs. Zorg dat de class ook deze naam heeft.</li>
<li>Implementeer de class als volgt zodat hij in de basis klaar is.</li>
</ol>
<pre class="brush: csharp; title: ; wrap-lines: false; notranslate">
using System;
using System.Collections.Generic;

namespace OS2012NL
{
    public class MedalOverview
    {
        public enum MedalType
        {
            Gold,
            Silver,
            Bronze
        }

        public int getMedalCount(MedalType medal){
            switch (medal)
            {
                case MedalType.Gold:
                    return 6;
                case MedalType.Silver:
                    return 6;
                case MedalType.Bronze:
                    return 8;
                default:
                    return 20;
            }
        }

        public string[] getSports(MedalType medal)
        {
            switch (medal)
            {
                case MedalType.Gold:
                    return new string[]{&quot;Swimming&quot;,&quot;Sailing&quot;,&quot;Hockey&quot;, &quot;Cycling&quot;, &quot;Gymnastics&quot;};
                case MedalType.Silver:
                    return new string[]{&quot;Swimming&quot;,&quot;Sailing&quot;,&quot;Hockey&quot;, &quot;Equestrian&quot;};
                case MedalType.Bronze:
                    return new string[]{&quot;Swimming&quot;,&quot;Sailing&quot;, &quot;Equestrian&quot;, &quot;Judo&quot;, &quot;Cycling BMX&quot;, &quot;Cycling track&quot;, &quot;Rowing&quot;};
                default:
                    return new string[] { &quot;Swimming&quot;, &quot;Sailing&quot;, &quot;Hockey&quot;, &quot;Cycling&quot;, &quot;Gymnastics&quot;, &quot;Equestrian&quot;, &quot;Judo&quot;, &quot;Cycling BMX&quot;, &quot;Cycling track&quot;, &quot;Rowing&quot; };

            }
        }
    }
}
</pre>
<p>Je kan hem nu probleemloos vanuit een .NET-applicatie aanroepen. Test dit door een console-applicatie toe te voegen aan het project en de volgende code te gebruiken.</p>
<pre class="brush: csharp; title: ; wrap-lines: false; notranslate">
using System;
using System.Collections.Generic;
using OS2012NL;

namespace TestOS2012NL
{
    class Program
    {

        static MedalOverview mo = new MedalOverview();

         static void Main(string[] args)
        {
            Console.WriteLine(mo.getMedalCount(MedalOverview.MedalType.Gold));

            printMedals(MedalOverview.MedalType.Gold);
            printMedals(MedalOverview.MedalType.Silver);
            printMedals(MedalOverview.MedalType.Bronze);

            Console.WriteLine(&quot;press a key&quot;);
            Console.ReadKey();
        }

        static void printMedals( MedalOverview.MedalType medal)
        {
            Console.WriteLine();
            Console.WriteLine(string.Format(&quot;the Netherlands won {0} {1} medals in the following sports:&quot;, mo.getMedalCount(medal),medal.ToString() ));
            foreach (String item in mo.getSports(medal))
            {
                Console.WriteLine(item);
            }

        }
    }
}

</pre>
<p>Maar goed, we willen hem voor Office beschikbaar gaan maken. Je kan beginnen door hem te laten registreren voor COM Interop, door bij de properties van de klasse onder Application, Assembly Information een vinkje aan te zetten bij “Make assembly COM-visible” Dit lijkt te werken, maar dat is niet genoeg als je met Office werkt.</p>
<p>Om de class geschikt te maken voor Office, moet je de volgende “zaken” regelen.</p>
<ul>
<li>Zorg dat er een constructor is.</li>
<li>Zorg dat er een interface is</li>
<li>Zorg dat de interface en de klasse strong named zijn</li>
<li>Zorg dat de compiler directives aanwezig zijn in je klasse en in de interface.</li>
<li>Registreer met de juiste tools je klasse.</li>
</ul>
<p>De constructor toevoegen.</p>
<p>In VB.NET voeg een sub New toe en in C# plaats je:</p>
<pre class="brush: csharp; title: ; wrap-lines: false; notranslate">
public MedalOverview()
{
}
</pre>
<p>Ook al hebben we geen code voor de constructor.</p>
<h2>De interface</h2>
<p>Natuurlijk denk je normaal eerst goed na en schrijf je eerst je interface en dan pas je code. We doen het nu even pragmatisch en construeren via Refactor, Extract Interface een interface. Noem hem iMedalOverview en maak zowel beide functies public en de interface public.</p>
<pre class="brush: csharp; title: ; wrap-lines: false; notranslate">
using System;
namespace OS2012NL
{
    public interface IMedalOverview
    {
        int getMedalCount(MedalOverview.MedalType medal);
        string[] getSports(MedalOverview.MedalType medal);
    }
}
</pre>
<p>Visual Studio heeft naast het schrijven van de interface ook je class aangepast. Er staat nu:</p>
<pre class="brush: csharp; title: ; wrap-lines: false; notranslate">
public class MedalOverview : OS2012NL.IMedalOverview
</pre>
<h2>De klasse signen</h2>
<p>Dit hoeft geen ‘echt’ certificaat zijn. Ga in Visual Studio naar de eigenschappen van het project van OS2012NL en zet bij Signing, Sign the assembly aan. Gebruik een bestaand certificaat aan of genereer er hier een.</p>
<h2>Compiler directives toevoegen</h2>
<p>Met een paar compiler directives in de code hoeven we niet op zoek te gaan naar allemaal vinkjes in Visual Studio en zetten we in één klap een GUID, de COM-instellingen en een program ID.</p>
<p>Neem in de klasse en in de interface eerst een verwijzing op naar de InteropServices</p>
<pre class="brush: csharp; title: ; wrap-lines: false; notranslate">
using System.Runtime.InteropServices;
</pre>
<p>Bepaal daarna een nieuwe GUID voor je klasse, dit kan je in Visual Studio onder Tools doen (Create GUID, type 5 als je in C# werkt). Neem dit GUID op in de volgende code die je voor de class-declaratie opneemt.</p>
<pre class="brush: csharp; title: ; wrap-lines: false; notranslate">
[Guid(&quot;E74DF58D-7155-4B20-9484-203E6AF28F20&quot;),
ClassInterface(ClassInterfaceType.None),
ProgId(&quot;OS2012NL&quot;), ComVisible(true)]
public class MedalOverview : OS2012NL.IMedalOverview
</pre>
<p>In de Interface neem je enkel een nieuw GUID en COM-visible op.</p>
<pre class="brush: csharp; title: ; wrap-lines: false; notranslate">
[Guid(&quot;A0478EFB-5D5D-40E1-9B90-F1035218A6B6&quot;)]
[ComVisible(true)]
public interface IMedalOverview

</pre>
<p>Goed, de klasse is klaar. Maar Office kan niet direct met een COM DLL praten en het heeft hier een zogenaamd TLB-bestand voor nodig. Dit creëer je eenvoudig met Regasm uit het .NET framework. Deze staat in C:\Windows\Microsoft.NET\Framework\v4.0.30319 (of in de map van de andere versies van het framework)</p>
<p>Ga naar een command prompt, ga naar de release folder van het project en tik:<br />
C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe OS2012NL.dll /tlb: OS2012NL.tlb /codebase</p>
<p>Pas op! Als je dit doet op een 64-bits machine dan moet je regasm uit het 64 bits path van het framework gebruiken: C:\Windows\Microsoft.NET\Framework64\v4.0.30319. Pak je de verkeerde dan wordt je DLL wel geregistreerd, maar zal hij foutmeldingen geven.</p>
<p>Als het goed is, maakt Regasm een TLB-bestand aan en is de dll geregistreerd.</p>
<h2>De klasse in VBA gebruiken</h2>
<p>Ga in een Office-applicatie naar VBA.</p>
<p>Als het goed is vind je onder Tools &#8211; References de dll terug (feitelijk is dat een link naar het TLB-bestand)</p>
<div id="attachment_846" class="wp-caption alignnone" style="width: 310px"><a href="http://floresblogs.files.wordpress.com/2012/08/referenties.png"><img class="size-medium wp-image-846" title="Referenties dialoog in VBA" src="http://floresblogs.files.wordpress.com/2012/08/referenties.png?w=300&#038;h=240" alt="Referenties dialoog in VBA" width="300" height="240" /></a><p class="wp-caption-text">Referenties dialoog in VBA</p></div>
<p>Staat hij er niet bij, dan kun je met Browse het TLB-bestand aanwijzen.</p>
<p>Vink hem aan en probeer of tik de volgende code.</p>
<pre class="brush: plain; title: ; wrap-lines: false; notranslate">
Sub Macro1()
    Dim objOS As New OS2012NL.MedalOverview
    Dim sports() As String

    sports() = objOS.getSports(MedalType_Silver)

    For Each s In sports()
       Debug.Print s
    Next s
End Sub
</pre>
<h2>Deployment</h2>
<p>Je kunt nu de dll naar een machine kopiëren en regasm gebruiken. Heb je het TLB-bestand al gemaakt dan kan je ook Regtlbv12.exe gebruiken. Deze kan meteen de TLB registeren, maar ik gebruik eigenlijk altijd Regasm.</p>
<h1>Problemen en oplossingen</h1>
<h2>De DLL registreert, maar doet het niet.</h2>
<p>Heb je wel de juiste versie van Regasm gebruikt? 64 bits machines moeten de regasm uit de Framework64-map van het .NET-framework gebruiken.</p>
<h2>Intellisense laat mijn methoden niet zien</h2>
<p>Heb je de properties en functies en de klasse zelf public gemaakt? Heb je de interface gemaakt?</p>
<h2>Can’t create Active X component</h2>
<ul>
<li>Heb je de juiste regasm gebruikt? (zie probleem 1)</li>
<li>Gebruikt je DLL niet zelf weer een dll die niet goed geregistreerd is of afwezig? Vaak kan je de refererende dll in Visual Studio gewoon meekopiëren naar de map waar je je dll plaatst. Over .NET dll’s hoef je je niet druk te maken.</li>
<li>Heb je de constructor wel gemaakt?</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/floresblogs.wordpress.com/843/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/floresblogs.wordpress.com/843/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.flores.nl&#038;blog=32027457&#038;post=843&#038;subd=floresblogs&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogs.flores.nl/2012/08/17/ontwikkelen-van-een-voor-office-geschikte-net-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/9dbd3fcfd6363b54e50272650fecd113?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">floresnl</media:title>
		</media:content>

		<media:content url="http://floresblogs.files.wordpress.com/2012/08/referenties.png?w=300" medium="image">
			<media:title type="html">Referenties dialoog in VBA</media:title>
		</media:content>
	</item>
		<item>
		<title>ASPxGridView master-detail data presentation with context menus</title>
		<link>http://blogs.flores.nl/2012/08/10/aspxgridview-master-detail-data-presentation-with-context-menus/</link>
		<comments>http://blogs.flores.nl/2012/08/10/aspxgridview-master-detail-data-presentation-with-context-menus/#comments</comments>
		<pubDate>Fri, 10 Aug 2012 13:40:14 +0000</pubDate>
		<dc:creator>flores automatisering</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[ASPxGridView]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Callback]]></category>
		<category><![CDATA[context]]></category>
		<category><![CDATA[context menu]]></category>
		<category><![CDATA[detail]]></category>
		<category><![CDATA[DevExpress]]></category>
		<category><![CDATA[grid]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[master]]></category>
		<category><![CDATA[master-detail]]></category>
		<category><![CDATA[menu]]></category>

		<guid isPermaLink="false">http://blogs.flores.nl/?p=833</guid>
		<description><![CDATA[Introduction As many companies I worked for are using DevExpress controls I decided to write a couple of posts about &#8230;<p><a href="http://blogs.flores.nl/2012/08/10/aspxgridview-master-detail-data-presentation-with-context-menus/">Lees verder &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.flores.nl&#038;blog=32027457&#038;post=833&#038;subd=floresblogs&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<h2>Introduction</h2>
<p>As many companies I worked for are using DevExpress controls I decided to write a couple of posts about some real life situations and ways they can be solved by using DevExpress ASP.NET Suite. In this and the following post I will show a couple of techniques on how to achieve a certain behavior that goes slightly further than the demo examples that you can find on <a href="http://demos.devexpress.com/ASP/" target="_blank">DevExpress site</a>.<br />
I will be using ASP.NET suite of controls, more specifically Web Forms.<br />
<span id="more-833"></span><br />
At the end of the article this is the expected result:<br />
<img class="aligncenter size-full wp-image-189" title="final" src="http://mariomajcica.files.wordpress.com/2012/07/final.png?w=480" alt=""   /></p>
<p>You can also check the <a href="http://demos.majcica.com/MasterDetailDemo1/" target="_blank">LIVE DEMO</a>.</p>
<h2>Table of contents</h2>
<ol>
<li><a href="#what">What are DevExpress controls?</a></li>
<li><a href="#req">Requirements</a></li>
<li><a href="#proj">The project</a></li>
<li><a href="#creatingds">Creating a data source</a></li>
<li><a href="#webpage">The web page</a></li>
<li><a href="#detailgrid">Defining a detail grid</a></li>
<li><a href="#contextmenu">Adding a context menu to the detail grid</a></li>
<li><a href="#disabling">Programmatically disabling menu items</a></li>
<li><a href="#aesthetic">Aesthetic changes</a></li>
<li><a href="#downloads">Downloads and the source code</a></li>
<li><a href="#notes">Notes and other resources</a></li>
</ol>
<p><a name="what"></a></p>
<h2>What are DevExpress controls?</h2>
<p>A set of controls that enrich your toolbox by adding several controls that are not present in the standard ASP.NET controls and some of the controls that are offered as a good substitute to already existing controls. All of the DevExpress controls are rich by the properties, methods and events both on client and server side, giving you the possibility to achieve results that otherwise will require a lot more extra coding.</p>
<p><a name="req"></a></p>
<h2>Requirements</h2>
<p>All of my examples are written for .NET 4.0 with Visual Studio 2010 using the version v2012 vol 1.5 of DevExpress controls. You can find a trial version of the requested controls here <a href="http://www.devexpress.com/Home/Try.xml" target="_blank">DevExpress Demo</a>. Any version of Visual Studio is just fine, from Express to Ultimate. Also you can easily migrate this project to .NET 3.5 if needed. In case that the version of DevExpress controls I used is not available anymore, it should be easy to upgrade the project by DXperience Project Converter. For more information on the project converter check the DevExpress web site.</p>
<p><a name="proj"></a></p>
<h2>The project</h2>
<p>I will start with the default Visual Studio ASP.NET Web Application.<br />
Because this example is about the UI and the controls itself, I will put no emphasis on the data source and just create a super simple data model. We will have two data entities, User and Project. As a cardinality, we have a many-to-many relationship, so one user can be related to many projects and a project can have several users. Also I will create a class called DataService that will create a couple of values that will represent our data.</p>
<p>Let’s start!</p>
<p><a name="creatingds"></a></p>
<h2>Creating a data source</h2>
<p>First we will create a Project class. In the default constructor we will set the project status property to new. Except for this, we will have three properties, an ID, project name, and a project status.</p>
<pre class="brush: csharp; title: ; wrap-lines: false; notranslate">
public class Project
{
    public Project()
    {
        Status = ProjectStatus.New;
    }

    public int ID { get; set; }
    public string Name { get; set; }
    public ProjectStatus Status { get; set; }
}
</pre>
<p>As you can see, project status is an enumerator, so let’s define it together with other possible project statuses.</p>
<pre class="brush: csharp; title: ; wrap-lines: false; notranslate">
public enum ProjectStatus
{
    New,
    InProgress,
    Failed,
    Done
}
</pre>
<p>Now we will define the user class. It has several properties and one public method. The method returns the number of associated projects of the current customer instance.</p>
<pre class="brush: csharp; title: ; wrap-lines: false; notranslate">
public class User
{
    public User()
    {
        Projects = new List&amp;lt;Project&amp;gt;();
    }

    private string m_fullName;

    public int ID { get; set; }
    public string UserName { get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public List&amp;lt;Project&amp;gt; Projects { get; set; }

    public string FullName
    {
        get { return string.Format(&amp;quot;{0}, {1}&amp;quot;, this.LastName, this.FirstName); }
    }

    public bool HasProjects()
    {
        return Projects.Count &amp;gt; 0;
    }
}
</pre>
<p>This is a very simple model and probably in a real life situation your model will of course be richer with properties and methods.<br />
Next to come is a class that will create several instances of the model classes and return them via a method. In this way we can have easily all the data we need for our example. The code I used is the following, you can add other data if you are looking for a particular behavior.</p>
<pre class="brush: csharp; title: ; wrap-lines: true; notranslate">
[DataObject(true)]
public class DataService
{
    [DataObjectMethodAttribute(DataObjectMethodType.Select, true)]
    public static List&amp;lt;User&amp;gt; GetUsers()
    {
        List&amp;lt;User&amp;gt; users = new List&amp;lt;User&amp;gt;();

        users.Add(new User() { ID = 1, UserName = &amp;quot;JohnDoe&amp;quot;, FirstName = &amp;quot;John&amp;quot;, LastName = &amp;quot;Doe&amp;quot;, Projects = GetSomeProjects() });
        users.Add(new User() { ID = 2, UserName = &amp;quot;JimDoe&amp;quot;, FirstName = &amp;quot;Jim&amp;quot;, LastName = &amp;quot;Doe&amp;quot;, });
        users.Add(new User() { ID = 3, UserName = &amp;quot;RobertDoe&amp;quot;, FirstName = &amp;quot;Robert&amp;quot;, LastName = &amp;quot;Doe&amp;quot;, });
        users.Add(new User() { ID = 4, UserName = &amp;quot;AlisonDoe&amp;quot;, FirstName = &amp;quot;Alison&amp;quot;, LastName = &amp;quot;Doe&amp;quot;, Projects = GetSomeProjects2() });

        return users;
    }

    [DataObjectMethodAttribute(DataObjectMethodType.Select, false)]
    private static List&amp;lt;Project&amp;gt; GetSomeProjects()
    {
        List&amp;lt;Project&amp;gt; projects = new List&amp;lt;Project&amp;gt;();

        projects.Add(new Project() { ID = 1, Name = &amp;quot;Test1&amp;quot; });
        projects.Add(new Project() { ID = 2, Name = &amp;quot;Test2&amp;quot;, Status = ProjectStatus.Failed });
        projects.Add(new Project() { ID = 3, Name = &amp;quot;Test3&amp;quot; });

        return projects;
    }

    [DataObjectMethodAttribute(DataObjectMethodType.Select, false)]
    private static List&amp;lt;Project&amp;gt; GetSomeProjects2()
    {
        List&amp;lt;Project&amp;gt; projects = new List&amp;lt;Project&amp;gt;();

        projects.Add(new Project() { ID = 4, Name = &amp;quot;Test4&amp;quot; });
        projects.Add(new Project() { ID = 5, Name = &amp;quot;Test5&amp;quot;, Status = ProjectStatus.Failed });
        projects.Add(new Project() { ID = 6, Name = &amp;quot;Test6&amp;quot;, Status = ProjectStatus.InProgress });

        return projects;
    }
}
</pre>
<p>Now our data source is ready. The next thing to care of is the web page itself.</p>
<p><a name="webpage"></a></p>
<h2>The web page</h2>
<p>Add the grid by drag dropping the ASPxGridView control in the page. Modify the properties in order to match the following:</p>
<pre class="brush: xml; title: ; wrap-lines: false; notranslate">
&amp;lt;dx:ASPxGridView ID=&amp;quot;gvMaster&amp;quot; runat=&amp;quot;server&amp;quot; AutoGenerateColumns=&amp;quot;False&amp;quot; KeyFieldName=&amp;quot;ID&amp;quot;
    Width=&amp;quot;100%&amp;quot; &amp;gt;
    &amp;lt;Columns&amp;gt;
        &amp;lt;dx:GridViewDataTextColumn FieldName=&amp;quot;ID&amp;quot; VisibleIndex=&amp;quot;0&amp;quot;&amp;gt;
        &amp;lt;/dx:GridViewDataTextColumn&amp;gt;
        &amp;lt;dx:GridViewDataTextColumn FieldName=&amp;quot;UserName&amp;quot; VisibleIndex=&amp;quot;1&amp;quot;&amp;gt;
        &amp;lt;/dx:GridViewDataTextColumn&amp;gt;
        &amp;lt;dx:GridViewDataTextColumn FieldName=&amp;quot;FirstName&amp;quot; VisibleIndex=&amp;quot;2&amp;quot;&amp;gt;
        &amp;lt;/dx:GridViewDataTextColumn&amp;gt;
        &amp;lt;dx:GridViewDataTextColumn FieldName=&amp;quot;LastName&amp;quot; VisibleIndex=&amp;quot;3&amp;quot;&amp;gt;
        &amp;lt;/dx:GridViewDataTextColumn&amp;gt;
        &amp;lt;dx:GridViewDataTextColumn FieldName=&amp;quot;FullName&amp;quot; VisibleIndex=&amp;quot;4&amp;quot;&amp;gt;
        &amp;lt;/dx:GridViewDataTextColumn&amp;gt;
    &amp;lt;/Columns&amp;gt;
&amp;lt;/dx:ASPxGridView&amp;gt;
</pre>
<p>What I did is changing the grids ID to gvMaster, indicating the Key field name by setting the KeyFieldName to “ID” and specifying the columns that will be shown together with mapping a column field name to the desired model property. Now we need to bind the grid and we will do it from the code.<br />
In order to be able to show the changes, we will save our data in a session and in order to ease this operation we will create a property that will perform all of this check and operations for us. Get in the page&#8217;s code file and declare the following.</p>
<pre class="brush: csharp; title: ; wrap-lines: false; notranslate">
public List&amp;lt;User&amp;gt; Users
{
    get
    {
        if (Session[&amp;quot;Data&amp;quot;] == null)
            Session[&amp;quot;Data&amp;quot;] = DataService.GetUsers();

        return (List&amp;lt;User&amp;gt;)Session[&amp;quot;Data&amp;quot;];
    }
    set { Session[&amp;quot;Data&amp;quot;] = value; }
}
</pre>
<p>When the property is requested for the first time, the session item is null, then we will recall the method that we created previously and save the data in the session. This is not a technique that you will use in a real life application, because probably you will recall the data from the database at a certain point and eventually cache it. As explained, this is not the goal of this article, so I will just mention it.<br />
Now it’s time to bind the grid to this property.</p>
<pre class="brush: csharp; title: ; wrap-lines: false; notranslate">
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        gvMaster.DataSource = Users;
        gvMaster.DataBind();
    }
}
</pre>
<p>If you run the code now you should see the following (or a similar screen, don&#8217;t worry if the theme that is applied doesn&#8217;t look the same, we will come to that later).</p>
<p><img class="aligncenter size-full wp-image-193" title="1" src="http://mariomajcica.files.wordpress.com/2012/08/1.png?w=480" alt=""   /></p>
<p><a name="detailgrid"></a></p>
<h2>Defining a detail grid</h2>
<p>In order to add a detail grid to a master grid, we first need to define a template for the detail row. Inside the aspx file get inside the definition of ASPxGridView and open the <code>&lt;Templates&gt;</code> section then inside the newly created section a new one called <code>&lt;DetailRow&gt;</code>. Close properly both sections. In the Detail Row template add a new ASPxGridView and define as for master grid the columns and some properties. Also do not forget to set the <code>ShowDetailRow</code> property to true. At the end your code should look like this.</p>
<pre class="brush: xml; title: ; wrap-lines: false; notranslate">
&amp;lt;SettingsDetail ShowDetailRow=&amp;quot;True&amp;quot; /&amp;gt;
&amp;lt;Templates&amp;gt;
    &amp;lt;DetailRow&amp;gt;
        &amp;lt;dx:ASPxGridView ID=&amp;quot;gvDetail&amp;quot; runat=&amp;quot;server&amp;quot; Width=&amp;quot;100%&amp;quot; KeyFieldName=&amp;quot;ID&amp;quot;&amp;gt;
            &amp;lt;Columns&amp;gt;
                &amp;lt;dx:GridViewDataTextColumn FieldName=&amp;quot;ID&amp;quot; VisibleIndex=&amp;quot;0&amp;quot;&amp;gt;
                &amp;lt;/dx:GridViewDataTextColumn&amp;gt;
                &amp;lt;dx:GridViewDataTextColumn FieldName=&amp;quot;Name&amp;quot; VisibleIndex=&amp;quot;1&amp;quot;&amp;gt;
                &amp;lt;/dx:GridViewDataTextColumn&amp;gt;
                &amp;lt;dx:GridViewDataTextColumn FieldName=&amp;quot;Status&amp;quot; VisibleIndex=&amp;quot;2&amp;quot;&amp;gt;
                &amp;lt;/dx:GridViewDataTextColumn&amp;gt;
            &amp;lt;/Columns&amp;gt;
        &amp;lt;/dx:ASPxGridView&amp;gt;
    &amp;lt;/DetailRow&amp;gt;
&amp;lt;/Templates&amp;gt;
</pre>
<p>Now we need to handle the binding of the detail grid. Before that, we will check for each row in the master grid if there is the data for the detail grid and if not, hide the plus sign. To achieve that, we need to declare the <code>OnDetailRowGetButtonVisibility</code> event on the master grid. The code of your master grid should look like this:</p>
<pre class="brush: xml; title: ; wrap-lines: false; notranslate">
&amp;lt;dx:ASPxGridView ID=&amp;quot;gvMaster&amp;quot; runat=&amp;quot;server&amp;quot; AutoGenerateColumns=&amp;quot;False&amp;quot; KeyFieldName=&amp;quot;ID&amp;quot;
    Width=&amp;quot;100%&amp;quot; OnDetailRowGetButtonVisibility=&amp;quot;gvMaster_DetailRowGetButtonVisibility&amp;quot;&amp;gt;
</pre>
<p>In the server side event code we need to check if there are detail data for each master element.</p>
<pre class="brush: csharp; title: ; wrap-lines: true; notranslate">
protected void gvMaster_DetailRowGetButtonVisibility(object sender, ASPxGridViewDetailRowButtonEventArgs e)
{
    User currentUser = Users.Find(u =&amp;gt; u.ID == (int)gvMaster.GetRowValues(e.VisibleIndex, &amp;quot;ID&amp;quot;));

    if (!currentUser.HasProjects())
        e.ButtonState = GridViewDetailRowButtonState.Hidden;
}
</pre>
<p>For the less experienced, I will quickly explain this code. In order to get the row value we will use the argument that is passed to the event which contains the currently processing row visible index and with that information retrieve the value of the ID field of that row. The following code <code>gvMaster.GetRowValues(e.VisibleIndex, "ID"))</code> will give us the the value of ID filed for the current row. Then we will retrieve the <code>User</code> class instance for a given ID and check if it has a project. In case that this user is not associated to any project we will hide the plus sign (button) for that row with by setting the argument property <code>ButtonState</code> to hidden.<br />
Now let&#8217;s bind detail grid.<br />
Each time the user clicks on the plus sign, a callback will be automatically generated by the grid on the server side, and a binding event for the detail grid will be raised. <code>OnBeforePerformDataSelect</code> event in the detail grid is the right one for indicating the data source on which the current detail grid should be bind. Define the previously mentioned event:</p>
<pre class="brush: xml; title: ; wrap-lines: false; notranslate">
&amp;lt;dx:ASPxGridView ID=&amp;quot;gvDetail&amp;quot; runat=&amp;quot;server&amp;quot; Width=&amp;quot;100%&amp;quot;
    OnBeforePerformDataSelect=&amp;quot;gvDetail_BeforePerformDataSelect&amp;quot; KeyFieldName=&amp;quot;ID&amp;quot;&amp;gt;
</pre>
<p>And bind the data in that event.</p>
<pre class="brush: csharp; title: ; wrap-lines: false; notranslate">
protected void gvDetail_BeforePerformDataSelect(object sender, EventArgs e)
{
    ASPxGridView grid = sender as ASPxGridView;
    int currentUserID = (int)grid.GetMasterRowKeyValue();

    grid.DataSource = Users.Find(u =&amp;gt; u.ID == currentUserID).Projects;
}
</pre>
<p>In order to refer to a proper object we need to cast the sender of the event to a <code>ASPxGridView</code>. Then DevExpress grid comes in our help with <code>GetMasterRowKeyValue()</code> method, which as it&#8217;s name says, will return the key value of the master grid in which our current detail grid is defined. With that value, which is basically the User ID, we can retrieve the necessary data which we will be set as a <code>DataSource</code> of the current detail grid.<br />
That&#8217;s it, your master detail grid should work now and this is how it should look like.</p>
<p><img class="aligncenter size-full wp-image-201" title="2" src="http://mariomajcica.files.wordpress.com/2012/08/2.png?w=480" alt=""   /></p>
<p>If your solution is not looking completely the same do not worry, important is that it compiles and shows the data correctly for now.</p>
<blockquote><p>You can see that I&#8217;m constantly pointing for the detail grid the current fact. This is important, because we can have multiple detail grids in the page, so we always need to refer to a proper object. Always think about that when you are working with detail grid.</p></blockquote>
<p><a name="contextmenu"></a></p>
<h2>Adding a context menu to the detail grid</h2>
<p>This is a bit more complicated task but as you will see a quite simple way to achieve this.<br />
Start with adding a client side event <code>ContextMenu</code> on the detail grid:</p>
<pre class="brush: xml; title: ; wrap-lines: true; notranslate">
&amp;lt;dx:ASPxGridView ID=&amp;quot;gvDetail&amp;quot; runat=&amp;quot;server&amp;quot; Width=&amp;quot;100%&amp;quot; OnBeforePerformDataSelect=&amp;quot;gvDetail_BeforePerformDataSelect&amp;quot;
   KeyFieldName=&amp;quot;ID&amp;quot;&amp;gt;
    &amp;lt;Columns&amp;gt;
        &amp;lt;dx:GridViewDataTextColumn FieldName=&amp;quot;ID&amp;quot; VisibleIndex=&amp;quot;0&amp;quot;&amp;gt;
        &amp;lt;/dx:GridViewDataTextColumn&amp;gt;
        &amp;lt;dx:GridViewDataTextColumn FieldName=&amp;quot;Name&amp;quot; VisibleIndex=&amp;quot;1&amp;quot;&amp;gt;
        &amp;lt;/dx:GridViewDataTextColumn&amp;gt;
        &amp;lt;dx:GridViewDataTextColumn FieldName=&amp;quot;Status&amp;quot; VisibleIndex=&amp;quot;2&amp;quot;&amp;gt;
        &amp;lt;/dx:GridViewDataTextColumn&amp;gt;
    &amp;lt;/Columns&amp;gt;
    &amp;lt;ClientSideEvents ContextMenu=&amp;quot;OnContextMenu&amp;quot; /&amp;gt;
&amp;lt;/dx:ASPxGridView&amp;gt;
</pre>
<p>And then defining a menu with a couple of items in it (just drag and drop PopupMenu control from the toolbox in the page):</p>
<pre class="brush: xml; title: ; wrap-lines: true; notranslate">
&amp;lt;dx:ASPxPopupMenu ID=&amp;quot;detailContextMenu&amp;quot; runat=&amp;quot;server&amp;quot; ClientInstanceName=&amp;quot;detailContextMenu&amp;quot;&amp;gt;
    &amp;lt;Items&amp;gt;
        &amp;lt;dx:MenuItem Name=&amp;quot;cmdResetTest&amp;quot; Text=&amp;quot;Reset Test&amp;quot; ToolTip=&amp;quot;Reset Test to New Status&amp;quot;&amp;gt;
        &amp;lt;/dx:MenuItem&amp;gt;
    &amp;lt;/Items&amp;gt;
&amp;lt;/dx:ASPxPopupMenu&amp;gt;
</pre>
<p>With DevExpress controls we can define client side (JavaScript) events in the aspx page. As on the server side, they will fire behind a certain event. We need to assign a function name that we are planning to execute on client side once the event is fired. Two parameters will be passed to our function, first is the control that generated the event (sender) and the event arguments. Each event and control has it&#8217;s own arguments. DevExpress controls are very function rich on client side, and you can consult the documentation to check all available client side events, functions and properties.</p>
<blockquote><p>In the following <a href="http://documentation.devexpress.com/#AspNet/DevExpressWebASPxGridViewScripts" target="_blank">Reference</a> you can check the available client side functionality for the ASPxGridView. If you are interested in the other controls, just browse the interested control namespace that ends with Script.</p></blockquote>
<p>In the page header (or in a separate .js file) define the following function:</p>
<pre class="brush: jscript; html-script: true; title: ; notranslate">
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
    function OnContextMenu(s, e) {
        if (e.objectType == 'row') {
            detailContextMenu.ShowAtPos(ASPxClientUtils.GetEventX(e.htmlEvent), ASPxClientUtils.GetEventY(e.htmlEvent));
        }
    }
&amp;lt;/script&amp;gt;
</pre>
<p>In this function we will check if the context menu event is raised on a grid header or on the grid row. If it is a grid row we should popup a context menu. We can refer to the control on the client side by the <code>ClientInstanceName</code> that we defined for that control in the aspx file, this is done in this example. Each time you put a DevExpress control in your page, you will automatically have at your disposition an utility class called <code>ASPxClientUtils</code> containing several methods that can help you reducing your js code.</p>
<p>Now each time you right click the detail grid row, a context menu that you defined will be shown. What we are missing is the action that needs to be performed once the user chooses a context menu. In order to achieve this we need to add a client side event to our ASPxPopupMenu.</p>
<pre class="brush: xml; highlight: [6]; title: ; wrap-lines: true; notranslate">
&amp;lt;dx:ASPxPopupMenu ID=&amp;quot;detailContextMenu&amp;quot; runat=&amp;quot;server&amp;quot; ClientInstanceName=&amp;quot;detailContextMenu&amp;quot;&amp;gt;
    &amp;lt;Items&amp;gt;
        &amp;lt;dx:MenuItem Name=&amp;quot;cmdResetTest&amp;quot; Text=&amp;quot;Reset Test&amp;quot; ToolTip=&amp;quot;Reset Test to New Status&amp;quot;&amp;gt;
        &amp;lt;/dx:MenuItem&amp;gt;
    &amp;lt;/Items&amp;gt;
    &amp;lt;ClientSideEvents ItemClick=&amp;quot;detailContextMenu_ItemClick&amp;quot; /&amp;gt;
&amp;lt;/dx:ASPxPopupMenu&amp;gt;
</pre>
<p>There is some more work to do. As we are going to use a callback method of the detail grid to process the action on the server side, we need to find out the right detail grid that needs to be updated. In order to achieve so, we need to modify our previously defined method <code>OnContextMenu</code>.</p>
<pre class="brush: jscript; html-script: true; title: ; notranslate">
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
    var currentDetailGrid;
    var currentVisibleIndex;

    function OnContextMenu(s, e) {
        if (e.objectType == 'row') {
            currentDetailGrid = s;
            currentVisibleIndex = e.index;

            detailContextMenu.ShowAtPos(ASPxClientUtils.GetEventX(e.htmlEvent), ASPxClientUtils.GetEventY(e.htmlEvent));
        }
    }
&amp;lt;/script&amp;gt;
</pre>
<p>What we did here is to save a reference to a detail grid and current visible index (row index on which the mouse was positioned when user right clicked) so we can reused it the Popup <code>ItemClick</code> event that we are going to define:</p>
<pre class="brush: jscript; html-script: true; title: ; notranslate">
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
    function detailContextMenu_ItemClick(s, e) {
        if (e.item.name == 'cmdResetTest') {
            currentDetailGrid.PerformCallback(currentVisibleIndex);
        }
    }
&amp;lt;/script&amp;gt;
</pre>
<p>Once the menu item is chosen we will check if the item is the right one (this is useful if we have several items and we need to perform different actions based on chosen item) then request a callback for the grid on which user is operating right now. We will pass the current visible index as a parameter so we can spot the right element on which we are trying to apply our action. Before we can declare this server side event, we need to specify it in the aspx file:</p>
<pre class="brush: xml; title: ; wrap-lines: true; notranslate">
&amp;lt;dx:ASPxGridView ID=&amp;quot;gvDetail&amp;quot; runat=&amp;quot;server&amp;quot; Width=&amp;quot;100%&amp;quot; OnBeforePerformDataSelect=&amp;quot;gvDetail_BeforePerformDataSelect&amp;quot;
    OnCustomCallback=&amp;quot;gvDetail_CustomCallback&amp;quot; KeyFieldName=&amp;quot;ID&amp;quot;&amp;gt;
</pre>
<p>And than manage this event on the server side:</p>
<pre class="brush: csharp; title: ; wrap-lines: false; notranslate">
protected void gvDetail_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
{
    ASPxGridView grid = sender as ASPxGridView;

    int projectID = (int)grid.GetRowValues(int.Parse(e.Parameters), &amp;quot;ID&amp;quot;);
    int currentUserID = (int)grid.GetMasterRowKeyValue();

    List&amp;lt;Project&amp;gt; projects = Users.Find(u =&amp;gt; u.ID == currentUserID).Projects;
    projects.Find(p =&amp;gt; p.ID == projectID).Status = ProjectStatus.New;

    grid.DataSource = projects;
    grid.DataBind();
}
</pre>
<p>As before, for simplicity we will cast the sender argument to ASPxGridView variable called grid. Then we will retrieve the ID of the project that was selected. The argument we passed before on the client side to the <code>PerformCallback</code> function will come handy right now as it will store the necessary data in order to find the interested project (by parsing the <code>e.Parameters</code> property). Next value we need to get is the user ID for which this detail grid is showing the associated projects. We can get it by a handy server side method <code>GetMasterRowKeyValue()</code> which will return a key value of the master grid (as you rememer we defined as a <code>KeyFieldName</code> the ID property of interested entities). Now, once we have the necessary data we can perform the desired actions and rebind the detail grid.</p>
<p>You can now add different actions in the Popup menu and manage them by passing a qualifier in the argument, parsing the argument and performing different operations. You will see this technique in my next blog post, stay tuned.</p>
<p><a name="disabling"></a></p>
<h2>Programmatically disabling menu items</h2>
<p>Unfortunately in this example the user can choose to reset the status of projects that are not in an invalid state. In order to disable the menu item if the state is not &#8220;resetable&#8221; we will need to make some changes in our code to pass more information to client side.<br />
Before modifying the JavaScript, some considerations. In order to disable an item in the menu, we need to know the condition on which to do it. We can say that the Reset item needs to be disable when the project status is New. This status information we need to pass to the client side somehow. One way to achieve this is to store the status information together with the key value in a custom property. All the DeExpress controls have the possibility to easily add information from server side that will be brought and exposed on client side. This feature is called Custom Properties and you can find more information about them <a href="http://community.devexpress.com/blogs/paulk/archive/2009/04/09/defining-custom-script-properties.aspx" target="_blank">here</a>. My technique is to save the <code>Dictionary</code> element to a custom property which will be seen as an array from JavaScript. All what I&#8217;m saying may sound confusing, so let&#8217;s see an real example.</p>
<p>First of all we will subscribe to <code>OnHtmlRowCreated</code> event. Modify the detail grid in the following way:</p>
<pre class="brush: xml; title: ; wrap-lines: true; notranslate">
&amp;lt;dx:ASPxGridView ID=&amp;quot;gvDetail&amp;quot; runat=&amp;quot;server&amp;quot; Width=&amp;quot;100%&amp;quot; OnBeforePerformDataSelect=&amp;quot;gvDetail_BeforePerformDataSelect&amp;quot;
    OnCustomCallback=&amp;quot;gvDetail_CustomCallback&amp;quot; OnHtmlRowCreated=&amp;quot;gvDetail_HtmlRowCreated&amp;quot; KeyFieldName=&amp;quot;ID&amp;quot;&amp;gt;
</pre>
<p>Then write down the following code:</p>
<pre class="brush: csharp; title: ; wrap-lines: true; notranslate">
protected void gvDetail_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
{
    if (e.RowType != GridViewRowType.Data) return;

    ProjectStatus status = (ProjectStatus)e.GetValue(&amp;quot;Status&amp;quot;);
    ASPxGridView grid = sender as ASPxGridView;

    if (grid.JSProperties.ContainsKey(&amp;quot;cpStatus&amp;quot;))
    {
        Dictionary&amp;lt;int, ProjectStatus&amp;gt; values = (Dictionary&amp;lt;int, ProjectStatus&amp;gt;)grid.JSProperties[&amp;quot;cpStatus&amp;quot;];

        if (values.ContainsKey(e.VisibleIndex))
        {
            values[e.VisibleIndex] = status;
        }
        else
        {
            values.Add(e.VisibleIndex, status);
        }

        grid.JSProperties[&amp;quot;cpStatus&amp;quot;] = values;
    }
    else
    {
        Dictionary&amp;lt;int, ProjectStatus&amp;gt; values = new Dictionary&amp;lt;int, ProjectStatus&amp;gt;();
        values.Add(e.VisibleIndex, status);

        grid.JSProperties.Add(&amp;quot;cpStatus&amp;quot;, values);
    }
}
</pre>
<p>This code can seem complex but it isn&#8217;t. For each row that is going to be rendered I&#8217;m getting it&#8217;s visible index value, checking if I already have that value in my Dictionary type variable. If not, I&#8217;m adding a new item to my Dictionary together with it&#8217;s status. If changed, I&#8217;m persisting the new value to a custom JS property of the grid.<br />
This means now that I can easily retrieve this information on client side. Modify your <code>OnContextMenu</code> function in the following way:</p>
<pre class="brush: jscript; highlight: [4,5]; html-script: true; title: ; notranslate">
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
    function OnContextMenu(s, e) {
        if (e.objectType == 'row') {
            var cmdResetTest = detailContextMenu.GetItemByName('cmdResetTest');
            cmdResetTest.SetEnabled(s.cpStatus[e.index] != 'New');

            currentDetailGrid = s;
            currentVisibleIndex = e.index;

            detailContextMenu.ShowAtPos(ASPxClientUtils.GetEventX(e.htmlEvent), ASPxClientUtils.GetEventY(e.htmlEvent));
        }
    }
&amp;lt;/script&amp;gt;
</pre>
<p>We first need to retrieve the menu item then set the enable property based on custom JS property value.</p>
<p>That&#8217;s all, try your code, it should work.</p>
<p><a name="aesthetic"></a></p>
<h2>Aesthetic changes</h2>
<p>In order to make your solution look like mine, you will also need to set the theme and a couple of other properties that I will explain here.<br />
First of all the theme. DevExpress control ships with a several themes, check the <a href="http://devexpress.com/Products/NET/Controls/ASP/Themes/" target="_blank">following web page</a> for more details on how to deploy a theme to your solution. I applied the Acqua theme by importing the necessary files to my solution and changing the web.config in the following way (if not present add the following code inside the system.web section):</p>
<pre class="brush: xml; title: ; wrap-lines: false; notranslate">
&amp;lt;pages theme=&amp;quot;Aqua&amp;quot;&amp;gt;
&amp;lt;/pages&amp;gt;
</pre>
<p>I also added to both grids the title panel and the title itself:</p>
<pre class="brush: xml; title: ; wrap-lines: false; notranslate">
&amp;lt;Settings ShowTitlePanel=&amp;quot;True&amp;quot; /&amp;gt;
&amp;lt;SettingsText Title=&amp;quot;Master Grid / Detail for detail grid&amp;quot; /&amp;gt;
</pre>
<p>In order to make a clicked row visually different I also enabled the <code>AllowFocusedRow</code> property. As it will set focus only on left mouse click, I also modified my JS <code>OnContextMenu</code> function, so it will get focused also on the right mouse click:</p>
<pre class="brush: jscript; highlight: [4]; html-script: true; title: ; notranslate">
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
    function OnContextMenu(s, e) {
        if (e.objectType == 'row') {
            s.SetFocusedRowIndex(e.index);
            var cmdResetTest = detailContextMenu.GetItemByName('cmdResetTest');
            cmdResetTest.SetEnabled(s.cpStatus[e.index] != 'New');

            currentDetailGrid = s;
            currentVisibleIndex = e.index;

            detailContextMenu.ShowAtPos(ASPxClientUtils.GetEventX(e.htmlEvent), ASPxClientUtils.GetEventY(e.htmlEvent));
        }
    }
&amp;lt;/script&amp;gt;
</pre>
<p>The <code>EnableRowHotTrack</code> was also enabled so the grid displays the hot tracked row (a row located under the mouse pointer). You can read more about all these properties on <a href="http://demos.devexpress.com/ASPxGridViewDemos/Rows/FocusedRow.aspx" target="_blank">DevExpress site</a>.</p>
<p><a name="downloads"></a></p>
<h2>Downloads and the source code</h2>
<p>You can find the source code of my project for download <a href="https://www.box.com/s/ad2b291f2431d1a3d4ec" target="_blank">here</a>.<br />
You can find a trial version of the requested controls <a href="http://www.devexpress.com/Home/Try.xml" target="_blank">here</a>.</p>
<p><a name="notes"></a></p>
<h2>Notes and other resources</h2>
<p>If a specific version of the controls is not available, you can upgrade this project to the latest version of controls. Use DevXperience Project Converter Tool for upgrading the project. Read more on how to use this tool in the following <a href="http://community.devexpress.com/blogs/aspnet/archive/2007/09/10/how-to-easily-convert-your-project-to-a-new-devexpress-release.aspx" target="_blank">blog post</a>.<br />
You can find other examples on Master-Detail functionality on DevExpress site. This is <a href="http://demos.devexpress.com/ASPxGridViewDemos/MasterDetail/MasterDetail.aspx" target="_blank">Master-Detail &#8211; Detail Grid</a> example, and the following is the usage of a tab control inside the <a href="http://demos.devexpress.com/ASPxGridViewDemos/MasterDetail/DetailTabs.aspx" target="_blank">detail row template</a>.<br />
In the DevExpress support site you will find several examples with the source code on different techniques this link will show you the solutions for a <a href="http://www.devexpress.com/Support/Center/Search/List/1?searchString=master%20detail" target="_blank">specific master-detail</a> challenge.</p>
<p>&#8216;Till the next post!</p>
<p>Cheers!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/floresblogs.wordpress.com/833/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/floresblogs.wordpress.com/833/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.flores.nl&#038;blog=32027457&#038;post=833&#038;subd=floresblogs&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogs.flores.nl/2012/08/10/aspxgridview-master-detail-data-presentation-with-context-menus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/db2c49f1b1417ee5322ce388834a4fc3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">floresautomatisering</media:title>
		</media:content>

		<media:content url="http://mariomajcica.files.wordpress.com/2012/07/final.png" medium="image">
			<media:title type="html">final</media:title>
		</media:content>

		<media:content url="http://mariomajcica.files.wordpress.com/2012/08/1.png" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="http://mariomajcica.files.wordpress.com/2012/08/2.png" medium="image">
			<media:title type="html">2</media:title>
		</media:content>
	</item>
		<item>
		<title>Word: ongevraagd een lege tweede pagina</title>
		<link>http://blogs.flores.nl/2012/07/16/word-ongevraagd-een-lege-tweede-pagina/</link>
		<comments>http://blogs.flores.nl/2012/07/16/word-ongevraagd-een-lege-tweede-pagina/#comments</comments>
		<pubDate>Mon, 16 Jul 2012 13:24:24 +0000</pubDate>
		<dc:creator>Toon</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Word]]></category>
		<category><![CDATA[etiketten]]></category>

		<guid isPermaLink="false">http://blogs.flores.nl/?p=603</guid>
		<description><![CDATA[Wanneer Word een extra witte pagina invoegt na de eerste pagina, dan is het vaak lastig om te vinden hoe &#8230;<p><a href="http://blogs.flores.nl/2012/07/16/word-ongevraagd-een-lege-tweede-pagina/">Lees verder &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.flores.nl&#038;blog=32027457&#038;post=603&#038;subd=floresblogs&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Wanneer Word een extra witte pagina invoegt na de eerste pagina, dan is het vaak lastig om te vinden hoe dat komt. Dit gebeurt bijvoorbeeld vaak wanneer via de etikettenfunctie van Word een vel etiketten wordt gegenereerd aan de hand van de maat van etiketten. Echter wanneer nog een beetje gesleuteld wordt aan de etiketten, verplaatst Word de laatste rij etiketten naar de volgende pagina. Verder komt het voor bij andere documenten met een grote tabel<span id="more-603"></span></p>
<p><a href="http://floresblogs.files.wordpress.com/2012/07/labels-footer-issue.png"><img class="size-medium wp-image-824" title="Voettekst vanaf rand" src="http://floresblogs.files.wordpress.com/2012/07/labels-footer-issue.png?w=241&#038;h=300" alt="Pagina-instelling - Indeling - Vanaf rand: Voettekst" width="241" height="300" /></a></p>
<h3>Voettekst</h3>
<p>De eerste oorzaak kan zijn dat er ruimte wordt gemaakt onder een voettekst. Deze ruimte wordt vanaf de onderrand van de pagina ingesteld via Pagina-instelling &#8211; Indeling &#8211; Vanaf rand: Voettekst. Stel deze ruimte in op 0 cm om zo min mogelijk ruimte aan de onderkant van de pagina in te nemen.</p>
<h3>Alinea-instellingen van de tekst na de tabel</h3>
<p>Een tweede oorzaak is dat de tekst na de tabel (een etikettenvel bestaat uit één tabel) te veel ruimte inneemt. Stel deze in op Geen afstand voor en afstand na. Zelfs als er geen tekst na de tabel komt, staat er altijd minimaal één lege alinea na de tabel. Ga met Ctrl-End naar het eind van het document en stel via Alinea-Afstand voor en na in op 0 pt.</p>
<h3>Lettertype-instellingen van de tekst na de tabel</h3>
<p>Helpt dit niet? Stel dan ook de lettergrootte in op 1 pt.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/floresblogs.wordpress.com/603/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/floresblogs.wordpress.com/603/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.flores.nl&#038;blog=32027457&#038;post=603&#038;subd=floresblogs&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogs.flores.nl/2012/07/16/word-ongevraagd-een-lege-tweede-pagina/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/121433191c3f8ee84240282564fd22a3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">florestoon</media:title>
		</media:content>

		<media:content url="http://floresblogs.files.wordpress.com/2012/07/labels-footer-issue.png?w=241" medium="image">
			<media:title type="html">Voettekst vanaf rand</media:title>
		</media:content>
	</item>
		<item>
		<title>Waarden uit SQL server snel samenvoegen</title>
		<link>http://blogs.flores.nl/2012/06/10/waarden-uit-sql-server-snel-samenvoegen/</link>
		<comments>http://blogs.flores.nl/2012/06/10/waarden-uit-sql-server-snel-samenvoegen/#comments</comments>
		<pubDate>Sun, 10 Jun 2012 10:44:51 +0000</pubDate>
		<dc:creator>Victor Heijke</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[COALESCE]]></category>
		<category><![CDATA[STUFF]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://blogs.flores.nl/?p=805</guid>
		<description><![CDATA[Versie SQL Server 2005 en hoger Het gebeurt in een database regelmatig dat waarden moeten worden samengevoegd uit verschillende rijen. &#8230;<p><a href="http://blogs.flores.nl/2012/06/10/waarden-uit-sql-server-snel-samenvoegen/">Lees verder &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.flores.nl&#038;blog=32027457&#038;post=805&#038;subd=floresblogs&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><em>Versie SQL Server 2005 en hoger</em></p>
<p>Het gebeurt in een database regelmatig dat waarden moeten worden samengevoegd uit verschillende rijen. Bijvoorbeeld bij het maken van een kommagescheiden lijst van alle landen in een database. Tot voor kort gebruikte ik daar altijd COALESCE voor. Deze functie retourneert de eerste niet lege waarde van een reeks argumenten en COALESCE kan recursief in een query worden gebruikt als ook de mogelijkheid bestaat om variabelen in te zetten (maar dat is niet altijd mogelijk).<br />
<span id="more-805"></span></p>
<h2>Voorbeeldtabel:</h2>
<p>Ik heb een tabel met alle Europese landen  en een boolean waarde die aangeeft of ze momenteel (mei 2012) lid zijn van de Europese Unie.</p>
<table width="495" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="165"><strong>Land</strong></td>
<td valign="top" width="32"><strong>Lid</strong></td>
</tr>
<tr>
<td valign="top" width="165">België</td>
<td valign="top" width="32">1</td>
</tr>
<tr>
<td valign="top" width="165">Bulgarije</td>
<td valign="top" width="32">1</td>
</tr>
<tr>
<td valign="top" width="165">Cyprus</td>
<td valign="top" width="32">1</td>
</tr>
<tr>
<td valign="top" width="165">Tsjechië</td>
<td valign="top" width="32">1</td>
</tr>
<tr>
<td valign="top" width="165">Zweden</td>
<td valign="top" width="32">1</td>
</tr>
<tr>
<td valign="top" width="165">Verenigd Koninkrijk</td>
<td valign="top" width="32">1</td>
</tr>
<tr>
<td valign="top" width="165">Kroatië</td>
<td valign="top" width="32">0</td>
</tr>
<tr>
<td valign="top" width="165">Albanië</td>
<td valign="top" width="32">0</td>
</tr>
<tr>
<td valign="top" width="165">Andorra</td>
<td valign="top" width="32">0</td>
</tr>
<tr>
<td valign="top" width="165">Macedonië</td>
<td valign="top" width="32">0</td>
</tr>
<tr>
<td valign="top" width="165">IJsland</td>
<td valign="top" width="32">0</td>
</tr>
<tr>
<td valign="top" width="165">Montenegro</td>
<td valign="top" width="32">0</td>
</tr>
<tr>
<td valign="top" width="165">Servië</td>
<td valign="top" width="32">0</td>
</tr>
<tr>
<td valign="top" width="165">Turkije</td>
<td valign="top" width="32">0</td>
</tr>
<tr>
<td valign="top" width="165">&#8230;</td>
<td valign="top" width="32"></td>
</tr>
</tbody>
</table>
<p>Om nu met Coalesce een lijst van alle landen te maken die lid zijn gebruik:</p>
<pre><span style="color:#0000ff;">DECLARE</span> @EuroUnie <span style="color:#0000ff;">NVARCHAR</span>(MAX)<span style="color:#0000ff;">
SELECT </span> @EuroUnie = <span style="color:#ff00ff;">COALESCE</span>(@EuroUnie + ', ', '') + Land<span style="color:#0000ff;">
FROM </span> tblLanden<span style="color:#0000ff;">
WHERE </span> lid = 1<span style="color:#0000ff;">
order by</span>  Land</pre>
<p>De uitkomst is:</p>
<pre>België, Bulgarije, Cyprus, Denemarken, Duitsland, Estland, Finland, 
Frankrijk, Griekenland, Hongarije, Ierland, Italië, Letland, Litouwen, 
Luxemburg, Malta, Nederland, Oostenrijk, Polen, Portugal, Roemenie, 
Slovenië, Slowakije, Tsjechië, Verenigd Koninkrijk, Zweden</pre>
<p>Ooit las ik ergens dat dit ook kan met XML, maar ik heb er eigenlijk nooit echt naar gekeken. Waarom XML inzetten als je geen XML nodig hebt? Tot ik op een dag een query nodig had die geen variabele kon gebruiken. Ik zocht de XML-variant op en tot mijn grote vreugde is die velen malen sneller. 23.000 records samenvoegen in een fractie van de tijd die COALESCE nodig heeft.</p>
<p>De code is wel wat lastiger te lezen, dus hierbij een uitleg stap voor stap.</p>
<p>Eerst de basisquery. Deze heeft weinig uitleg nodig.</p>
<pre><span style="color:#0000ff;">select</span> Land <span style="color:#0000ff;">from</span> tblLanden <span style="color:#0000ff;">where</span> lid=1 <span style="color:#0000ff;">order by</span> Land</pre>
<p>Deze kan in XML worden gevangen door een for xml path toe te voegen</p>
<pre><span style="color:#0000ff;">select</span> Land <span style="color:#0000ff;">from</span> tblLanden <span style="color:#0000ff;">where</span> lid=1 <span style="color:#0000ff;">order by <span style="color:#000000;">Land</span> for xml path(<span style="color:#ff0000;">''</span>)</span></pre>
<p>Doordat ik geen parameters specificeer bij path, zal SQL Server de naam van het veld gebruiken als XML naam:</p>
<pre>&lt;Land&gt;België&lt;/Land&gt;&lt;Land&gt;Bulgarije&lt;/Land&gt;&lt;Land&gt;Cyprus&lt;/Land&gt;
&lt;Land&gt;Denemarken&lt;/Land&gt;&lt;Land&gt;Duitsland&lt;/Land&gt;&lt;Land&gt;Estland&lt;/Land&gt;
&lt;Land&gt;Finland&lt;/Land&gt;&lt;Land&gt;Frankrijk&lt;/Land&gt;&lt;Land&gt;Griekenland&lt;/Land&gt;
&lt;Land&gt;Hongarije&lt;/Land&gt;&lt;Land&gt;Ierland&lt;/Land&gt;&lt;Land&gt;Italië&lt;/Land&gt;
&lt;Land&gt;Letland&lt;/Land&gt;&lt;Land&gt;Litouwen&lt;/Land&gt;&lt;Land&gt;Luxemburg&lt;/Land&gt;
&lt;Land&gt;Malta&lt;/Land&gt;&lt;Land&gt;Nederland&lt;/Land&gt;&lt;Land&gt;Oostenrijk&lt;/Land&gt;
&lt;Land&gt;Polen&lt;/Land&gt;&lt;Land&gt;Portugal&lt;/Land&gt;&lt;Land&gt;Roemenië&lt;/Land&gt;
&lt;Land&gt;Slovenië&lt;/Land&gt;&lt;Land&gt;Slowakije&lt;/Land&gt;&lt;Land&gt;Tsjechië&lt;/Land&gt;
&lt;Land&gt;Verenigd Koninkrijk&lt;/Land&gt;&lt;Land&gt;Zweden&lt;/Land&gt;</pre>
<p>Maar als we het veld nu specifiek naar text() hernoemen, zal SQL server de xml names weglaten.</p>
<pre><span style="color:#0000ff;">select </span> Land <span style="color:#0000ff;">as</span> [text()]  <span style="color:#0000ff;">from</span> tblLanden <span style="color:#0000ff;">where</span> lid=1 <span style="color:#0000ff;">
order by</span> Land <span style="color:#0000ff;">for xml path(<span style="color:#ff0000;">''</span>)</span>

BelgiëBulgarijeCyprusDenemarkenDuitslandEstlandFinlandFrankrijk
GriekenlandHongarijeIerlandItaliëLetlandLitouwenLuxemburgMalta
NederlandOostenrijkPolenPortugalRoemeniëSloveniëSlowakijeTsjechië
Verenigd KoninkrijkZweden</pre>
<p>Even wat spaties en komma’s toevoegen en we zijn er bijna.</p>
<pre><span style="color:#0000ff;">select </span> ', ' + Land <span style="color:#0000ff;">as</span> [text()]  <span style="color:#0000ff;">from</span> tblLanden <span style="color:#0000ff;">where</span> lid=1 
<span style="color:#0000ff;">order by</span> Land <span style="color:#0000ff;">for xml path(<span style="color:#ff0000;">''</span>)</span>

 , België, Bulgarije, Cyprus, Denemarken, Duitsland, Estland, Finland, 
Frankrijk, Griekenland, Hongarije, Ierland, Italië, Letland, Litouwen, 
Luxemburg, Malta, Nederland, Oostenrijk, Polen, Portugal, Roemenië, 
Slovenië, Slowakije, Tsjechië, Verenigd Koninkrijk, Zweden</pre>
<p>De komma die ontstaat voor het eerste land, is niet moeilijk weg te werken. Eerst ga ik een ander issue oplossen. For XML geeft een XML datatype terug in plaats van een platte string. Dit kan opgelost worden met de functie Stuff. Deze functie plaatst een string in een andere string op een bepaalde positie.</p>
<pre><span style="color:#0000ff;">select</span> <span style="color:#ff00ff;">STUFF</span>((<span style="color:#0000ff;">select </span> ', ' + Land <span style="color:#0000ff;">as</span> [text()]  <span style="color:#0000ff;">from</span> tblLanden <span style="color:#0000ff;">
where</span> lid=1 <span style="color:#0000ff;">order by</span> Land <span style="color:#0000ff;">for xml path(<span style="color:#ff0000;">''</span>)</span>),1,1,'')</pre>
<p>Met Stuff kan in het XML-resultaat het eerste karakter (de overtollige komma) worden vervangen met een lege string. Het resultaat is een string.</p>
<p>Deze techniek heeft in mijn database met miljoenen records keer op keer laten zien dat het een stuk sneller is dan COALESCE.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/floresblogs.wordpress.com/805/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/floresblogs.wordpress.com/805/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.flores.nl&#038;blog=32027457&#038;post=805&#038;subd=floresblogs&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogs.flores.nl/2012/06/10/waarden-uit-sql-server-snel-samenvoegen/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/9dbd3fcfd6363b54e50272650fecd113?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">floresnl</media:title>
		</media:content>
	</item>
		<item>
		<title>A good practice for mapping TFS collections on local path</title>
		<link>http://blogs.flores.nl/2012/06/08/a-good-practice-for-mapping-tfs-collections-on-local-path/</link>
		<comments>http://blogs.flores.nl/2012/06/08/a-good-practice-for-mapping-tfs-collections-on-local-path/#comments</comments>
		<pubDate>Fri, 08 Jun 2012 09:00:29 +0000</pubDate>
		<dc:creator>flores automatisering</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[ALM]]></category>
		<category><![CDATA[best practice]]></category>
		<category><![CDATA[collections]]></category>
		<category><![CDATA[local path]]></category>
		<category><![CDATA[mapping]]></category>
		<category><![CDATA[organisation]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[TFS 2010]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://blogs.flores.nl/?p=795</guid>
		<description><![CDATA[How often did you choose the obvious choice that came under your mouse? I did it many times! But the &#8230;<p><a href="http://blogs.flores.nl/2012/06/08/a-good-practice-for-mapping-tfs-collections-on-local-path/">Lees verder &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.flores.nl&#038;blog=32027457&#038;post=795&#038;subd=floresblogs&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>How often did you choose the obvious choice that came under your mouse? I did it many times! But the obvious and easy choice is not always the best. One of this banal situations is mapping a local path for a TFS Collections/Projects. Hands up who went creating a directory on the C drive and indicating a newly created map as TFS local path! Great, I did the same! However later on, based on experience, I found a way of mapping collections which I believe is better practice. In the following lines I will share my ideas with you. Any suggestion or observation is welcome, so feel free to comment this post. <span id="more-795"></span></p>
<p>Why is it not a good idea to just create a folder <em>Projects</em> on a C drive and map everything under it? Well, this PC may be used by others, so this can cause security issues and it can also create confusion and problems if the new user chooses the same directory for mapping.</p>
<p>Based on this information, a good place where to store your code is the user folder. Generally you can find your user folder in <em>C:\Users\%username%</em> on Vista, Windows 7 and 8, <em>C:\Documents and settings\%username%</em> on XP and 2000. What I follow as a rule is to create a top folder called Projects and then inside that folder a sub folder for every collection I have access to. Supposing that my collection is called ACNProject the full path on my PC looks like <em>C:\Users\mario.FLORES\Projects\ACNProject</em>.</p>
<p>However in some cases this can be a problem. If you are using a roaming profile, you will need to do a couple of tweaks. You must exclude this newly create folder from synchronization and in order to be sure about that, you need to check the following registry key: <strong>HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\ExcludeProfileDirs</strong>. You will then find a similar content as on the following image:</p>
<p><img class="aligncenter size-full wp-image-175" title="tfs2" src="http://mariomajcica.files.wordpress.com/2012/06/tfs2.png?w=480" alt="Registry editor ExcludeProileDirs key"   /></p>
<p>Now you need to edit this key by adding at the end the folder name that is situated in Users directory, in this case Projects. Different folders are separated by a semicolon (;). If this became a company rule, you can avoid this step by applying the same changes via a group policy.<br />
In case you do not have the rights for editing the registry and you are still using a roaming profile, a good place where to store the files can be <em>C:\Documents and settings\%username%\AppData\Local</em> which by default is never synced.</p>
<p>Now we are ready to map our collection. Open Visual Studio and Team Explorer.</p>
<p><img src="http://mariomajcica.files.wordpress.com/2012/06/tfs1.png?w=480" alt="Team Explorer mapping the collection in Visual Studio" title="tfs1"   class="aligncenter size-full wp-image-174" /></p>
<p>Click on local path and fill in the above mentioned path. Make sure that you clicked on the collection folder (the $ sign will be visualized as a server folder) and that Recursive check is on. In this way for all the projects in that collection, automatically a folder will be created and mapping will have a recursive effect (all the projects in the collection will be automatically mapped).</p>
<p><img src="http://mariomajcica.files.wordpress.com/2012/06/image003.png?w=480" alt="Mapping the collection in TFS" title="image003"   class="aligncenter size-full wp-image-173" /></p>
<p>Now you will be prompted about getting the latest version of all data from the server, choose No if there are many projects and you need a specific one and then get the latest version of that specific project, otherwise choose yes.</p>
<p>Certainly there can be a case that this approach will not fit, however I consider this a good practice. If you have any suggestions or comments, they are always welcome and I&#8217;m always ready to reconsider this task if anything meaningful pops up.</p>
<p>Cheers!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/floresblogs.wordpress.com/795/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/floresblogs.wordpress.com/795/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogs.flores.nl&#038;blog=32027457&#038;post=795&#038;subd=floresblogs&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogs.flores.nl/2012/06/08/a-good-practice-for-mapping-tfs-collections-on-local-path/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/db2c49f1b1417ee5322ce388834a4fc3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">floresautomatisering</media:title>
		</media:content>

		<media:content url="http://mariomajcica.files.wordpress.com/2012/06/tfs2.png" medium="image">
			<media:title type="html">tfs2</media:title>
		</media:content>

		<media:content url="http://mariomajcica.files.wordpress.com/2012/06/tfs1.png" medium="image">
			<media:title type="html">tfs1</media:title>
		</media:content>

		<media:content url="http://mariomajcica.files.wordpress.com/2012/06/image003.png" medium="image">
			<media:title type="html">image003</media:title>
		</media:content>
	</item>
	</channel>
</rss>
