<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Bob's SQL Reporting Services Blog : Model Design</title><link>http://blogs.msdn.com/bobmeyers/archive/tags/Model+Design/default.aspx</link><description>Tags: Model Design</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Localizing a report model</title><link>http://blogs.msdn.com/bobmeyers/archive/2009/04/27/localizing-a-report-model.aspx</link><pubDate>Tue, 28 Apr 2009 02:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9572398</guid><dc:creator>bobmeyers</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/bobmeyers/comments/9572398.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bobmeyers/commentrss.aspx?PostID=9572398</wfw:commentRss><description>&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;Reports and report models can be localized at many levels. Following are some ideas around the current support in SQL Server 2008 for each type of localization.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;-&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Localized metadata at report design time&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;o&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Example&lt;/B&gt;: Spanish report author sees “Cliente” instead of “Customer” in model explorer&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;o&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Report models do not support multiple languages for metadata names in a single model file&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;o&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;It should not be difficult to build a custom solution to generate localized versions of the model file&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 1.5in; TEXT-INDENT: -0.25in; mso-list: l0 level3 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;§&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Original .smdl file + XML file with localized entity/attribute/role names =&amp;gt; localized .smdl file&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 1.5in; TEXT-INDENT: -0.25in; mso-list: l0 level3 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;§&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Could use either XSLT or minimal code&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;o&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;If implemented, reports would run against any localized version of the model because IDs are unchanged&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;o&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Metadata displayed in the report (such as column labels) would be in the language of the person who designed the report. Since they are merely text values copied in from the model explorer, they would &lt;B style="mso-bidi-font-weight: normal"&gt;not&lt;/B&gt; change at report run time.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;-&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Localized metadata at report run time&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;o&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Example:&lt;/B&gt; Spanish report consumer sees “Cliente” instead of “Customer” in report column label&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;o&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;SQL RS reports do not directly support localization of text labels in a report&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;o&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Some customers have implemented this using a custom “resource” assembly deployed on the server, and all labels in the report are replaced at report design time with expressions that retrieve the appropriate resource string from the custom assembly (&lt;A class="" title=sample href="http://www.codeproject.com/KB/reporting-services/SSRSReportLocalized.aspx" mce_href="http://www.codeproject.com/KB/reporting-services/SSRSReportLocalized.aspx"&gt;sample&lt;/A&gt;&lt;/FONT&gt;&lt;FONT face=Calibri size=3&gt;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;o&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;This is obviously cumbersome to set up at report design time, but it does work&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;-&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Localized data formatting at report run time&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;o&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Example&lt;/B&gt;: Spanish report consumer sees numeric and date values in the report data formatted as “1.234,56” and “27/04/2009” instead of "1,234.56" and "04/27/2009".&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;o&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;This is supported by the default number formats available on the ribbon in Report Builder 2.0. In the dialog box, select the “Use regional formatting” checkbox.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;-&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Localized data values at report run time&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;o&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Example&lt;/B&gt;: Spanish report consumer sees product category “Bicicletas” instead of “Bicycles” in report data&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;o&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;This is typically done by storing localized values in the database as separate columns or as lookup tables based on user culture.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;o&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Offhand I can’t think of a slick way to do this with report models. If you have some ideas, &lt;A class="" title="let me know" href="http://blogs.msdn.com/bobmeyers/contact.aspx" mce_href="http://blogs.msdn.com/bobmeyers/contact.aspx"&gt;let me know&lt;/A&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9572398" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Tricks/default.aspx">Tricks</category><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Model+Design/default.aspx">Model Design</category><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Localization/default.aspx">Localization</category></item><item><title>Considerations for a large report model</title><link>http://blogs.msdn.com/bobmeyers/archive/2009/04/27/considerations-for-a-large-report-model.aspx</link><pubDate>Mon, 27 Apr 2009 23:58:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9572331</guid><dc:creator>bobmeyers</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/bobmeyers/comments/9572331.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bobmeyers/commentrss.aspx?PostID=9572331</wfw:commentRss><description>&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;Customer report models that vary in size from a few to a few hundred entities. Little Northwind with its 10 or so entities comes in around 200K, but we've seen models a hundred times that size (over 20 MB). One of the key drivers of model size is the constraint that you cannot build a query across multiple models, so the tendency is to pull more and more data into the "main" model.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;Given that, I thought I’d share a few tips that may help if you want to build, deploy, and use a large report model.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;1.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Configure the report server allow upload of large files.&lt;/B&gt; By default ASP.NET limits the file upload size to 4 MB. You will need to &lt;/FONT&gt;&lt;/FONT&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/ms159226.aspx"&gt;&lt;FONT face=Calibri size=3&gt;modify this setting&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt; if your model exceeds the limit.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;2.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Consider removing the diagrams from the DSV&lt;/B&gt;. Typically the diagrams in a DSV account for ~20% of the uploaded model size. This information is only used by Model Designer, however, so removing it will not affect either the report server or a client like Report Builder. The DSV editor will not allow you to remove the default “&amp;lt;All Tables&amp;gt;” diagram, and if you do remove it, the editor will recreate it with a default layout the next time you open the file, so you will need to remove this diagram from the XML manually before publishing.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;3.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Define perspectives in the model&lt;/B&gt;. Perspectives allow users to self-select a convenient subset of the model at the time they design the report. This reduces download time (only the subset is retrieved by Report Builder) as well as clutter during the design experience. In extreme cases, you may want to &lt;/FONT&gt;&lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/bobmeyers/archive/2007/02/27/requiring-report-builder-users-to-choose-a-perspective.aspx"&gt;&lt;FONT face=Calibri size=3&gt;require users to choose a perspective&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt;. Note that perspectives are &lt;B style="mso-bidi-font-weight: normal"&gt;not &lt;/B&gt;a security feature. Also note that it is possible, though not particularly easy, to change the perspective used in a query after the query has been created.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;4.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Use model item security&lt;/B&gt;. This reduces the subset of the model available to specific users and groups, which in turn reduces the download time and visual clutter for those users. Note that&amp;nbsp;as of&amp;nbsp;SQL 2008&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/ms156307.aspx"&gt;&lt;FONT face=Calibri size=3&gt;report subscriptions are not supported&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt; when using model item security.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNoSpacing style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;If you are using a large report model and have additional tips or questions, please &lt;A class="" title="contact me" href="http://blogs.msdn.com/bobmeyers/contact.aspx" mce_href="http://blogs.msdn.com/bobmeyers/contact.aspx"&gt;contact me&lt;/A&gt;. We'd love to get your feedback.&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9572331" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Model+Design/default.aspx">Model Design</category><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Configuration/default.aspx">Configuration</category><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Admin/default.aspx">Admin</category><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Model+Security/default.aspx">Model Security</category></item><item><title>A better way to model inheritance</title><link>http://blogs.msdn.com/bobmeyers/archive/2009/03/05/expandinline-property-vs-entity-inheritance.aspx</link><pubDate>Thu, 05 Mar 2009 18:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9359010</guid><dc:creator>bobmeyers</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/bobmeyers/comments/9359010.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bobmeyers/commentrss.aspx?PostID=9359010</wfw:commentRss><description>&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;I've been playing around with a report model we use internally here in the SQL Server product group. At a conceptual level, the data being modeled makes heavy use of inheritance (EntityA "is a" EntityB), but in working with the model and with Report Builder, I'm finding some significant advantages to using the &lt;A title=Role.ExpandInline href="http://msdn.microsoft.com/en-us/library/ms157259.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms157259.aspx"&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;Role.ExpandInline&lt;/SPAN&gt;&lt;/A&gt; property instead of the &lt;A title=Entity.Inheritance href="http://msdn.microsoft.com/en-us/library/ms160327.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms160327.aspx"&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;Entity.Inheritance&lt;/SPAN&gt;&lt;/A&gt; property. As I described in an &lt;A href="http://blogs.msdn.com/bobmeyers/archive/2006/01/19/515158.aspx" mce_href="http://blogs.msdn.com/bobmeyers/archive/2006/01/19/515158.aspx"&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;earlier post&lt;/SPAN&gt;&lt;/A&gt;, both are options for denormalizing or "flattening" the underlying schema.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: Arial"&gt;How to do it&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;Using the Role.ExpandInline property to model inheritance is just as easy&amp;nbsp;as, if not easier than, using the Entity.Inheritance property. Remember that when a relationship is defined in the DSV between the parent entity and the child or derived entity, a pair of roles are generated in the model initially and bound to that relationship. &lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;When using Entity.Inheritance to model inheritance, you need to:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;Delete the generated roles&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;Set the Inheritance property on the child entity to point to the parent entity&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;Set the Inheritance binding&amp;nbsp;property to the relationship defined in the DSV&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;When using Role.ExpandInline to model inheritance, all you need to do is:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;On the child-&amp;gt;parent role, set ExpandInline=true.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;On the parent-&amp;gt;child role, rename the role "As &amp;lt;child entity name&amp;gt;".&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;Also, make sure the child-&amp;gt;parent role has Cardinality=One, and the parent-&amp;gt;child role has Cardinality=OptionalOne. These should be true regardless of whether you choose to expand the role inline.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: Arial"&gt;Advantages of using Role.ExpandInline&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;Beyond the initial convenience in expressing an inheritance relationship using Role.ExpandInline, there are several more substantial advantages I see to modeling the concept this way:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt; mso-bidi-font-family: Arial"&gt;1. You can choose where the ancestor entities' fields appear in the field list of the current entity. &lt;/SPAN&gt;&lt;/B&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;When using Entity.Inheritance, all ancestor fields are automatically inserted at the top of the field list of the child entity. The main problem with this is that the auto-generated Count field for the derived entity is no longer at the top of the list where users expect it to be. Instead, they will see the Count field for the most distant ancestor first, with the Count fields for the intervening entities and finally the current entity scattered further down the field list. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;When using Role.ExpandInline, you can move the role that represents the inheritance to at any position in the field list of the current entity (even a sub-folder if that makes sense), and the ancestor entities’ fields will be inserted there.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;Example:&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt; Suppose we have a Person entity whose field list starts with #Persons (typical). Suppose we also have an Employee entity that inherits from Person. Ideally, the Employee field list will be displayed as #Employees, followed by Person fields, and finally other Employee fields. When using Entity.Inheritance, this is not supported. When using Role.ExpandInline, this is easy – simply move the Employee-&amp;gt;Person role immediately below the #Employees attribute in the Employee entity field list, and the Person fields will be “expanded inline” there.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt; mso-bidi-font-family: Arial"&gt;2. You have fine-grained control over which of the parent entity's fields are visible in the current entity. &lt;/SPAN&gt;&lt;/B&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;When there is more than one derived entity, it is common for many fields on the parent entity to be relevant to only some of the child entities. If&amp;nbsp;Entity.Inheritiance is used, there is no way to prevent all parent entity fields from being shown all the time. This can be confusing in the cases where they are irrelevant. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;When using Role.ExpandInline, you can use the HiddenFields collection on the role that represents the inheritance to control exactly which fields from the parent entity will be visible in the child entity.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;Example:&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt; Suppose the Person entity mentioned above has three derived entities: Employee, CustomerContact, and VendorContact. It also contains (among other things) a #Persons field and a LastContacted field. The former is relevant to all Persons, but only when they are being treated as Persons. When treated as a derived entity, the derived entity Count field should be used instead. Also, suppose the LastContacted field is present on Person because it is common to CustomerContact and VendorContact, but it is not relevant to Employee. Ideally, the #Persons and LastContacted fields would be omitted in the Employee field list, while only the #Persons field would be omitted from the CustomerContact and VendorContact field lists. When using Entity.Inheritance, this is not supported. When using Role.ExpandInline, this is easy – just use the Role.HiddenField collection in each child entity to define exactly which parent entity fields are hidden in that context.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt; mso-bidi-font-family: Arial"&gt;3. You have fine-grained control over which non-direct ancestor entities related by inheritance (“uncles”) are accessible from the current entity.&lt;/SPAN&gt;&lt;/B&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;When using Entity.Inheritance, you can use the Entity.DisjointInheritance property to control whether the special “As &amp;lt;entity-name&amp;gt;” pseudo-roles are displayed for treating instances of the current entity as instances of a non-direct ancestor entity related by inheritance. However, this is an all-or-nothing option. If DisjointInheritance is false, all non-direct ancestor entities related by inheritance are displayed in all child entity contexts; if true, none of them are displayed in any child entity context. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;When using Role.ExpandInline, you can use the Role.HiddenFields collections to define exactly which inheritance roles from the parent entity are hidden in for each child entity context.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;Example&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;: Suppose that by company policy, Employees were allowed to be customers, but not vendors. On the other hand, it was perfectly fine for non-employee vendors to also be customers. Because of these constraints, it would make sense to display an “As CustomerContact” role in the Employee context, but not “As VendorContact”. In contast, we &lt;I style="mso-bidi-font-style: normal"&gt;would&lt;/I&gt; want to display an “As CustomerContact” role in the VendorContact context. When using Entity.Inheritance, this is not supported. When using Role.ExpandInline, this is easy – just use the Role.HiddenFields collections in each child entity to define exactly which inheritance roles from the parent entity make sense in that context.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt; mso-bidi-font-family: Arial"&gt;4. You can prevent the fields of all descendant entities from being added to the field list for the current entity.&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;When using Entity.Inheritance, the fields from all descendant entities are always inserted at the bottom of the field list of the current entity. Even with only a small number of derived entities, the field list can quickly become quite long and confusing, since there is no clear indicator which fields are associated with which derived entity. The list may even contain multiple fields with the same name (but different meanings), which would be especially confusing. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;When using Role.ExpandInline (on the role from the child entity to the parent entity), the reverse role from the parent entity to the child entity is just a role by default, so none of the fields for the child entity appear in the parent entity context. For clarity, you can rename the reverse role “As &amp;lt;entity-name&amp;gt;”, similar to the pseudo-roles metioned earlier.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;Example&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;: Continuing the examples above, the Person-&amp;gt;Employee role should be renamed “As Employee”, the Person-&amp;gt;CustomerContact role should be renamed “As CustomerContact”, and the Person-&amp;gt;VendorContact role should be renamed “As VendorContact”.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 11.0pt; mso-bidi-font-family: Arial"&gt;5. You can inherit from more than one entity.&lt;/SPAN&gt;&lt;/B&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;When using Entity.Inheritance, you can specify at most one parent entity related by inheritance. This is often not an important limitation, but occasionally the data really demands that an entity inherit from more than one parent entity, because it just makes a lot more sense to present it to the user that way.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;When using Role.ExpandInline, there is (obviously) no constraint on how many roles can be expanded. Inherit from as many entities as you want.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;Example&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;: Suppose the Employee entity inherits from both Person and ProjectResource. When using Entity.Inheritance, this is not supported. When using Role.ExpandInline, this is easy – just expand both roles.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;6. You can change your mind later about which relationships to model as inheritance.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;When using Entity.Inheritance, the queries generated against your model contain no explicit navigation between entities related by inheritance. This means that adding or removing inheritance later can break existing queries. Now, technically, adding inheritance later will not break queries if you keep around the old role that the inheritance replaced (hidden of course to avoid confusion). But there is no workaround for the opposite situation – if you want to remove inheritance later, you can certainly add a new role to represent the relationship, but if you keep around the inheritance as well to avoid breaking existing queries, there is no way to hide it, and the resulting behavior will be very confusing to users.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;When using Role.ExpandInline, you can change your mind at any time. The queries will be the same whether you choose to expand the role or not, so modeling a relationship as inheritance (or not) will have no impact on either new or existing queries.&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: Arial"&gt;Disadvantages of using Role.ExpandInline&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;At this point, I can only think of one disadvantage to using Role.ExpandInline to model inheritance.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;1. Users will not have the “Is A” operator available in the filter dialog.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;When using Entity.Inheritance, a special “Is A” filter operator is available in the filter dialog when filtering on entities that participate in inheritance relationships. This operator allows you to test whether a particular instance of one entity maps to an instance of another entity related somehow by inheritance. Direct ancestors are not included in the list of options, as it is assume answer is always “true” in those cases. However, descendents and non-direct ancestors (uncles, cousins, etc.) are listed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;When using Role.ExpandInline, this operator is not available. Instead, the user would need to add the related entity and check if it is “empty” (or null).&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;Example&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;: Suppose the user wants to create a filter condition that tests whether a particular Person is also a VendorContact. When using Entity.Inheritance, the user could use the “Is A” filter condition operator to do so. When using Role.ExpandInline, the “Is A” operator would not be displayed. The user would have to drag in the “As Vendor Contact” role instead, and check if it is empty (or null).&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Arial"&gt;Conclusion&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial"&gt;As you can see, there seems to be a clear winner here. So much so, that we are considering deprecating the current Entity.Inheritance construct in a future release, and creating a new construct that explicitly models inheritance similar to the ExpandInline approach. When/if we do this, we would presumably also remove the one current disadvantage associated with it by adding explicit support for it in the filter dialog.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 6pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 9pt; mso-bidi-font-size: 11.0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9359010" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Schema/default.aspx">Schema</category><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Model+Design/default.aspx">Model Design</category></item><item><title>Creating a role to one of several related items</title><link>http://blogs.msdn.com/bobmeyers/archive/2006/12/20/creating-a-role-to-one-of-several-related-items.aspx</link><pubDate>Thu, 21 Dec 2006 03:43:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1336411</guid><dc:creator>bobmeyers</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/bobmeyers/comments/1336411.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bobmeyers/commentrss.aspx?PostID=1336411</wfw:commentRss><description>&lt;P&gt;I call this the Primary Address problem, because a classic example is when you have a Customer table and an Address table, and each customer can have many addresses (Primary, Billing, Shipping, etc.), but no more than one of any given type. If you have a FK constraint defined, the report model wizard will automatically detect the 1:* relationship and create an OptionalMany role from Customer -&amp;gt; Address (and an OptionalOne role coming back). However, this still doesn't make it easy to create a report showing Customers and their Primary Address information. What you really want is a separate 1:1 relationship for each type of address, so you can pull in address information without making Address the primary entity of your report.&lt;/P&gt;
&lt;P&gt;The best way to do this I know of is like so:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;STRONG&gt;Add calculated fields &lt;/STRONG&gt;in the DSV to the Customer table for each type of address, called "xxxAddressType". Each calculation should be a constant (e.g. 'PRI', or whatever the values in your AddressType field are).&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Define a unique constraint &lt;/STRONG&gt;on the Address table by opening the DSV in code view (XML). Find the primary key constraint for the Address table, insert a copy immediately after it, set msdata:PrimaryKey="false" on the new one and add xs:field elements for the CustomerID and AddressType fields. You have to do this in code view because you can't define non-PK unique constraints in the DSV editor.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Create relationships &lt;/STRONG&gt;in the DSV (using the editor again) from Customer to Address that join CustomerID=CustomerID and xxxAddressType=AddressType.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Create roles&lt;/STRONG&gt; in the report model from the Customer entity to the Address entity. Bind the roles to the new relationships you just defined in step 3.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;[UPDATE] For reference, here's an example of defining a unique constraint (step 2). In the DSV, find the primary key constaint on the same table, which should look something like this:&lt;/P&gt;&lt;FONT color=#0000ff&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515&gt;xs:unique&lt;/FONT&gt;&lt;FONT color=#0000ff&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000&gt;name&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;=&lt;/FONT&gt;&lt;FONT size=+0&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;Address_Constraint1&lt;/FONT&gt;&lt;FONT size=+0&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000&gt;msdata:ConstraintName&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;=&lt;/FONT&gt;&lt;FONT size=+0&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;Constraint1&lt;/FONT&gt;&lt;FONT size=+0&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000&gt;msdata:PrimaryKey&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;=&lt;/FONT&gt;&lt;FONT"&lt; FONT&gt;&lt;FONT color=#0000ff&gt;true&lt;/FONT&gt;&lt;FONT size=+0&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515&gt;xs:selector&lt;/FONT&gt;&lt;FONT color=#0000ff&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000&gt;xpath&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;=&lt;/FONT&gt;&lt;FONT size=+0&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;.//Address&lt;/FONT&gt;&lt;FONT size=+0&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff&gt; /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515&gt;xs:field&lt;/FONT&gt;&lt;FONT color=#0000ff&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000&gt;xpath&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;=&lt;/FONT&gt;&lt;FONT size=+0&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;AddressID&lt;/FONT&gt;&lt;FONT size=+0&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff&gt; /&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515&gt;xs:unique&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;&lt;FONT color=#000000&gt;Then make a copy, and modify it like this:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;xs:unique&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;name&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;Address_Constraint&lt;SPAN style="BACKGROUND: yellow"&gt;2&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;msdata:ConstraintName&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;Constraint&lt;SPAN style="BACKGROUND: yellow"&gt;2&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;msdata:PrimaryKey&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;"&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND: yellow; COLOR: blue"&gt;false&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;xs:selector&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;xpath&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;.//Address&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="BACKGROUND: yellow"&gt;&amp;lt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND: yellow; COLOR: #a31515"&gt;xs:field&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND: yellow; COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="BACKGROUND: yellow; COLOR: red"&gt;xpath&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND: yellow; COLOR: blue"&gt;=&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND: yellow; COLOR: black"&gt;"&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND: yellow; COLOR: blue"&gt;CustomerID&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND: yellow; COLOR: black"&gt;"&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND: yellow; COLOR: blue"&gt; /&amp;gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="BACKGROUND: yellow"&gt;&amp;lt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND: yellow; COLOR: #a31515"&gt;xs:field&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND: yellow; COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="BACKGROUND: yellow; COLOR: red"&gt;xpath&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND: yellow; COLOR: blue"&gt;=&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND: yellow; COLOR: black"&gt;"&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND: yellow; COLOR: blue"&gt;AddressType&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND: yellow; COLOR: black"&gt;"&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND: yellow; COLOR: blue"&gt; /&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;BR&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;xs:unique&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1336411" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Schema/default.aspx">Schema</category><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Model+Design/default.aspx">Model Design</category></item><item><title>Evolving your report model over time</title><link>http://blogs.msdn.com/bobmeyers/archive/2006/09/28/evolving-your-report-model-over-time.aspx</link><pubDate>Thu, 28 Sep 2006 21:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:775845</guid><dc:creator>bobmeyers</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/bobmeyers/comments/775845.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bobmeyers/commentrss.aspx?PostID=775845</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana color=#000000 size=2&gt;Many factors combine to make report models highly likely to change and evolve over time. Sometimes the underlying schema changes. Sometimes new stuff is added. Sometimes you just want to improve how the schema is presented to users. Report models are designed to accommodate just these kinds of changes.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#000000&gt;One of my &lt;A href="http://blogs.msdn.com/bobmeyers/archive/2006/01/19/515158.aspx"&gt;earlier posts&lt;/A&gt; mentions several changes you can make to your models without breaking reports, as well as one that will break reports. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#000000&gt;Generally speaking, though, I believe you can &lt;STRONG&gt;change anything except the following &lt;/STRONG&gt;in a report model, and existing reports will still run:&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Verdana color=#000000&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#000000&gt;Entities: ID and Inheritance properties&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#000000&gt;Attributes:.ID, DataType, and IsAggregate properties, and entity membership&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#000000&gt;Roles: ID and Cardinality properties, entity membership, related role and its cardinality and entity membership.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Verdana color=#000000&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#000000&gt;Note that if you change attribute expressions, entity/attribute/role bindings, or the definitions of tables and columns in the DSV (e.g. by modifying a Named Query), you may get different results, but the reports will still run.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#000000&gt;&lt;o:p&gt;Obviously, you can organize and re-organize things in and out of folders as often as you want, and all your existing reports will still load and run just fine.&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#000000&gt;&lt;o:p&gt;Also, if you want to "deprecate" a field, you can use the Hidden property to exclude it from the design-time experience in Report Builder. This will not&amp;nbsp;affect existing reports.&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=775845" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Schema/default.aspx">Schema</category><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Model+Design/default.aspx">Model Design</category></item><item><title>Creating a report model that can be used against multiple databases</title><link>http://blogs.msdn.com/bobmeyers/archive/2006/09/28/creating-a-report-model-that-can-be-used-against-multiple-databases.aspx</link><pubDate>Thu, 28 Sep 2006 21:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:775833</guid><dc:creator>bobmeyers</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/bobmeyers/comments/775833.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bobmeyers/commentrss.aspx?PostID=775833</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Sometimes it is useful to create a report model that can be used against multiple databases that have the same structure, but reside on different servers and/or have different schema qualifiers.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Uploading a second copy of a report model and pointing it at a different database is certainly easy enough, but you can run into issues if the second database has different schema qualifiers. The problem is that, by default, the Data Source View wizard creates a DSV that &lt;EM&gt;includes &lt;/EM&gt;schema qualifiers in the bindings. If those qualifiers are not necessary (i.e. the bindings&amp;nbsp;can be fully resolved if a default database is specified in your data source connection string), you can make your report model work for the second database by opening the .dsv file in a text editor and use Find/Replace to simply remove all the schema qualifiers.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Test it out against the old and new databases, and you should be good to go.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=775833" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Tricks/default.aspx">Tricks</category><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Model+Design/default.aspx">Model Design</category></item><item><title>How to create a 'company' security filter for a hosted application</title><link>http://blogs.msdn.com/bobmeyers/archive/2006/03/24/how-to-create-a-quot-company-quot-security-filter-for-a-hosted-application.aspx</link><pubDate>Sat, 25 Mar 2006 04:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:560200</guid><dc:creator>bobmeyers</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/bobmeyers/comments/560200.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bobmeyers/commentrss.aspx?PostID=560200</wfw:commentRss><description>&lt;P&gt;&lt;FONT size=2 face=Arial&gt;Several customers have asked how to restrict data visibility in a report model for a hosted application, where every table has a "CompanyID" column, and every user that accesses the system is associated (via some other table) with exactly one company. The straightforward solution is to &lt;A href="http://blogs.msdn.com/bobmeyers/articles/Implementing_Data_Security_in_a_Report_Model.aspx" mce_href="http://blogs.msdn.com/bobmeyers/articles/Implementing_Data_Security_in_a_Report_Model.aspx"&gt;create a security filter&lt;/A&gt;&amp;nbsp;on each corresponding entity; the filter should check whether any rows exist in the user table entity where Users.CompanyID=This.CompanyID and UserTable.UserID=GETUSERID(). This will work, but the SQL that is generated for this filter may not be optimal.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2 face=Arial&gt;&lt;STRIKE&gt;An alternative is to modify the DSV for the report model such that each table containing a CompanyID is really a named query of the form:&lt;/STRIKE&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2 face=Arial&gt;&lt;STRIKE&gt;SELECT t.*, u.UserID FROM MyTable t, UserTable u WHERE t.CompanyID = u.CompanyID&lt;/STRIKE&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2 face=Arial&gt;&lt;STRIKE&gt;Note that this derived table contains &lt;EM&gt;n &lt;/EM&gt;rows for each row in MyTable, where &lt;EM&gt;n &lt;/EM&gt;is the number of users associated with that row's company. To effectively fool the model, you will need to lie in the DSV and claim that the primary key of your derived table is composed of &lt;EM&gt;only &lt;/EM&gt;the key columns for MyTable.&lt;/STRIKE&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2 face=Arial&gt;&lt;STRIKE&gt;You must then create a security filter on the corresponding model entity for MyTable, which simply states UserID = GETUSERID(). If you create any other security filters for that entity, they MUST contain the same filter condition, in addition to any other conditions. No user should be given access to all the rows of that entity.&lt;/STRIKE&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2 face=Arial&gt;&lt;STRIKE&gt;This approach, while a bit of a hack, should result in much better SQL at runtime. &lt;/STRIKE&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2 face=Arial&gt;&lt;STRIKE&gt;Credits to my illustrious colleague &lt;/STRIKE&gt;&lt;A href="http://blogs.msdn.com/chrishays/" mce_href="http://blogs.msdn.com/chrishays/"&gt;&lt;STRIKE&gt;Chris Hays&lt;/STRIKE&gt;&lt;/A&gt;&lt;STRIKE&gt; for coming up with this.&lt;/STRIKE&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;UPDATE&lt;/STRONG&gt;: The alternative proposed above does not work correctly in all cases because of an optimization we do in the SQL translation layer. Best practice is to stick with the "straightforward solution" described at the beginning of the post.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=560200" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Tricks/default.aspx">Tricks</category><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Schema/default.aspx">Schema</category><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Model+Design/default.aspx">Model Design</category><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Model+Security/default.aspx">Model Security</category></item><item><title>Collapsing a many-to-many relationship in a report model</title><link>http://blogs.msdn.com/bobmeyers/archive/2006/03/24/collapsing-a-many-to-many-relationship-in-a-report-model.aspx</link><pubDate>Fri, 24 Mar 2006 21:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:560255</guid><dc:creator>bobmeyers</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/bobmeyers/comments/560255.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bobmeyers/commentrss.aspx?PostID=560255</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;Often a many-to-many relationship exists between two entities where the intermediate entity has nothing on it except the connecting roles. For example, it might be that an Employee can be assigned to many Regions, and each Region can have many Employees assigned to it, but&amp;nbsp;there&amp;nbsp;is nothing interesting about an Employee Region (the intermediate entity).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;In such cases, you can effectively hide the intermediate entity from your users by doing something like the following, where the three entities involved are A -&amp;lt; B &amp;gt;- C:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;1. Rename the role from&amp;nbsp;A to&amp;nbsp;B as "Cs"&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;2. Rename the role from C to B as "As"&lt;BR&gt;3. Set ExpandInline=True on the role from B to C&lt;BR&gt;4. Set ExpandInline=True on the role from B to A&lt;BR&gt;5. Add the role from B to A to the HiddenFields collection of the role from A to B&lt;BR&gt;6. Add the role from B to C to the HiddenFields collection of the role from C to B&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;BR&gt;7. Set Hidden=True on entity B&lt;BR&gt;8. Set Hidden=True &lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;the # Bs attribute (or just delete it)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Once you've done this, entity B is effectively hidden from the user.&amp;nbsp;The only exception will be in the Formula dialog, where if the user displays the expanded formula for a field related via this path, the individual roles from A to B and B to C will be displayed. Other than that, as far as&amp;nbsp;a Report Builder user can tell entity B does not exist.&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=560255" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Tricks/default.aspx">Tricks</category><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Schema/default.aspx">Schema</category><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Model+Design/default.aspx">Model Design</category></item><item><title>Report model denormalization: Why, How, and When</title><link>http://blogs.msdn.com/bobmeyers/archive/2006/01/19/report-model-denormalization-why-how-and-when.aspx</link><pubDate>Fri, 20 Jan 2006 02:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:515158</guid><dc:creator>bobmeyers</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/bobmeyers/comments/515158.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bobmeyers/commentrss.aspx?PostID=515158</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;Relational databases are often heavily normalized to improve performance, reduce storage requirements, and ensure data consistency. While performance may be relevant to report execution, neither of these reasons is relevant when presenting the schema to an end-user at design time. Hence denormalization is often a major feature of a well-designed SQL Server 2005 report model.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;There are three ways of denormalizing the database schema in a report model to provide more intuitive experience for your end users. They are: entity inheritance, role expansion, and lookup entities.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;STRONG&gt;Entity Inheritance&lt;BR&gt;&lt;/STRONG&gt;This type of denormalization should be used when one entity "is" another entity. For example, a Sales&amp;nbsp;Person "is" an Employee, so users would like to see all the attributes and roles of an Employee whenever they navigate to Sales Person. It is also true at report design-time that any&amp;nbsp;given Employee may also be a Sales Person, so the user may also want to see all attributes and roles of Sales Person whenever they navigate to Employee, just in case. &lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;In this release, Report Builder will always show the attributes and roles of all entities that are either direct ancestors of the current entity or direct descendents. Uncles, aunts, cousins, etc. are displayed only in the Advanced Explorer mode as special related nodes in the "Entities"&amp;nbsp;panel of the explorer.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Entity inheritance is specified by setting the &lt;A href="http://msdn2.microsoft.com/en-us/library/ms157157(en-US,SQL.90).aspx"&gt;Inheritance&lt;/A&gt; property on a derived entity to point to its "parent" entity, and specifying the foreign key constraint in the underlying DSV that can be used to match up a derived instance with the correct instance of the parent. Note that model generation will initially create a Role to represent this relationship, and if you choose to use inheritance, you should delete the auto-generated role. &lt;A href="http://msdn2.microsoft.com/en-us/library/ms345339(en-US,SQL.90).aspx"&gt;More information on entity inheritance.&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Specifying inheritance where none was specified previously will not break existing reports; doing the opposite will. Obviously, deleting the role that inheritance is meant to replace will also break existing reports. If this is an issue, consider hiding the deprecated role so it will cease to be displayed, but continue to function for existing reports.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;STRONG&gt;Role Expansion&lt;BR&gt;&lt;/STRONG&gt;This type of denormalization should be used when an entity contains information that is really considered part of a related entity, but for purely storage-related reasons has been moved into a separate table. Two examples are sparse satellite tables (e.g. AdditionalCustomerInfo) and shared schema tables (e.g. ContactInfo or AddressInfo). In both cases, the table doesn't represent a separate "thing" in the user's mind. It's just a bunch of extra attributes. When Report Builder encounters a role on the current entity that is marked for inline expansion, it displays all attributes and roles of the related entity as if they were attributes and roles of the current entity.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Role expansion is specified by setting the &lt;A href="http://msdn2.microsoft.com/en-us/library/ms157259(en-US,SQL.90).aspx"&gt;ExpandInline&lt;/A&gt; property on a role to True. Note that for shared schema tables (e.g. ContactInfo), you should also use the HiddenFields property on the role to hide the roles to other entities that use the same schema.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Changing the value of the ExpandInline property will not break existing reports and thus may be done at any time.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;STRONG&gt;Lookup Entities&lt;BR&gt;&lt;/STRONG&gt;This type of denormalization should be used when an entity corresponds to a "lookup" table, i.e. one that exists only to define a set of valid values for some column on another entity or entities. Classic examples of lookup tables are Country, Status, Category, etc. Note that lookups often come in a series (e.g. Subcategory-&amp;gt;Category), often referred to as a hierarchy. When Report Builder encounters a role whose related entity is a lookup entity, it displays the identifying attribute of that entity as if it were an attribute on the current entity. If any roles on the lookup entity are marked for lookup promotion, and &lt;EM&gt;their &lt;/EM&gt;related entities are also lookup entities, their identifying attributes are "promoted" up to the current entity as well.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;A lookup entity is specified by setting the &lt;A href="http://msdn2.microsoft.com/en-us/library/ms160327(en-US,SQL.90).aspx"&gt;IsLookup&lt;/A&gt; property on an entity to True. For a hierarchy or series of lookup entities, set this property to True on all of the lookup entities, and set the PromoteLookup property on the intervening roles to True as well. You may also want to set the ContextualName property to Merge or Role on the identifying attribute of a lookup entity, if the attribute has a generic name like "Name". &lt;A href="http://msdn2.microsoft.com/en-us/library/ms345302(en-US,SQL.90).aspx"&gt;More information on lookup entities.&lt;/A&gt;&amp;nbsp;Also, if you have a column in your database that does &lt;EM&gt;not &lt;/EM&gt;have a lookup table, but you still want users to be able to choose values from a list, set the &lt;A href="http://msdn2.microsoft.com/en-us/library/ms160347(en-US,SQL.90).aspx"&gt;ValueSelection&lt;/A&gt; property to Dropdown or List on the corresponding attribute in the model.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Changing the value of the IsLookup, PromoteLookup, ContextualName, or ValueSelection&amp;nbsp;properties will not break existing reports and thus may be done at any time.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;These three methods should allow you to create a very natural and intuitive report model navigation experience for your end users.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=515158" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Schema/default.aspx">Schema</category><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Model+Design/default.aspx">Model Design</category></item><item><title>What to do with IdentifyingAttributes and DefaultDetailAttributes?</title><link>http://blogs.msdn.com/bobmeyers/archive/2005/10/25/what-to-do-with-identifyingattributes-and-defaultdetailattributes.aspx</link><pubDate>Wed, 26 Oct 2005 00:19:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:484895</guid><dc:creator>bobmeyers</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/bobmeyers/comments/484895.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bobmeyers/commentrss.aspx?PostID=484895</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;SQL 2005 report models will ship with a curious and admittedly incomplete solution for handling "the information users typically want to see about an instance of entity X". The problem is that there are many scenarios for which the answer to that question differs:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;STRONG&gt;Scenarios&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;1. &lt;EM&gt;Dropdown &lt;/EM&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;EM&gt;selection &lt;/EM&gt;(applies to entities with a relatively small number of instances):&amp;nbsp;The cramped interface and&amp;nbsp;low number of distinct&amp;nbsp;items leads users to want the smallest number of fields -- preferably one -- necessary to identify each instance.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;2. &lt;EM&gt;Large list selection &lt;/EM&gt;(applies to entities with a relative large number of instances): The more spacious interface and&amp;nbsp;higher number of distinct &lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;items leads users to want a moderate number of fields that allow for multiple ways of identifying an instance.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;3. &lt;EM&gt;Generating a drillthrough report for multiple instances of entity X:&lt;/EM&gt; The fact that the report is fundamentally "about" instances of entity X leads users to want an even&amp;nbsp;larger number of fields, including some that are very interesting/useful, though not necessarily identifying.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;4. &lt;EM&gt;Creating a group on instances of entity X:&lt;/EM&gt;&lt;STRONG&gt; &lt;/STRONG&gt;The uncertainty about whether the report is fundamentally "about" instances of entity X leads users to want just enough fields to easily identify each instance (they can easily add more if they want them).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;5.&amp;nbsp;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;EM&gt;Model item security:&lt;/EM&gt;&lt;STRONG&gt; &lt;/STRONG&gt;Users will not get permission for an entity if they cannot see&amp;nbsp;the canonical minimum set of fields required to identify an instance of that entity. To allow flexibility for granting permission to other fields, administrators want only the absolute minimum number of fields necessary in this set.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;STRONG&gt;Options&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;In SQL 2005 there are only two collections&amp;nbsp;defined on an entity that accommodate all five of these scenarios. &lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;EM&gt;IdentifyingAttributes &lt;/EM&gt;is&amp;nbsp;used for dropdown selection, large list selection, and model item security. &lt;EM&gt;DefaultDetailAttributes &lt;/EM&gt;is used for generating drillthrough reports and creating a group on instances of entity X. &lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;[Note: Use of&amp;nbsp;DefaultDetailAttributes always reverts to IdentifyingAttributes if the first is empty.]&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;STRONG&gt;Recommended Approach&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Given the limited options and the sometimes conflicting pressure to add/remove fields from each of these collections, the following is&amp;nbsp;my recommended approach.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;EM&gt;IdentifyingAttributes &lt;/EM&gt;should be &lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;as small as possible, preferably one field.&amp;nbsp;The exception would be an entity that uses large list selection, which cries out for multiple fields to help the user identify each instance. In this case you should consider adding &lt;EM&gt;at most&lt;/EM&gt; one or two more fields (e.g. including Name along with ID), but keep in mind that in doing so you are giving up the ability to expose these fields independently through model item security.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;EM&gt;DefaultDetailAttributes&lt;/EM&gt;, if used at all,&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;should at most be only slightly larger than the set of fields in IdentifyingAttributes. If you have too many fields, you will quickly&amp;nbsp;start to annoy users when they want to create a group on that entity, especially a chart group (which will display the concatenation of&amp;nbsp;all&amp;nbsp;of those fields in the data label for the corresponding category or series -- ouch).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;For entities where the DefaultDetailAttributes selected above are just not enough to generate a decent multi-instance drillthrough report to that entity, use Report Builder to throw together a report with the fields you really want, enable the Drillthrough (&lt;EM&gt;to &lt;/EM&gt;this report) option in the Report Properties dialog, save it to the server, and use SQL Management Studio to specify it as the multi-instance drillthrough report instead.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=484895" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Model+Design/default.aspx">Model Design</category><category domain="http://blogs.msdn.com/bobmeyers/archive/tags/Presentation/default.aspx">Presentation</category></item></channel></rss>