Telerik Forums
Reporting Forum
2 answers
128 views
I have recently upgraded to Q3 2014 Telerik Reporting.  Now I have an issue with the WinForms ReportViewer that I didn't have before.  In the visual studio report designer, I have setup my reports to be 8.5x11 Letter in Landscape mode.  Report renders correctly and prints correctly in the designer.  However, when I render the report in the WinForms ReportViewer, it appears that it is shrinking the report by about 60%.  I have checked all the report settings at runtime and everything appears to be correct.

Any ideas on why this is happening?

Thanks,

Terry
Nasko
Telerik team
 answered on 05 Feb 2015
1 answer
97 views
I am using the map capabilities along with WellKnownText format to plot countries and build color coded maps.  My customer has the need to export the output to image or PPTX.  He would like each country to be a unique object so that he can manipulate the output.  For example, he may need to remove a country or offset one to highlight it.  Other scenarios include adding custom labels and pointers to call out a country or identify it better.  

Is there a way to create the reports so that each country is a unique image when exported instead of all countries exporting as a single image?
Nasko
Telerik team
 answered on 03 Feb 2015
2 answers
369 views
I've searched through the forums and I've found some threads that come close to my question, but none seem to touch on it specifically.  With that, I apologize if my searching skills lack and this ends up being a re-post.

I'm creating a report whose object data source is a List<Person> which has multiple properties, some of which are generic lists... 

i.e.
public class Person {
    public Person() { }
 
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public List<Address> Addresses { get; set; }
    public List<Phone> Phones { get; set; }
 
}

On the report itself, I'd like to bind to the List<Person> via the ObjectDataSource
As far as the display goes, I'd like to have the person's name, Id, etc show up on one line (which works fine), and have the addresses / phones show up under their respective person's record (whether that's by a table or some other control).

In my searches I've found other people doing sub-reports to accomplish this.  This method seems overly complicated to me, especially when there's a reporting table control that can have its own data source.  It would seem I should be able to bind to the Addresses or Phones property of the Person class currently being bound.

Therefore, my question:
Are sub-reports the only way this layout can be accomplished?  
Am I on the right track with the table control (or some other control) that can used as I mentioned?  If so, any links or examples would be handy.

Thanks in advance




Craig
Top achievements
Rank 1
 answered on 02 Feb 2015
2 answers
162 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
370 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
147 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.0K+ 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
142 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
718 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
347 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
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?