<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error with Report Viewer when adding parameters for an add-in project for Re in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/error-with-report-viewer-when-adding-parameters-for-an-add-in/m-p/8820813#M43027</link>
    <description>&lt;P&gt;Hi Jesse&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your effort and taking the time to let me know how to fix the issue. I'm going to try this procedure as soon as possible.&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Corinne&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 11:21:19 GMT</pubDate>
    <dc:creator>corinne.astori</dc:creator>
    <dc:date>2019-05-29T11:21:19Z</dc:date>
    <item>
      <title>Error with Report Viewer when adding parameters for an add-in project for Revit</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/error-with-report-viewer-when-adding-parameters-for-an-add-in/m-p/8731457#M43023</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;I started a project of an add-in for Revit which should take some parameters (values from Revit elements) and show them in a Report (a Report RDLC) and then be able to print the report. I developed the project in Visual Studio 2017 on .Net Framework 4.7.2 starting with the “Revit 2019 Addin” from The Building Coder. I added the NuGet Package Microsoft.ReportingServices.reportViewerControl.Winforms (and the package Microsft.SqlServer.Types that comes with it). I then added a Report.rdlc and a form with a report viewer on it. I first added a simple text to the report and tried to run the add-in in Revit 2019 and it worked fine (showing the report). I then added some parameters to the report and here start the problems L, the report shows an error :&lt;/P&gt;
&lt;P&gt;“An error occurred during local report processing. Failed to load expression host assembly. Details: Impossible to load the file or the assembly ‘Microsoft.ReportViewer.Common, Version 15.0.0.0, Culture=neutral, PublicKey Token= 89845dcd8080cc91’…”&lt;/P&gt;
&lt;P&gt;After searching around in the web, it seems that this is a problem with security policies related to ReportViewer. I also tried to add these three lines of code (which I found on a blog and were solving the problem by a couple of users) in the load method of the form that contains the ReportViewer:&lt;/P&gt;
&lt;P&gt;this.reportViewer1.LocalReport.ExecuteReportInCurrentAppDomain(System.Reflection.Assembly.GetExecutingAssembly().Evidence);&lt;/P&gt;
&lt;P&gt;PermissionSet permissions = new PermissionSet(PermissionState.Unrestricted);&lt;/P&gt;
&lt;P&gt;this.reportViewer1.LocalReport.SetBasePermissionsForSandboxAppDomain(permissions);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But unsuccessfully… it still doesn’t work and now it is showing a message box with this error:&lt;/P&gt;
&lt;P&gt;“Report execution in the current AppDomain requires Code Access Security policy, which is off by default in .NET 4.0 and later.&amp;nbsp; Enable legacy CAS policy or execute the report in the sandbox AppDomain”.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have to add, that I’m not very experienced with programming and the Revit API, but I really would like this project to work….&lt;/P&gt;
&lt;P&gt;Your help will be very much appreciated! THX&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2019 16:05:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/error-with-report-viewer-when-adding-parameters-for-an-add-in/m-p/8731457#M43023</guid>
      <dc:creator>corinne.astori</dc:creator>
      <dc:date>2019-04-15T16:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Error with Report Viewer when adding parameters for an add-in project for Re</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/error-with-report-viewer-when-adding-parameters-for-an-add-in/m-p/8798145#M43024</link>
      <description>&lt;P&gt;I don't have a solution, but i ran in to the same problem today... Found a fix already?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jesse&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 14:01:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/error-with-report-viewer-when-adding-parameters-for-an-add-in/m-p/8798145#M43024</guid>
      <dc:creator>jesse.mom</dc:creator>
      <dc:date>2019-05-17T14:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Error with Report Viewer when adding parameters for an add-in project for Re</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/error-with-report-viewer-when-adding-parameters-for-an-add-in/m-p/8800312#M43025</link>
      <description>&lt;P&gt;Hi Jesse&lt;/P&gt;
