Restrict Export Type to .Pdf

42 posts, 1 answers
  1. Ian Coetzer
    Ian Coetzer avatar
    65 posts
    Member since:
    Sep 2004

    Posted 13 Jun 2008 Link to this post

    Hi

    Currently one can export a telerik report using the 'Save' (Export) button to export the report to a number of formats.

    i have a requirement to restrict the export formats listed to one, .pdf!
    How can I restrict the formats in this dropdown menu to only show Acrobat (PDF) file as an option?

    Bye
  2. Answer
    Milen
    Admin
    Milen avatar
    163 posts

    Posted 16 Jun 2008 Link to this post

    Hi Ian Coetzer,

    Yes, you can restrict the export formats to a subset you need, and it can be done by Configuring Telerik Reporting.

    In your case you need to add the following to your settings file:

    1. In the top of the configuration file:

     <configuration>
     <configSections>
       <section
    name="Telerik.Reporting" type="Telerik.Reporting.Processing.Config.ReportingConfigurationSection, Telerik.Reporting.Processing, Version=2.5.8.519, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
         allowLocation="true"
         allowDefinition="Everywhere"/>
     </configSections>
     …
    </configuration>

    2. And add the following section:

     <configuration>
     …
     <Telerik.Reporting>
       <Extensions>
         <Render>
           <Extension name="IMAGE" visible=”false”></Extension>
           <Extension name="HTML" visible=”false”></Extension>
           <Extension name="MHTML" visible=”false”></Extension>
           <Extension name="XLS" visible=”false”></Extension>
           <Extension name="CSV" visible=”false”></Extension>
           <Extension name="RTF" visible=”false”></Extension>
         </Render>
       </Extensions>
     </Telerik.Reporting>
     …
    </configuration> 

    Sincerely yours,
    Milen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. DevCraft banner
  4. Ian Coetzer
    Ian Coetzer avatar
    65 posts
    Member since:
    Sep 2004

    Posted 17 Jun 2008 Link to this post

    When I try this approach I receive the following exception:


     

    Server Error in '/DA190.Web.UI' Application.

    Configuration Error

    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: An error occurred creating the configuration section handler for Telerik.Reporting: Could not load file or assembly 'Telerik.Reporting.Processing, Version=2.5.8.519, Culture=neutral, PublicKeyToken=a9d7983dfcc261be' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

    Source Error:

    Line 10: <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    Line 11: 	<configSections>
    Line 12: <section name="Telerik.Reporting" type="Telerik.Reporting.Processing.Config.ReportingConfigurationSection, Telerik.Reporting.Processing, Version=2.5.8.519, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" allowLocation="true" allowDefinition="Everywhere"/>Line 13:     
    Line 14: 		<section name="securityConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Security.Configuration.SecuritySettings, Microsoft.Practices.EnterpriseLibrary.Security, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

    Source File: C:\_ICOETZE\_SourceCode\DA190\Coderoot\DA190.Web.UI\web.config    Line: 12

    Assembly Load Trace: The following information can be helpful to determine why the assembly 'Telerik.Reporting.Processing, Version=2.5.8.519, Culture=neutral, PublicKeyToken=a9d7983dfcc261be' could not be loaded.

  5. Ian Coetzer
    Ian Coetzer avatar
    65 posts
    Member since:
    Sep 2004

    Posted 18 Jun 2008 Link to this post

    Hi

    I found the problem
    If I remove the version, TokenKey etc. from the config section it works, and the export type is nicely restricted to .Pdf!!!

    <section name="Telerik.Reporting" type="Telerik.Reporting.Processing.Config.ReportingConfigurationSection, Telerik.Reporting.Processing" allowLocation="true" allowDefinition="Everywhere"/>
  6. jerry
    jerry avatar
    103 posts
    Member since:
    Feb 2008

    Posted 20 Apr 2009 Link to this post

    How can this be completed for the windows forms version of the telerik report viewer?

  7. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 21 Apr 2009 Link to this post

    Hi Jerry,

    As explained in the Configuring Telerik Reporting help article, you need to add this code to the app.config file for windows forms applications.

    Best wishes,
    Steve
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  8. jerry
    jerry avatar
    103 posts
    Member since:
    Feb 2008

    Posted 21 Apr 2009 Link to this post

    Steve,
    Thank you for the reply that worked.

    Jerry
  9. Dave Whiting
    Dave Whiting avatar
    41 posts
    Member since:
    Jan 2007

    Posted 29 Oct 2009 Link to this post

    Is it possible to restrict export types only for specific reports?  I want to be able to restrict some reports to just PDF and others to Excel.
  10. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 29 Oct 2009 Link to this post

    Hi Mark,

    This is currently not possible and logged in our features list for consideration for subsequent version of the product.

    Sincerely yours,
    Steve
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  11. Dinesh Danasekar
    Dinesh Danasekar avatar
    2 posts
    Member since:
    Dec 2009

    Posted 11 Dec 2009 Link to this post

    Hi,
    I tried with the below settings, but it resulted to error, but am not able to get only PDF & HTML format. Please suggest if there is any idea.

    1. In the top of the configuration file:

     <configuration>
     <configSections>
       <section
    name="Telerik.Reporting" type="Telerik.Reporting.Processing.Config.ReportingConfigurationSection, Telerik.Reporting.Processing, Version=2.5.8.519, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
         allowLocation="true"
         allowDefinition="Everywhere"/>
     </configSections>
     …
    </configuration>

    2. And add the following section:

     <configuration>
     …
     <Telerik.Reporting>
       <Extensions>
         <Render>
           <Extension name="IMAGE" visible=”false”></Extension>
           <Extension name="HTML" visible=”false”></Extension>
           <Extension name="MHTML" visible=”false”></Extension>
           <Extension name="XLS" visible=”false”></Extension>
           <Extension name="CSV" visible=”false”></Extension>
           <Extension name="RTF" visible=”false”></Extension>
         </Render>
       </Extensions>
     </Telerik.Reporting>
     …
    </configuration>

    Then i also tried removing the version, TokenKey etc. from the config section then also it resulted to error. Please suggest if there is any other idea.

    <section name="Telerik.Reporting" type="Telerik.Reporting.Processing.Config.ReportingConfigurationSection, Telerik.Reporting.Processing" allowLocation="true" allowDefinition="Everywhere"/>

    Thanks in Advance
  12. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 11 Dec 2009 Link to this post

    Hi Dinesh,

    I've attached a web.config file with the required settings. You just need to change the version of the referenced Telerik Reporting assemblies according to the one you use.


    Greetings,
    Steve
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  13. Dinesh Danasekar
    Dinesh Danasekar avatar
    2 posts
    Member since:
    Dec 2009

    Posted 14 Dec 2009 Link to this post

    Thanks Steve,
    I followed the procedure which you have mentioned. But, I still get the error which is given below,

    An error occurred creating the configuration section handler for Telerik.Reporting: Could not load type 'Telerik.Reporting.Processing.Config.ReportingConfigurationSection' from assembly 'Telerik.Reporting, Version=2.9.9.202, Culture=neutral, PublicKeyToken=a9d7983dfcc261be'.

    Thank You.

  14. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 14 Dec 2009 Link to this post

    Hello Dinesh,

    The web.config file I've sent is applicable for versions after Q2 2009, since we have reduced the number of assemblies required by Telerik Reporting in it, thus Telerik.Reporting.Processing.dll and Telerik.Reporting.Interfaces.dll no longer exist and are now part of the Telerik.Reporting.dll. Obviously you are using an older version (Q3 SP2) where those files still exists and respectively you should use the same approach as shown in the very first reply here e.g.:

    <section
    name="Telerik.Reporting" type="Telerik.Reporting.Processing.Config.ReportingConfigurationSection, Telerik.Reporting.Processing, Version=2.5.8.519, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
         allowLocation="true"
         allowDefinition="Everywhere"/>

    Note the bolder red colored text - it specifies that the ReportingConfigurationSection is available in the Telerik.Reporting.Processing assembly and not Telerik.Reporting as in the web.config I've attached.

    All the best,
    Steve
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  15. hll
    hll avatar
    29 posts
    Member since:
    Aug 2008

    Posted 04 Jan 2010 Link to this post

    Hi, I am trying to do similar thing. I am trying to hide Web Archive option from export types.
    I tried to add these settings to the config files. But it did not change anything. I can still see Web Archive option in dropdown list.

    I am using Telerik.Reporting version 3.2.9.1211.
  16. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 04 Jan 2010 Link to this post

    Hello hll,

    Please use the web.config file I have attached two posts down and change the Version attribute to 3.2.9.1211. Then you would also need to change the MHTML extension visible attribute to false, which would effectively hide it:

    ......
    <Extension name="MHTML" visible="false">
    </Extension>
    ......

    Regards,
    Steve
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  17. hll
    hll avatar
    29 posts
    Member since:
    Aug 2008

    Posted 04 Jan 2010 Link to this post

    thank you!
  18. Dave Hayward
    Dave Hayward avatar
    40 posts
    Member since:
    Jul 2012

    Posted 09 Nov 2010 Link to this post

    I have followed all the instructions and now have a curious problem. On my development setup everything works fine. On my production setup, I get the following error when I try to view a report: <attached>.

    My config file looks like this:

    <configuration>
        <configSections>
        <section name="Telerik.Reporting" type="Telerik.Reporting.Processing.Config.ReportingConfigurationSection, Telerik.Reporting, Version=4.1.10.714, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" allowLocation="true" allowDefinition="Everywhere" />
            <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                    <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                    <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                        <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
                        <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                        <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                        <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/></sectionGroup></sectionGroup></sectionGroup>
      </configSections>
      <Telerik.Reporting>
        <Extensions>
          <Render>
            <Extension name="IMAGE" visible="false"
            </Extension
            <Extension name="MHTML" visible="false"
            </Extension
            <Extension name="XLS" visible="false"
            </Extension
            <Extension name="CSV" visible="false"
            </Extension
            <Extension name="RTF" visible="false"
            </Extension>
             <Extension name="XPS" visible="false"
            </Extension>         
            <Extension name="PDF" visible="true"
              <Parameters
                <Parameter name="DocumentAuthor" value="Customer" /> 
              </Parameters
            </Extension
          </Render>
        </Extensions>
      </Telerik.Reporting>



    The production and development machines use the same files (including  web.config and the Reporting and ReportViewer dlls). The error message is a somewhat vague, but I was wondering if you might have a suggestion for where to look.  

  19. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 09 Nov 2010 Link to this post

    Hello Dave,

    You have not referenced (or deployed) the Telerik.Reporting.XamlRendering.dll assembly, which contains the XPS rendering extension. If you want to allow XPS export for the user, add reference (or deploy) the above assembly. If no XPS export is required, simply remove the <Extension name="XPS" visible="false"></Extension> line from the Telerik Reporting configuration section.

    Best wishes,
    Steve
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  20. Dave Hayward
    Dave Hayward avatar
    40 posts
    Member since:
    Jul 2012

    Posted 09 Nov 2010 Link to this post

    Steve,

    Thanks, that fixed the problem! And such an easy solution too.

    Now I'm left to wonder why it worked on my development setup.

  21. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 09 Nov 2010 Link to this post

    Dave,

    Because, during the installation of Telerik Reporting on your machine, the Telerik assemblies were added to GAC.

    Best wishes,
    Steve
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  22. Shahzada
    Shahzada avatar
    22 posts
    Member since:
    Jan 2012

    Posted 20 Apr 2012 Link to this post

    i could find the file (Telerik.Reporting.XamlRendering.dll) here in C:\Program Files (x86)\Telerik\Reporting Q3 2011\Bin

    so where from i can find it??
  23. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 20 Apr 2012 Link to this post

    Hello Shahzada,

    The Telerik.Reporting.XamlRendering.dll is obsolete since Q1 2011 and the xaml rendering is part of the Telerik.Reporting.dll. If you need to export to XPS, you should add reference to Telerik.Reporting.XpsRendering.dll.

    Kind regards,
    Steve
    the Telerik team

    BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

  24. Shahzada
    Shahzada avatar
    22 posts
    Member since:
    Jan 2012

    Posted 20 Apr 2012 Link to this post

    I have already tested it. to add reference for Telerik.Reporting.XpsRendering.dll ; but got same error on remote server;

    but its working fine on development server.

    i just need to disable xps export option. but have trouble.
  25. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 20 Apr 2012 Link to this post

    Hi Shahzada,

    If you are using Q3 2011 as indicated in your previous post, make sure you do not have Telerik.Reporting.XamlRendering.dll assembly on your server. You do not need to add
    <Extension name="XPS" visible="false"
    </Extension>    

    to your web.config, simply do not add reference to Telerik.Reporting.XpsRendering.dll and you would not have XPS in the export options.

    All the best,
    Steve
    the Telerik team

    BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

  26. Shahzada
    Shahzada avatar
    22 posts
    Member since:
    Jan 2012

    Posted 20 Apr 2012 Link to this post

    by doing same these steps.

    it shows on remote server. (via IIS)
  27. Shahzada
    Shahzada avatar
    22 posts
    Member since:
    Jan 2012

    Posted 20 Apr 2012 Link to this post

    here are some snaps.
  28. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 21 Apr 2012 Link to this post

    Hi Shahzada,

    The references screenshot is taken from your Visual Studio references, however you claim that the XPS export shows on your server - did you rebuild your application and re-deploy it (see Deploying Web Applications help article) after you remove the reference? Make sure there is no Telerik.Reporting.XpsRendering.dll assembly in your application bin folder.

    All the best,
    Steve
    the Telerik team

    BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

  29. Shahzada
    Shahzada avatar
    22 posts
    Member since:
    Jan 2012

    Posted 23 Apr 2012 Link to this post

    not solved !

    now it shows following error. (screen attached)
  30. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 23 Apr 2012 Link to this post

    Hello Shahzada,

    This error means that you are referencing a rendering extension somewhere in your code or in your web.config file, but you do not have the required assembly that contains that rendering extension.
    Please review the Deploying Web Applications help article to see the required assemblies and the optional assemblies that are responsible for DOCX, PPTX, XLSX and XPS rendering extensions.
    Most likely you have not deployed those assemblies to your live site, but in your web.config you're using a rendering extension, which without those assemblies cannot be instantiated and throws an error. As explained in our first reply, if you would not allow your user to export to a certain format, the simply remove the line from your web.config.

    Greetings,
    Steve
    the Telerik team

    BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

  31. Shahzada
    Shahzada avatar
    22 posts
    Member since:
    Jan 2012

    Posted 23 Apr 2012 Link to this post

    as per your reference for  Deploying Web Applications (http://www.telerik.com/help/reporting/installation-deploying-on-web-application.html )

    i have added two reference files "Telerik.Reporting.dll" and "Telerik.Reporting.OpenXmlRendering.dll".

    and in web.config file 

    <Telerik.Reporting>
        <Extensions>
          <Render>
            <Extension name="PDF" visible="true">
            </Extension>
            <Extension name="XLS" visible="true">
            </Extension>
            <Extension name="XLSX" description="Excel 2007 and above" visible="true">
            </Extension>
            <Extension name="DOCX" visible="false">
            </Extension>
            <Extension name="PPTX" visible="false">
            </Extension>
          </Render>
        </Extensions>
      </Telerik.Reporting>


    but it shows all export options (see attached). on both remote server and even on development server
Back to Top
DevCraft banner