Telerik Forums
Reporting Forum
2 answers
434 views
Hello, 

I have a report which contains a PictureBox with an URL as value property.

When I export to PDF or Excel, the image is displayed with no problems.

However, when I try to export the report to HTML5 (which generate multiple streams), the image is not converted to an HTML tag (like <img>). What I see instead is something like this : "����JFIF��� ( %!1!%)+...383,7(-.+  ,$$,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,���� ...". It's the representation in text of the image.

Is there anyway to fix this problem?

Here is the code I use to export in HTML5:

//Method used for rendering the report
public List<Stream> GenerateTelerik(string languageCode = "en")
        {
            CultureInfo cultureInfo;
            cultureInfo = languageCode == "fr" ? new CultureInfo("fr-CA") : new CultureInfo("en-US");
 
            // Set the language for static text (i.e. column headings, titles)
            System.Threading.Thread.CurrentThread.CurrentUICulture = cultureInfo;
 
            // Set the language for dynamic text (i.e. date, time, money)
            System.Threading.Thread.CurrentThread.CurrentCulture = cultureInfo;
 
            var reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
 
            // set any deviceInfo settings if necessary
            var deviceInfo = new System.Collections.Hashtable();                      
 
            var reportviewer = new Telerik.Reporting.InstanceReportSource
            {
                ReportDocument = _reportObject
            };
 
            var renderType = getRenderType(_exportFormat);
 
            if (_exportFormat == ExportFormat.HTML5)
            {
                deviceInfo["OutputFormat"] = renderType;
                string documentName;
 
                var result = reportProcessor.RenderReport(renderType, reportviewer, deviceInfo, CreateStream,
                    out documentName);
 
                if (result)
                {         
                    return _streams;
                }
 
                throw new Exception("Failed to export to HTML5");
            }
            else
            {
                var result = reportProcessor.RenderReport(renderType, reportviewer, deviceInfo);
                _streams.Add(new MemoryStream(result.DocumentBytes));
                return _streams;
            }
 
        }
 
//For Handling multiple streams
Stream CreateStream(string name, string extension, Encoding encoding, string mimeType)
        {
            string path = Path.GetTempPath();
            string filePath = Path.Combine(path, name + "." + extension);
 
            FileStream fs = new FileStream(filePath, FileMode.Create);
            _streams.Add(fs);
            return fs;
        }
 
//And when I want to render the HTML5 to the browser: (method in a controller in MVC application)
private HttpResponseMessage GetHtml5ResponseMessage(List<Stream> streams, TelerikReporting.ExportFormat exportFormatTyped)
        {
            string data = string.Empty;
            foreach (var stream in streams)
            {
                StreamReader readStream = null;
                stream.Position = 0;
                readStream = new StreamReader(stream);
                data += readStream.ReadToEnd();
                readStream.Close();
            }
 
            return new HttpResponseMessage()
            {
                Content = new StringContent(data, Encoding.UTF8, getMIMEType(exportFormatTyped))
            };
        }



Dominic
Top achievements
Rank 1
 answered on 29 Jan 2015
1 answer
223 views
I'm using the Html5 Report Viewer to display reports generated with ASP.NET MVC. I was able to internationalize most of its content but I struggle with the export-menu (see attachment). The text "CSV (comma delimited) seems to be embedded in the report and being retrieved from the resource "Telerik.Reporting.CsvRendering.CsvRenderingExtension.resx" inside the Telerik.Reporting.dll (ASP.NET MVC). The Telerik.Reporting.dll only contains the english resources.

Where can I get the localized resources (e.g as satellite assemblies)  or what's the easiest way to localizing those? (At least German and French would be helpful to start with)

Thanks a lot!


Hinata
Top achievements
Rank 1
 answered on 28 Jan 2015
5 answers
273 views
I've got an existing RESTful API developed to support the rest of our products, I'm wondering if there is a way to use the reporting services with that. The API is written in c# and uses ServiceStack, satisfying many of the requirements for the reporting services.

Following the guide here seems to have been a good start: http://www.telerik.com/help/reporting/telerik-reporting-rest-servicestack-hosting-iis.html