&lt;P&gt;Unfortunately I didn't find a solution. I ended up creating the report in form of a .docx file (using a word document as a template).&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Corinne&lt;/P&gt;</description>
      <pubDate>Sun, 19 May 2019 12:20:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/error-with-report-viewer-when-adding-parameters-for-an-add-in/m-p/8800312#M43025</guid>
      <dc:creator>corinne.astori</dc:creator>
      <dc:date>2019-05-19T12:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: Error with Report Viewer when adding parameters for an add-in project for Re</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/error-with-report-viewer-when-adding-parameters-for-an-add-in/m-p/8819362#M43026</link>
      <description>&lt;P&gt;Hi Corinne,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I finally fixed the issue. I do not fully understand how it works, but it works. It does not have to do anything with the security issue or whatsoever.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error that is displayed in the reportviewer control at runtime says that it cannot find&amp;nbsp;&lt;SPAN&gt;Microsoft.ReportViewer.Common, Version 15.0.0.0. Even though the file is included in the nuget package and referenced in your visual studio project. Extensive research in the dark corners of the web showed me that it is looking for this file in the GAC (Global Assembly Cache), not in the folder where your addin resides. Indeed, when I looked in the GAC, there where versions of&amp;nbsp;Microsoft.ReportViewer.Common but not 15.0.0.0.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When I added this file (Microsoft.ReportViewer.Common.dll) and&amp;nbsp;Microsoft.ReportViewer.ProcessingObjectModel.dll as downloaded from NuGet to the GAC it worked! See link below on how to do this.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://docs.microsoft.com/en-us/dotnet/framework/app-domains/how-to-install-an-assembly-into-the-gac" target="_blank"&gt;https://docs.microsoft.com/en-us/dotnet/framework/app-domains/how-to-install-an-assembly-into-the-gac&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now this fixes the problem on my machine, but not for other users of my tool. Therefore, you need to create an installer file, and make sure the installer file for your revit addin that additionally places the files in the gac of the target machine.&amp;nbsp; See links below on how to do that.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://support.microsoft.com/en-us/help/324168/how-to-deploy-an-assembly-to-the-target-computer-global-assembly-cache" target="_blank"&gt;https://support.microsoft.com/en-us/help/324168/how-to-deploy-an-assembly-to-the-target-computer-global-assembly-cache&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://stackoverflow.com/questions/44286704/create-setup-msi-installer-in-visual-studio-2017" target="_blank"&gt;https://stackoverflow.com/questions/44286704/create-setup-msi-installer-in-visual-studio-2017&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Good luck!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 18:33:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/error-with-report-viewer-when-adding-parameters-for-an-add-in/m-p/8819362#M43026</guid>
      <dc:creator>jesse.mom</dc:creator>
      <dc:date>2019-05-28T18:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: Error with Report Viewer when adding parameters for an add-in project for Re</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/error-with-report-viewer-when-adding-parameters-for-an-add-in/m-p/8820813#M43027</link>
      <description>&lt;P&gt;Hi Jesse&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your effort and taking the time to let me know how to fix the issue. I'm going to try this procedure as soon as possible.&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Corinne&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 11:21:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/error-with-report-viewer-when-adding-parameters-for-an-add-in/m-p/8820813#M43027</guid>
      <dc:creator>corinne.astori</dc:creator>
      <dc:date>2019-05-29T11:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Error with Report Viewer when adding parameters for an add-in project for Re</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/error-with-report-viewer-when-adding-parameters-for-an-add-in/m-p/9292282#M43028</link>
      <description>&lt;P&gt;I solved the problem by copying the DLL files to the revit add in folder.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 11:24:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/error-with-report-viewer-when-adding-parameters-for-an-add-in/m-p/9292282#M43028</guid>
      <dc:creator>c4rlos.dias</dc:creator>
      <dc:date>2020-02-03T11:24:24Z</dc:date>
    </item>
  </channel>
</rss>

