Showing posts with label Silverlight Reporting. Show all posts
Showing posts with label Silverlight Reporting. Show all posts

Monday, July 29, 2013

[Telerik Reporting] Export to CSV: First column becomes row values

I am creating a dynamic report based on a report template and the fields selected. When I export to csv, the first column has repeating data (of the first column).

Here's my web.config settings:
<configSections>
    <section name="Telerik.Reporting" type="Telerik.Reporting.Processing.Config.ReportingConfigurationSection, Telerik.Reporting, Version=7.0.13.426, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" allowLocation="true" allowDefinition="Everywhere"/>
  </configSections>

  <Telerik.Reporting>
    <Extensions>
      <Render>
        <Extension name="CSV">
          <Parameters>
            <Parameter name="NoHeader" value="false"/>
            <Parameter name="NoStaticText" value="true"/>
          </Parameters>
        </Extension>
      </Render>
    </Extensions>
  </Telerik.Reporting>

in the ReportTemplate.cs: private void table1_ItemDataBinding(object sender, EventArgs e)
        {
... //for loop - iterate all selected fields
   var textBox = new Telerik.Reporting.TextBox();
                            textBox.Name = colHeader;
                            textBox.Size = new SizeU(Unit.Inch(width), Unit.Inch(0.3));
                            textBox.CanGrow = true;
                            textBox.StyleName = "Data";
                            textBox.Value = "=Fields.[" + strColumn + "]";

...
         }

I don't experience this issue in static reports, I have placed this workaround inside the constructor:
       
       public Contracts()
        {
            InitializeComponent();

            this.textBox8.Name = "Contract Number";
            this.textBox9.Name = "Date Contract Received";
            this.textBox10.Name = "Deadline Date";
            this.textBox11.Name = "Date of Original Contract";
            this.textBox12.Name = "Contract Execution Date";
            this.textBox13.Name = "Contract Effective Date";
            this.textBox14.Name = "Contract Expiration Date";
            //this.table1.ItemDataBinding += new EventHandler(table1_ItemDataBinding);
        }

Here's the output:



Found out that what's causing exported CSV's first column to become row values was the obsolete NavigateToReportAction.Parameters for sorting

I commented that part and voila, that solved the problem.



Header Image doesn't Display on Telerik Report through Silverlight Report Viewer

Problem: The header image doesn't display on Telerik Report when viewed through Silverlight Report Viewer. But when exported, the image is being displayed.

Solution: 
From Telerik Reporting KB Article

PROBLEM
Images, Charts, Barcodes and Shapes are not being displayed in the Silverlight report viewer.

DESCRIPTION
When a report is previewed in the Silverlight report viewer, Images, Charts, Barcodes and Shapes are missing, however they are present when exporting to one of the supported formats.

SOLUTION
The most probable reason is missing resource endpoint for the Telerik Reporting WCF Servicethat is responsible for serving all images: Picturebox, Chart, Shapes and Barcodes. For proper configuration please refer to the Hosting WCF Service in IIS help article. 
The Silverlight report viewer lives entirely on the client side, while the report rendering is performed on the server. The XAML rendering extension (used by Silverlight report viewer)streams images as resources (similar to HTML), so if the resource endpoint is missing in the service configuration, the images would not be served. When exporting, images are embeddedin the export file.


For SSL: See How to: Enable SSL for Telerik Reporting WCF service


Related Forum Thread: Embedded Image Resources not rendering in Silverlight ReportViewer

Next:
* Take a look at the Custom Binding and its use on Silverlight Application and Telerik Reporting WCF Service

Monday, September 17, 2012

Silverlight Reporting Solutions: A Quick Comparison

Our Requirement: old Asp.Net solution + Microsoft Reporting to be re-written to Silverlight 5.

Microsoft Reporting is not supported in Silverlight. Hence, a need for displaying the old reports to Silverlight or convert the old reports to Silverlight-compatible reports.

1. Telerik Reporting 
Telerik Reporting provide Silverlight report viewer but their own reporting engine/designer/tool must be used.
Telerik’s report definition can be deserialized from XML. It can cater dynamically created reports.
However, if the client's old reports are created using Microsoft Reporting, these old reports must be converted (migrated) to either Telerik report format.
The only formats in which we can convert Telerik reporting from are crystal, active and xtra reports.

2. DevExpress XtraReports
DevExpress XtraReports is the counterpart of Telerik Reports. I am not sure though if their report is built on XML. Their documentation is not quite good. Same as the Telerik Reports, the old reports must be converted to DevExpress format

One good thing about PerpetuumSoft is that they have Silverlight Viewer for Reporting Services, which displays the reports generated by SSRS directly within Silverlight. However, it’s features are very limited - no serialization support, cannot load dynamic reports, cannot load rdlc files. SSRS is different from Microsoft Reporting.

This provides the foundation in which one can build his own printing and reporting systems in his applications.
This reporting is based on using Silverlight controls to layout the reports. Because of this, the output will be rendered as bitmap, resulting in low print quality and large files being sent to the printer. Being rendered in bitmap, expect very poor performance. The rendering will be too slow.
But since this is custom, one needs to code his own mechanism for pagination, automatic layouting to fit content, manually handle the printing etc.
This is applicable only for simple reports but for complex ones, it can be very difficult and time-consuming!
It has no support for exporting the report to any format. 

My picks:
1. If it's okay to open a new window from Silverlight, then show an Asp.Net page. Then there's no need for conversion. The disadvantage is, it will leave the Silverlight UI and may give an illusion that the user is transferred to another system.

2. Telerik Reporting - well-documented, with serialization support, can cater dynamics, good technical support. The disadvantage - needs conversion so it's time consuming. Write a conversion tool? Microsoft Reporting is totally different to Telerik Reports that's why 'til now, Telerik does not support conversion. Good luck.

How about you? What reporting solution are you using in your Silverlight application?