The trouble I'm running into is that ReportsHostBase seems to derive from the ServiceStack class AppHostBase. Obviously our existing project already has an AppHostBase instance, so I can't use the Init member of ReportsHostBase. It appears as if Init creates a report resolver as well as some sort of cache provider.

So I guess my question is this... Has anybody ever added Telerik reporting services to an existing ServiceStack project? 
Stef
Telerik team
 answered on 28 Jan 2015
7 answers
167 views
Hi

We are using telerik reporting (the pre HTML5 release)

When you export to word from telerik reporting on a webforms report viewer application onto a PC the images and reporting are perfect. However when exporting to word (docx) onto a mac of all types, the images are shrunk??? When I load the file that was not working on my mac onto a pc the images work again?

See attached image example.

Thanks
Duncan
Stef
Telerik team
 answered on 27 Jan 2015
1 answer
174 views
We are running into a problem where our users will see a Null Reference Exception message ("Object reference not set to an instance of an object") when they switch to (or from) Print Preview mode after the report has "expired".  Sometimes the report will expire because they waited too long (I think 20 minutes is the timeout on most of our servers) or if IIS happened to recycle while they were working on the report.  For other operations (such as changing pages), the user gets a friendly message that says: "Report is unavailable or session has expired".  It would be nice if they got a similiar friendly message in the Print Preview case.

We are on a slightly old version of Reporting but I've verified the bug is in the latest version (Q3 2014 SP1).  We use the Silverlight report viewer.

To reproduce the problem, run a report.  Then on the server you can execute the following method to clear out the cache (simulating IIS recycling or the session timing out):

        private void ClearCache()
        {
            var cache = System.Web.HttpContext.Current.Cache;
            var enumerator = cache.GetEnumerator();
            while (enumerator.MoveNext())
            {
                cache.Remove((string)enumerator.Key);
            }
        }

Then when you go to Print Preview mode, you'll see the error.  Screenshot attached.

Stef
Telerik team
 answered on 26 Jan 2015
8 answers
259 views
Hello,

  I use "ColumnHeadersPrintOnEveryPage" setting to repeat column headers on each page in the report.
  It sucessfully works when I export the report to PDF or Word, but unfortunately does not work when I export it into Excel.
  
  Is it possible to mark some rows in the report do be repeated on each page in Excel during exporting to excel (see picture)?

Thanks,
-Andrey Popov
Stef
Telerik team
 answered on 24 Jan 2015
5 answers
1.7K+ views
The report preview in the designer does not display any report data if the sqldatasource attached returns an empty resultset.

I created a blank report and added one textbox to the report header and clicked "Preview" in the designer.  The textbox is displayed as expected.  But if I add a sqldatasource whose result set is empty nothing displays in the preview.  If the resultset is not empty and returns data then my textbox is displayed in the preview as expected.

I would like for my report to show the static fields even if the sqldatasource returns with an empty resultset.

Thanks,

Matt
Stef
Telerik team
 answered on 24 Jan 2015
5 answers
224 views
I'm using silverlight reports and my users are asking if I can disable the 'Document Ready. Continue with print?' dialog.  They want to reduce the number of clicks.  They want it to go straight to the OS select a printer screen (I can't get away from that one). I know it sounds minor, but my users always print results instead of writing the results to a file.
KS
Top achievements
Rank 1
 answered on 24 Jan 2015
1 answer
482 views
Hi,

I am using Visual Studio 2012 for designing telerik reports. I have to use property window to format reports like applying background color, fonts, colors etc.

Is there any way that I can enable telerik designer toolbar on the visual studio so that it will be quicker to apply styles?

I have tried to enable all toolbars available on studio but did not find any for telerik report designer. Please find the attached for more details.

Please suggest.

Thanks,
Hardik
Stef
Telerik team
 answered on 24 Jan 2015
1 answer
214 views
We need ITF-14 support for barcode component but there isn't. How can we solve this? Any workaround?
Stef
Telerik team
 answered on 24 Jan 2015
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?