<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.inetium.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Jamie Miley</title><subtitle type="html" /><id>http://blogs.inetium.com/blogs/jmiley/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.inetium.com/blogs/jmiley/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.inetium.com/blogs/jmiley/atom.aspx" /><generator uri="http://communityserver.org" version="4.0.30417.1769">Community Server</generator><updated>2008-09-27T21:50:00Z</updated><entry><title>Programmatically rendering a SQL Server Reporting Services (SSRS) report from Microsoft CRM 4.0 and capturing output in a file.</title><link rel="alternate" type="text/html" href="/blogs/jmiley/archive/2008/10/06/programmatically-rendering-a-sql-server-reporting-services-ssrs-report-from-microsoft-crm-4-0-and-capturing-output-in-a-file.aspx" /><id>/blogs/jmiley/archive/2008/10/06/programmatically-rendering-a-sql-server-reporting-services-ssrs-report-from-microsoft-crm-4-0-and-capturing-output-in-a-file.aspx</id><published>2008-10-06T20:12:00Z</published><updated>2008-10-06T20:12:00Z</updated><content type="html">&lt;p style="MARGIN:0in 0in 0pt;" class="MsoNoSpacing"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;Programmatically running a SQL Server Reporting Services report and capturing output in a file for use from CRM.&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN:0in 0in 0pt;" class="MsoNoSpacing"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN:0in 0in 0pt;" class="MsoNoSpacing"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;It is possible in CRM to use SQL Server Reporting Services in order to run a report and capture the output in a file.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;The first problem is that you only see GUIDs listed for CRM reports under the SSRS report manager.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;To actually be able to run the report on the report server from the CRM report name you must publish the report for external use.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN:0in 0in 0pt;" class="MsoNoSpacing"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN:0in 0in 0pt 0.5in;TEXT-INDENT:-0.25in;mso-list:l0 level1 lfo1;" class="MsoNoSpacing"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;1.&lt;/span&gt;&lt;span style="font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;Go to &amp;ldquo;Workplace&amp;rdquo; and then &amp;ldquo;Reports&amp;rdquo; in CRM and click on the report you want to edit and click &amp;ldquo;Edit Report&amp;rdquo;.&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN:0in 0in 0pt 0.5in;TEXT-INDENT:-0.25in;mso-list:l0 level1 lfo1;" class="MsoNoSpacing"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;2.&lt;/span&gt;&lt;span style="font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;Now click &amp;ldquo;Actions&amp;rdquo; and then &amp;ldquo;Publish Report for External Use&amp;rdquo;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN:0in 0in 0pt 0.5in;TEXT-INDENT:-0.25in;mso-list:l0 level1 lfo1;" class="MsoNoSpacing"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="MARGIN:0in 0in 0pt 0.5in;TEXT-INDENT:-0.25in;mso-list:l0 level1 lfo1;" class="MsoNoSpacing"&gt;&amp;nbsp;&lt;span style="font-family:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;If you now go into Sql Report Manager at &lt;a href="http://myreportserver.mydomain.com/reports"&gt;&lt;span style="color:#0000ff;"&gt;http://myreportserver.mydomain.com/reports&lt;/span&gt;&lt;/a&gt; and go to your specific org database name, you will see the report you published for external use and any sub reports that are utilized by it.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;This now allows you to use the web-service and call it by name&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN:0in 0in 0pt 0.5in;TEXT-INDENT:-0.25in;mso-list:l0 level1 lfo1;" class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt;" class="MsoNoSpacing"&gt;Now, create a plug-in or other application you want to run the CRM report.&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt;" class="MsoNoSpacing"&gt;In Visual Studio, make a web service reference to the SQL Server Reporting Services web service(. And use something similar to the following snippet of code to render the file and save the output to a file.&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt;" class="MsoNoSpacing"&gt;If you are using a separate application you would probably want to hardcode credentials, but if you were doing this in a plug-in or custom workflow assembly you would want to use the default credentials.&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt;" class="MsoNoSpacing"&gt;I also left some commented out code in this example to show how to populate report parameters.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ReportExecutionService rs = new ReportExecutionService();&lt;/p&gt;
&lt;p&gt;//rs.Credentials = System.Net.CredentialCache.DefaultCredentials;&lt;/p&gt;
&lt;p&gt;rs.Credentials = new System.Net.NetworkCredential(&amp;quot;username&amp;quot;, &amp;quot;password&amp;quot;, &amp;quot;domain&amp;quot;);&lt;/p&gt;
&lt;p&gt;rs.Url = &amp;quot;http://MySqlServer.MyDomain.com/reportserver/ReportExecution2005.asmx&amp;quot;;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;// Render arguments&lt;/p&gt;
&lt;p&gt;byte[] result = null;&lt;/p&gt;
&lt;p&gt;// Make sure you use your correct org database name of the following line&lt;/p&gt;
&lt;p&gt;string reportPath = &amp;quot;/jmiley_MSCRM/Account Overview&amp;quot;;&lt;/p&gt;
&lt;p&gt;string format = &amp;quot;PDF&amp;quot;;&lt;/p&gt;
&lt;p&gt;string historyID = null;&lt;/p&gt;
&lt;p&gt;string devInfo = @&amp;quot;&amp;lt;DeviceInfo&amp;gt;&amp;lt;Toolbar&amp;gt;False&amp;lt;/Toolbar&amp;gt;&amp;lt;/DeviceInfo&amp;gt;&amp;quot;;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;// Prepare report parameter.&lt;/p&gt;
&lt;p&gt;//ParameterValue[] parameters = new ParameterValue[3];&lt;/p&gt;
&lt;p&gt;//parameters[0] = new ParameterValue();&lt;/p&gt;
&lt;p&gt;//parameters[0].Name = &amp;quot;EmpID&amp;quot;;&lt;/p&gt;
&lt;p&gt;//parameters[0].Value = &amp;quot;288&amp;quot;;&lt;/p&gt;
&lt;p&gt;//parameters[1] = new ParameterValue();&lt;/p&gt;
&lt;p&gt;//parameters[1].Name = &amp;quot;ReportMonth&amp;quot;;&lt;/p&gt;
&lt;p&gt;//parameters[1].Value = &amp;quot;6&amp;quot;; // June&lt;/p&gt;
&lt;p&gt;//parameters[2] = new ParameterValue();&lt;/p&gt;
&lt;p&gt;//parameters[2].Name = &amp;quot;ReportYear&amp;quot;;&lt;/p&gt;
&lt;p&gt;//parameters[2].Value = &amp;quot;2004&amp;quot;;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;DataSourceCredentials[] credentials = null;&lt;/p&gt;
&lt;p&gt;string showHideToggle = null;&lt;/p&gt;
&lt;p&gt;string encoding;&lt;/p&gt;
&lt;p&gt;string mimeType;&lt;/p&gt;
&lt;p&gt;string extension;&lt;/p&gt;
&lt;p&gt;Warning[] warnings = null;&lt;/p&gt;
&lt;p&gt;ParameterValue[] reportHistoryParameters = null;&lt;/p&gt;
&lt;p&gt;string[] streamIDs = null;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ExecutionInfo execInfo = new ExecutionInfo();&lt;/p&gt;
&lt;p&gt;ExecutionHeader execHeader = new ExecutionHeader();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;rs.ExecutionHeaderValue = execHeader;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;execInfo = rs.LoadReport(reportPath, historyID);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;//rs.SetExecutionParameters(parameters, &amp;quot;en-us&amp;quot;);&lt;/p&gt;
&lt;p&gt;String SessionId = rs.ExecutionHeaderValue.ExecutionID;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Console.WriteLine(&amp;quot;SessionID: {0}&amp;quot;, rs.ExecutionHeaderValue.ExecutionID);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;try&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;result = rs.Render(format, devInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; execInfo = rs.GetExecutionInfo();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Console.WriteLine(&amp;quot;Execution date and time: {0}&amp;quot;, &amp;nbsp;&amp;nbsp;&amp;nbsp;execInfo.ExecutionDateTime);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;catch (SoapException err)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;{&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(err.Detail.OuterXml);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;// Write the contents of the report to an PDF file.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;try&lt;/p&gt;
&lt;p&gt;&amp;nbsp;{&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileStream stream = File.Create(@&amp;quot;c:\upload eport.pdf&amp;quot;, result.Length);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(&amp;quot;File created.&amp;quot;);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; stream.Write(result, 0, result.Length);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(&amp;quot;Result written to the file.&amp;quot;);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; stream.Close();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp; catch (Exception error)&lt;/p&gt;
&lt;p&gt;&amp;nbsp; {&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(error.Message);&lt;/p&gt;
&lt;p&gt;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt;" class="MsoNoSpacing"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;You can view full documentation on the SSRS web service from MSDN at:&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt;" class="MsoNoSpacing"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms152787(SQL.90).aspx"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;http://msdn.microsoft.com/en-us/library/ms152787(SQL.90).aspx&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt;" class="MsoNoSpacing"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt;" class="MsoNoSpacing"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;Instead of PDF files, you can also create other types of files by changing the format string:&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt 0.5in;text-indent:-0.25in;mso-list:l0 level1 lfo1;" class="MsoNoSpacing"&gt;&lt;span style="mso-ascii-font-family:Calibri;mso-fareast-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:Calibri;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;-&lt;/span&gt;&lt;span style="font:7pt &amp;#39;Times New Roman&amp;#39;;"&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;span style="font-size:small;font-family:Calibri;"&gt;MHT web archive &amp;ndash; &amp;ldquo;MHTML&amp;rdquo;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt 0.5in;text-indent:-0.25in;mso-list:l0 level1 lfo1;" class="MsoNoSpacing"&gt;&lt;span style="mso-ascii-font-family:Calibri;mso-fareast-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:Calibri;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;-&lt;/span&gt;&lt;span style="font:7pt &amp;#39;Times New Roman&amp;#39;;"&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;span style="font-size:small;font-family:Calibri;"&gt;XML &amp;ndash; &amp;ldquo;XML&amp;rdquo;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt 0.5in;text-indent:-0.25in;mso-list:l0 level1 lfo1;" class="MsoNoSpacing"&gt;&lt;span style="mso-ascii-font-family:Calibri;mso-fareast-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:Calibri;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;-&lt;/span&gt;&lt;span style="font:7pt &amp;#39;Times New Roman&amp;#39;;"&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;span style="font-size:small;font-family:Calibri;"&gt;CSV &amp;ndash; &amp;ldquo;CSV&amp;rdquo;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt 0.5in;text-indent:-0.25in;mso-list:l0 level1 lfo1;" class="MsoNoSpacing"&gt;&lt;span style="mso-ascii-font-family:Calibri;mso-fareast-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:Calibri;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;-&lt;/span&gt;&lt;span style="font:7pt &amp;#39;Times New Roman&amp;#39;;"&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;span style="font-size:small;font-family:Calibri;"&gt;IMAGE &amp;ndash; &amp;ldquo;IMAGE&amp;rdquo;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt 0.5in;text-indent:-0.25in;mso-list:l0 level1 lfo1;" class="MsoNoSpacing"&gt;&lt;span style="mso-ascii-font-family:Calibri;mso-fareast-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:Calibri;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;-&lt;/span&gt;&lt;span style="font:7pt &amp;#39;Times New Roman&amp;#39;;"&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;span style="font-size:small;font-family:Calibri;"&gt;EXCEL &amp;ndash; &amp;ldquo;EXCEL&amp;rdquo;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt 0.5in;text-indent:-0.25in;mso-list:l0 level1 lfo1;" class="MsoNoSpacing"&gt;&lt;span style="mso-ascii-font-family:Calibri;mso-fareast-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:Calibri;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;-&lt;/span&gt;&lt;span style="font:7pt &amp;#39;Times New Roman&amp;#39;;"&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;span style="font-size:small;font-family:Calibri;"&gt;HTML &amp;ndash; &amp;ldquo;HTML4.0&amp;rdquo;, &amp;ldquo;HTML3.2&amp;rdquo;, &amp;ldquo;HTMLOWC&amp;rdquo;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt;" class="MsoNoSpacing"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt;" class="MsoNoSpacing"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;There are a few things to consider:&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt;" class="MsoNoSpacing"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt 0.5in;text-indent:-0.25in;mso-list:l1 level1 lfo2;" class="MsoNoSpacing"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;1.&lt;/span&gt;&lt;span style="font:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;The file copy operation above will use the app domain&amp;rsquo;s credentials for creating the output file.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt 0.5in;" class="MsoNoSpacing"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;If you are using a plug-in or workflow assembly this will be the CRM app pool security account.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt 0.5in;" class="MsoNoSpacing"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;If you want the file to be created on a different server, you may want to change the app pool security account to an Active Directory account instead of the default &amp;ldquo;network service&amp;rdquo;.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt 0.5in;" class="MsoNoSpacing"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt 0.5in;text-indent:-0.25in;mso-list:l1 level1 lfo2;" class="MsoNoSpacing"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;2.&lt;/span&gt;&lt;span style="font:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:small;font-family:Calibri;"&gt;Default credentials should be used for the web-service for plug-ins and workflow assemblies as it uses CRM security and will not let people access data through the reports that they do not have read access to in CRM.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt;" class="MsoNoSpacing"&gt;&lt;i&gt;&lt;span style="font-size:10pt;"&gt;&lt;span style="font-family:Calibri;"&gt;This post is provided as-is and implies no warranty; Inetium does not assume any responsibility for problems arising from the use of this information.&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p style="MARGIN:0in 0in 0pt 0.5in;TEXT-INDENT:-0.25in;mso-list:l0 level1 lfo1;" class="MsoNoSpacing"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="MARGIN:0in 0in 0pt 0.5in;TEXT-INDENT:-0.25in;mso-list:l0 level1 lfo1;" class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN:0in 0in 0pt 0.5in;TEXT-INDENT:-0.25in;mso-list:l0 level1 lfo1;" class="MsoNoSpacing"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0in 0in 0pt;" class="MsoNoSpacing"&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.inetium.com/aggbug.aspx?PostID=18434" width="1" height="1"&gt;</content><author><name>jmiley</name><uri>http://blogs.inetium.com/members/jmiley/default.aspx</uri></author><category term="C#" scheme="http://blogs.inetium.com/blogs/jmiley/archive/tags/C_2300_/default.aspx" /><category term=".NET" scheme="http://blogs.inetium.com/blogs/jmiley/archive/tags/.NET/default.aspx" /><category term="Reporting Services" scheme="http://blogs.inetium.com/blogs/jmiley/archive/tags/Reporting+Services/default.aspx" /><category term="Report" scheme="http://blogs.inetium.com/blogs/jmiley/archive/tags/Report/default.aspx" /><category term="SSRS" scheme="http://blogs.inetium.com/blogs/jmiley/archive/tags/SSRS/default.aspx" /><category term="Sql Server" scheme="http://blogs.inetium.com/blogs/jmiley/archive/tags/Sql+Server/default.aspx" /></entry><entry><title>Map Custom Attributes from Opportunity Product to Quote Product to Order Product and so on in Microsoft CRM 4.0</title><link rel="alternate" type="text/html" href="/blogs/jmiley/archive/2008/09/27/map-custom-attributes-from-opportunity-product-to-quote-product-to-order-product-and-so-on-in-microsoft-crm-4-0.aspx" /><id>/blogs/jmiley/archive/2008/09/27/map-custom-attributes-from-opportunity-product-to-quote-product-to-order-product-and-so-on-in-microsoft-crm-4-0.aspx</id><published>2008-09-28T02:50:00Z</published><updated>2008-09-28T02:50:00Z</updated><content type="html">&lt;p&gt;It is possible to map custom attributes from opportunity product to quote product to order product to invoice product within CRM.&amp;nbsp; The best part about this workaround is that according to a recent Microsoft support case I opened, this is a supported workaround.&lt;br /&gt;&lt;br /&gt;I will demonstrate this by going from quotedetail (quote product) to salesorderdetail (order product):&lt;br /&gt;&lt;br /&gt;In SQL Server Management Studio.&amp;nbsp; Run the following query:&lt;br /&gt;&lt;br /&gt;Select * from entitymapbase where targetentityname = &amp;#39;salesorderdetail&amp;#39;&lt;br /&gt;&lt;br /&gt;This query should return three items, we care about the row with a SourceEntityName column value of &amp;quot;quotedetail&amp;quot;.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Now copy the GUID value of the EntityMapId column for that row.&lt;br /&gt;&lt;br /&gt;Then I use this URL, and at the end of it I paste the GUID that I just&lt;br /&gt;&lt;br /&gt;copied:&lt;br /&gt;&lt;br /&gt;http://yourservernamehere/Tools/SystemCustomization/Relationships/Mappings/mappingList.aspx?mappingId=&lt;br /&gt;&lt;br /&gt;This gives me the secret hidden mappings that I was after, between &amp;quot;Quote Product&amp;quot; and &amp;quot;Order Product&amp;quot;.&amp;nbsp; It is just another normal CRM GUI relationship mappings form.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;i&gt;This post is provided as-is and implies no warranty, Inetium does not assume any responsibility for problems arising from the use of this information.&lt;br /&gt;&lt;/i&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.inetium.com/aggbug.aspx?PostID=18389" width="1" height="1"&gt;</content><author><name>jmiley</name><uri>http://blogs.inetium.com/members/jmiley/default.aspx</uri></author><category term="Mappings" scheme="http://blogs.inetium.com/blogs/jmiley/archive/tags/Mappings/default.aspx" /><category term="Custom Attributes" scheme="http://blogs.inetium.com/blogs/jmiley/archive/tags/Custom+Attributes/default.aspx" /><category term="Microsoft" scheme="http://blogs.inetium.com/blogs/jmiley/archive/tags/Microsoft/default.aspx" /><category term="CRM" scheme="http://blogs.inetium.com/blogs/jmiley/archive/tags/CRM/default.aspx" /></entry></feed>