This is a migrated thread and some comments may be shown as answers.

Restrict Export Type to .Pdf

41 Answers 752 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ian Coetzer
Top achievements
Rank 2
Ian Coetzer asked on 13 Jun 2008, 12:49 PM
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

41 Answers, 1 is accepted

Sort by
0
Accepted
Milen | Product Manager @DX
Telerik team
answered on 16 Jun 2008, 08:44 AM
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
0
Ian Coetzer
Top achievements
Rank 2
answered on 17 Jun 2008, 04:10 PM
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.

0
Ian Coetzer
Top achievements
Rank 2
answered on 18 Jun 2008, 10:49 AM
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"/>
0
jerry
Top achievements
Rank 1
answered on 20 Apr 2009, 03:56 PM
How can this be completed for the windows forms version of the telerik report viewer?

0
Steve
Telerik team
answered on 21 Apr 2009, 07:22 AM
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.
0
jerry
Top achievements
Rank 1
answered on 21 Apr 2009, 01:25 PM
Steve,
Thank you for the reply that worked.

Jerry
0
Dave Whiting
Top achievements
Rank 1
answered on 29 Oct 2009, 02:10 PM
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.
0
Steve
Telerik team
answered on 29 Oct 2009, 03:36 PM
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.
0
Dinesh Danasekar
Top achievements
Rank 1
answered on 11 Dec 2009, 12:25 PM
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
0
Steve
Telerik team
answered on 11 Dec 2009, 01:36 PM
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.
0
Dinesh Danasekar
Top achievements
Rank 1
answered on 14 Dec 2009, 12:50 PM
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.

0
Steve
Telerik team
answered on 14 Dec 2009, 01:18 PM
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.
0
hll
Top achievements
Rank 1
answered on 04 Jan 2010, 10:44 AM
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.
0
Steve
Telerik team
answered on 04 Jan 2010, 12:04 PM
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.
0
hll
Top achievements
Rank 1
answered on 04 Jan 2010, 12:31 PM
thank you!
0
Dave Hayward
Top achievements
Rank 1
answered on 09 Nov 2010, 03:03 PM
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.  

0
Steve
Telerik team
answered on 09 Nov 2010, 04:07 PM
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
0
Dave Hayward
Top achievements
Rank 1
answered on 09 Nov 2010, 04:57 PM
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.

0
Steve
Telerik team
answered on 09 Nov 2010, 05:01 PM
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
0
Shahzada
Top achievements
Rank 1
answered on 20 Apr 2012, 12:44 PM
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??
0
Steve
Telerik team
answered on 20 Apr 2012, 12:52 PM
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 >

0
Shahzada
Top achievements
Rank 1
answered on 20 Apr 2012, 01:22 PM
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.
0
Steve
Telerik team
answered on 20 Apr 2012, 01:26 PM
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 >

0
Shahzada
Top achievements
Rank 1
answered on 20 Apr 2012, 01:28 PM
by doing same these steps.

it shows on remote server. (via IIS)
0
Shahzada
Top achievements
Rank 1
answered on 20 Apr 2012, 01:34 PM
here are some snaps.
0
Steve
Telerik team
answered on 21 Apr 2012, 02:13 PM
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 >

0
Shahzada
Top achievements
Rank 1
answered on 23 Apr 2012, 05:35 AM
not solved !

now it shows following error. (screen attached)
0
Steve
Telerik team
answered on 23 Apr 2012, 08:18 AM
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 >

0
Shahzada
Top achievements
Rank 1
answered on 23 Apr 2012, 09:00 AM
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
0
Steve
Telerik team
answered on 23 Apr 2012, 01:33 PM
Hi Shahzada,

Judging by your screenshot, the only export format that should not show is the XPS. If you have verified that there is no Telerik.Reporting.XpsRendering.dll assembly in the bin folder of your application, make sure this assembly is not added to the GAC of your server. If so, please remove it as it is not necessary to add reporting assemblies to GAC. Your other option would be to explicitly hide it:

<Extension name="XPS" visible="false"
</Extension>  

I've attached a sample project that works as expected. Compare both and make the necessary changes.

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 >

0
Shahzada
Top achievements
Rank 1
answered on 24 Apr 2012, 07:37 AM
thanks for your response;

its working fine on local machine but same error on remote server when publish over iis 7

error file attached.
0
Steve
Telerik team
answered on 24 Apr 2012, 07:57 AM
Hi Shahzada,

We've already provided explanation about this error in your previous post and you have not answered our questions whether you have these assemblies in bin and/or in GAC of your server. Without providing us with your project and screenshots of your bin folder and GAC of your server, we would not be able to help further.

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 >

0
Shahzada
Top achievements
Rank 1
answered on 24 Apr 2012, 08:17 AM
here is screen shot of bin folder for the project you sent me and i publish it over server and having error (previous post attachment).

there is no any telerik related dll in GAC. because we have not installed telerik over server and we would not like to do that. just copy the dll in folder and add reference of these telerik dlls from that folder.
0
Steve
Telerik team
answered on 24 Apr 2012, 08:35 AM
Hello Shahzada,

Remove the following from the web.config of the project we've send you:

<Extension name="XPS" visible="false">
</Extension>

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 >

0
Shahzada
Top achievements
Rank 1
answered on 24 Apr 2012, 08:55 AM
I have remove it from web.config.
Its working fine on my staging server and xps is not showing in export options DDL.
But on my development machine this xps option is being displayed in export options DDL.

I am doing following, according to my understanding based on your previous posts.

Add reference for "Telerik.Reporting.XpsRendering.dll" in my project.

and added
<Extension name="XPS" visible="false">
</Extension>
in web.config

and its working fine for both on local machine and staging server.

thankyou so much.
0
Shahzada
Top achievements
Rank 1
answered on 04 Jul 2012, 05:55 AM
how i remove my last attached screen in this forum??
0
Steve
Telerik team
answered on 04 Jul 2012, 06:49 AM
Hello Shahzada,

You have quite a few attached screenshots in this forum, all of them do not show any personal information, so is there any reason why they should be deleted? Which image do you refer to?

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 >

0
Shahzada
Top achievements
Rank 1
answered on 04 Jul 2012, 07:00 AM
 in my post 
Posted on Apr 24, 2012 


Attached files
  • error.PNG

this image contains IP info; i want to remove now;
0
Rumen
Telerik team
answered on 04 Jul 2012, 10:24 AM
Hello,

As requested, the error.png image was deleted.

All the best,
Rumen
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 >

0
Murali
Top achievements
Rank 1
answered on 03 Oct 2013, 07:09 PM
Hello,

How can I restrict .PDF option for only one report.

For one report all other options should be there except pdf and for other reports all options should be there.

Thanks
0
Stef
Telerik team
answered on 08 Oct 2013, 04:32 PM
Hi Murali,

Please take a look at the answer in the following forum thread: Restrict export type options

Regards,
Stef
Telerik

Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.

Tags
General Discussions
Asked by
Ian Coetzer
Top achievements
Rank 2
Answers by
Milen | Product Manager @DX
Telerik team
Ian Coetzer
Top achievements
Rank 2
jerry
Top achievements
Rank 1
Steve
Telerik team
Dave Whiting
Top achievements
Rank 1
Dinesh Danasekar
Top achievements
Rank 1
hll
Top achievements
Rank 1
Dave Hayward
Top achievements
Rank 1
Shahzada
Top achievements
Rank 1
Rumen
Telerik team
Murali
Top achievements
Rank 1
Stef
Telerik team
Share this question
or