This is a migrated thread and some comments may be shown as answers.
Exporting to TIFF
3 Answers 60 Views
This is a migrated thread and some comments may be shown as answers.
Kenneth Jackson
Top achievements
Rank 1
Kenneth Jackson asked on 29 Jun 2009, 09:37 AM
I'm trying to export to tiff and using the code detailed in this article, http://www.telerik.com/community/forums/reporting/telerik-reporting/tif-rendering-extension-not-working.aspx . The difference is that we are using winforms .

I keep getting a RendererNotAvailable exception , I use very similar code for our PDF exports and that works just
fine but not with the TIFF format. Is there an include I am missing or a config that needs setup ? I am explicitly
declaring the deviceinfo hashtable as per the article linked but to no avail.

3 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 30 Jun 2009, 06:08 AM
Hi Kenneth Jackson,

It is very hard to pinpoint a potential problem without any relevant code/sample as the code in the referenced article does work as expected and is not relevant to whether it is used in web or windows forms. Do you need to have the TIFF settings initialized programmatically or can it be in app.config? If the latter please check this KB article as well.
If still having problems, please open a support ticket and attach a sample project which we can use to replicate the issue on our end.

Kind regards,
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
Kenneth Jackson
Top achievements
Rank 1
answered on 01 Jul 2009, 08:58 AM
Steve I could use either and the KB article was exactly what I needed :)  Thank you for that.

Out of interest is there an example anywhere of how the tiff settings can be initialized programmatically
rather than through the app.config file ?

0
Chavdar
Telerik team
answered on 01 Jul 2009, 11:19 AM
Hi Kenneth Jackson,

When exporting through the viewer there is no other way to configure the extension except through the configuration file. However, if you render the report manually by using the ReportProcessor.Render method then you can set all the parameters through the device info. Here is an example:

string ext; 
            string mimeType; 
            Encoding encoding; 
            Hashtable deviceInfo = new Hashtable(); 
            deviceInfo["OutputFormat"] = "TIFF"
            deviceInfo["TiffCompression"] = "ccitt4"
            byte[] result = ReportProcessor.Render("IMAGE"new Report1(), deviceInfo, out mimeType, out ext, out encoding); 
            using (FileStream fs = new FileStream("C:\\Report1.tiff", FileMode.Create)) 
            { 
                fs.Write(result, 0, result.Length); 
            } 

Note the the name of the rendering extension is IMAGE (not TIFF). Tiff is specified by the OutputFormat parameter in the device info.

Greetings,
Chavdar
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.
Asked by
Kenneth Jackson
Top achievements
Rank 1
Answers by
Steve
Telerik team
Kenneth Jackson
Top achievements
Rank 1
Chavdar
Telerik team
Share this question
or