Telerik Forums
Reporting Forum
2 answers
211 views
Hello everyone

In my application I have a Telerik.Reporting.ReportViewer to load a preview of a report. I also have many controls like RadTextBox or RadDropDownList etc. What I'm trying to do is when the user changes the text of a RadTextBox it should reload the ReportViewer. To do this I'm using RefreshReport() method. But when I call this method it loses the focus on the textbox. I already tried refocus the control after calling the RefreshReport() method but this didn't work neither. I found this thread of October 2009:

http://www.telerik.com/forums/winforms-report-viewer-quot-refreshreport-quot-sets-focus

I'm wondering now, 5 years later, if there is a way to prevent losing focus on the control when calling RefreshReport() method?

Ah, if you want to have a look at my code, here it is:

InstanceReportSource report = new InstanceReportSource();
reportSpedi.ReportSource = new Spediauftrag(this);
reportSpedi.RefreshReport();

// active textbox
txtSpediGewicht.Select();

Regards,
Danilo
Danilo
Top achievements
Rank 1
 answered on 02 Feb 2015
2 answers
422 views
The default formatting for HTML5 using Kendo is a select list instead of a drop down.  There is an article here (http://www.telerik.com/help/reporting/html5-report-viewer-howto-custom-parameter-editor.html) that shows how to turn them into dropdowns.  The only problem is when you have cascading parameters (http://www.telerik.com/help/reporting/designing-reports-parameters-cascading-report-parameters.html)  When you change the first dropdown the values of the second dropdown update but the first dropdown's display does not change. I'm trying to figure out how to resolve this issue. I've attached my report to show the cascading parameters.

Thank you
Michael
Top achievements
Rank 1
 answered on 30 Jan 2015
1 answer
176 views
You can see in the attachment that I changed the PageSettings to Landscape.

The PaperSize remained 210 X297. Should this change to 297 X 210?

I do not seem to be able to view anything to the right of 210.

Thanks,
John
Stef
Telerik team
 answered on 30 Jan 2015
6 answers
3.5K+ views
I am trying to configure Telerik Reporting into MVC application.
The things which are done.
1. Installed libraries: Data Access(2014.3.1209.1), Telerik Report (8.2.14.1204), System.Web.Http(5.2.2.0)

2. Registered Reporting route on WebApiConfig.
Telerik.Reporting.Services.WebApi.ReportsControllerConfiguration.RegisterRoutes(config);

3. Added reporting controller
    public class ReportsController : ReportsControllerBase
    {
        protected override IReportResolver CreateReportResolver()
        {
            var reportsPath = HttpContext.Current.Server.MapPath("~/Reports");

            return new ReportFileResolver(reportsPath)
                .AddFallbackResolver(new ReportTypeResolver());
        }

        protected override ICache CreateCache()
        {
            return Telerik.Reporting.Services.Engine.CacheFactory.CreateFileCache();
        }
    }

While building application I am getting this error:
----------------------------------------------------------------------------------------
Unable to load assembly 'Project.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' : Could not load file or assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. General Exception (Exception from HRESULT: 0x80131500)
ExceptionString:
System.SystemException: Unable to load assembly 'Project.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' : Could not load file or assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. General Exception (Exception from HRESULT: 0x80131500) ---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.RuntimeModule.GetTypes()
   at System.Reflection.Assembly.GetTypes()
   at Telerik.OpenAccess.Metadata.MetadataAttributesReader.PrepareMetaModelTypes(Assembly assembly)
   --- End of inner exception stack trace ---
   at Telerik.OpenAccess.Metadata.MetadataAttributesReader.PrepareMetaModelTypes(Assembly assembly)
   at Telerik.OpenAccess.Metadata.MetadataAttributesReader.ReadMetaModel(Assembly assembly)
   at Telerik.OpenAccess.Metadata.AttributesMetadataSource.<>c__DisplayClass1.<FromAssembly>b__0()
   at Telerik.OpenAccess.Metadata.AttributesMetadataSource.CreateModel()
   at Telerik.OpenAccess.Metadata.MetadataSource.GetModelCore(MetadataContainer old)
   at Telerik.OpenAccess.Sdk.Enhancer.Enhancer.CrossDomainRunImpl(AssemblyLoader assemblyLoader)
   at Telerik.OpenAccess.Sdk.Enhancer.EnhancerBase.CrossDomainRun()    C:\Projects\ProjectAbc\Project.Web\obj\Debug\Project.Web.dll    Project.Web

----------------------------------------------------------------------------------------

Yes, this clearly means that mapping is missed out for System.Web.Http but it is being set correctly:
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.2.0" newVersion="5.2.2.0" />
      </dependentAssembly>

From error it seems like, it is related to Data Access but if I comment entire class (ReportsController) from step 3 then it is working fine. Also during upgrade I have cleared cache from every possible location .Net Temp, bin folder, checked proper reference of libraries. This is my first attempt to use Telerik reporting on my existing application.

Please suggest what needs to be done.

Stef
Telerik team
 answered on 30 Jan 2015
2 answers
186 views


1) I am developing a custom Web application to display reports. My IDE is Visual Studio 2013.

2) I am running the current version of Reporting Version=8.2.14.1204 with IE10 as my browser and my reports are overflowing the Reportviewer on the bottom. Oddly enough it is by the same amount as the combined height of the toolbar and parameters area. See uploaded pic. I have tried everything I can think of to solve this issue with no success. Any suggestions would be greatly appreciated.

Stef
Telerik team
 answered on 30 Jan 2015
1 answer
808 views
For a textbox I use

Private Sub nvcQuestion_ItemDataBound(sender As Object, e As EventArgs) Handles nvcQuestion.ItemDataBound
Dim txt As Telerik.Reporting.Processing.TextBox = DirectCast(sender, Telerik.Reporting.Processing.TextBox)
Dim dataObject As Telerik.Reporting.Processing.IDataObject = DirectCast(txt.DataObject, Telerik.Reporting.Processing.IDataObject)
If DirectCast(dataObject("nvcqQuestion"), String) <> "" Then
   txt.Value = dataObject("nvcqQuestion").ToString()
End If
End Sub

For a Checkbox I tried something like the following

Private Sub bitTitle_ItemDataBound(sender As Object, e As EventArgs) Handles bitTitle.ItemDataBound
Dim txt As Telerik.Reporting.Processing.CheckBox = DirectCast(sender, Telerik.Reporting.Processing.CheckBox)
Dim dataObject As Telerik.Reporting.Processing.IDataObject = DirectCast(txt.DataObject, Telerik.Reporting.Processing.IDataObject)
If DirectCast(dataObject("bitTitle"), CheckBox) = True Or False Then
   txt.Checked = dataObject("bitTitle") ????????
End If
End Sub

Can anyone point out the problem and what the correct syntax is?
Thanks,
John
​
Hinata
Top achievements
Rank 1
 answered on 30 Jan 2015
2 answers
431 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
222 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
268 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
165 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
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?