Telerik Forums
Reporting Forum
1 answer
78 views
Please disregard my message, I have solved the problem in some other way.
Hadib Ahmabi
Top achievements
Rank 1
 answered on 15 Feb 2012
4 answers
198 views
We are evaluating Telerik Reporting for use in a web application that will run on a shared host.  This project requires us to email specific reports to users at specific times during the day.

Is there any functionality available in Telerik Reporting to manage automated generation and devlivery of reports according to a schedule?
Steve
Telerik team
 answered on 15 Feb 2012
2 answers
668 views
Hi,

I'm wonder how to merge a column cells of a Table.
Please view the attached screen-shot in order to get a best understanding of the requirements.

The crosstab control doesn't meet my requirements, so I need to implement the idea only using the Table control.

Please, I need your help,

Regards,
Bader

Bader
Top achievements
Rank 1
 answered on 15 Feb 2012
2 answers
279 views
Hi,

I'm using the following code in order export a report to PDF file. The problem is that even a small report with one page only is exported to a PDF file with a size of ~15 MB. How could that be? and how to handle this issue?
/Exports a report to a PDF document
public static void ExportToPDF(Telerik.Reporting.Report reportToExport)
{
ReportProcessor reportProcessor = new ReportProcessor();
RenderingResult result = reportProcessor.RenderReport("PDF", reportToExport, null);
string fileName = result.DocumentName + ".pdf";
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = result.MimeType;
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.Private);
HttpContext.Current.Response.Expires = -1;
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.AddHeader("Content-Disposition", string.Format("{0};FileName=\"{1}\"", "attachment", fileName));
HttpContext.Current.Response.BinaryWrite(result.DocumentBytes);
HttpContext.Current.Response.End();
}


Please, I need your help,

Regards,
Bader
Bader
Top achievements
Rank 1
 answered on 15 Feb 2012
11 answers
365 views
Hi,

Ever since I upgraded my application to use the latest versions of the Telerik reporting and WPF tools I get an exception every time I try open a window in my application which uses the reportviewer.

Upgraded to 2011.3.1116.35 WPF
Upgraded to 5.3.11.1116 Reporting


XxmlParserException Occured

Could not load file or assembly 'Telerik.Windows.Controls.Navigation, Version=2011.3.1116.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)  Error at object 'System.Windows.Controls.ControlTemplate' in markup file 'Telerik.ReportViewer.Wpf;component/Themes/Default/ReportViewer.xaml'.

I used to Auto update feature. I also manually deleted and added the references to see if that worked. No luck.

Do you have any advice on how I can solve this?

Thanks,

Rob
Steve
Telerik team
 answered on 14 Feb 2012
6 answers
265 views
We have some logos at the top of our report. These have been added to the report through the Properties dialog using the Value property and browsing to the PNG image file. The image is then added to the resources file.

Previewing the report in Visual Studio the icons display.
Viewing the report in the WinForms ReportViewer the icons display.
Viewing the report in the Silverlight ReportViewer the icons do not display.
Exporting the report to PDF from the Silverlight ReportViewer the icons display.

Why would this be?
Adrian
Top achievements
Rank 1
 answered on 14 Feb 2012
1 answer
91 views

Hi,

 

I'm trying to build the report out of large numeric table dynamically created of database.

It's grouped by hierarchy of 4 elements created of database dynamically. 3 Bottom levels should have total Column And calculated average column.

Sort of:

 

                                Building

                |                                |                         |              

Floor Number          Floor Number                Floor Number

|              |         |                         |                                 |             |

Room Room Room          Room                    Room          Room

||||||||||||||||           ||||                       ||||||||||||||||

Tenants                                Tenants                                Tenants


I have excel file to show the structure , but cant upload.
How can I upload excel file?


How can I build report like that?

Thank you.

Elian
Telerik team
 answered on 13 Feb 2012
2 answers
133 views
Hi

I'm using Razor to create a view in MVC 3 C#.  I'm looking to convert that view to .pdf for saving or printing.  Is it possible to do this with the Telerik controls?  If it is, could you direct me to a tutorial.

Thanks
Bobman
Top achievements
Rank 1
 answered on 13 Feb 2012
3 answers
179 views


Dear Telerik team ,

                  I have implemented the  below code for external print button functionality in silverlight with a report having more than 20 pages. I have tested this using XPS printer I have found few of the pages are not printed correctly. Out of 20 pages I have found 2 pages are printing partially every time.(Page 7 and page 14). if the chart size increase it is becoming more worse.
Is is possible to show a progress bar before print dialog appears.
 I have attached the screen shot for your reference.  Please help on this issue.


MainPage.cs 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;
using Telerik.ReportViewer.Silverlight;
using Telerik.Reporting.Service.SilverlightClient;
using System.ServiceModel;
using Telerik.Reporting.Service;
using System.Runtime.Serialization;
using System.IO;
using System.Text;
using System.Windows.Printing;
using System.Windows.Media.Imaging;
using System.Windows.Markup;
using System.Collections.ObjectModel;
 
namespace ReportsSample
{
    
    public partial class MainPage : UserControl, IReportServiceClientFactory
    {
 
 
      
        public MainPage()
        {
            InitializeComponent();
           
 
           
 
 
            this.rptViewer.ReportServiceClientFactory = this;
            this.rptViewer.RenderBegin += new RenderBeginEventHandler(rptViewer_RenderBegin);      
        }
 
 
     
 
        ReportViewerModel viewerModel;
        ReportViewerModel ViewerModel
        {
            get
            {
                if (viewerModel == null && VisualTreeHelper.GetChildrenCount(this.rptViewer) > 0)
                {
                    var layoutRoot = (FrameworkElement)VisualTreeHelper.GetChild(this.rptViewer, 0);
                    viewerModel = (ReportViewerModel)layoutRoot.DataContext;
                }
                return viewerModel;
            }
        }
 
 
        void rptViewer_RenderBegin(object sender, RenderBeginEventArgs args)
        {
            this.rptViewer.RenderBegin -= this.rptViewer_RenderBegin;          
            this.ViewerModel.PropertyChanged += this.ViewerModel_PropertyChanged;
        }
 
 
        void ViewerModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            //if (e.PropertyName == "State" && IsReadyToPrint())
            //{
            //    this.ViewerModel.PropertyChanged -= this.ViewerModel_PropertyChanged;
            //    this.PrintReport();
            //}
        }
 
        bool IsReadyToPrint()
        {
            return this.ViewerModel.State == ReportViewerStates.ViewerPage;
        }
 
        void PrintReport()
        {
            this.viewerModel.PrintReportCommand.Execute(null);
        }
 
      
 
        #region IReportServiceClientFactory Members
 
        ReportServiceClient IReportServiceClientFactory.Create(System.Uri remoteAddress)
        {
           // remoteAddress = new Uri("../Reports/ReportService.svc", UriKind.RelativeOrAbsolute);
            var binding = new BasicHttpBinding()
            {
                MaxBufferSize = int.MaxValue,
                MaxReceivedMessageSize = int.MaxValue,
                ReceiveTimeout = new TimeSpan(0, 15, 0),
                SendTimeout = new TimeSpan(0, 15, 0)
            };
 
            var endpointAddress = new EndpointAddress(remoteAddress);
 
            return new ReportServiceClient(binding, endpointAddress);
 
        }
        #endregion
 
 
 
 
      
 
        
 
 
 
 
 
 
 
 
 
 
     
        Collection<Canvas> pagesList;
        string instanceID;
        private void btnPritNew_Click(object sender, RoutedEventArgs e)
        {
 
            try
            {
 
                this.ViewerModel.PropertyChanged -= this.ViewerModel_PropertyChanged;
                this.PrintReport();
            }
            catch(Exception ex)
            {
            }
 
 
 
        }
 
 
       
 
        
 
 
 
    }
}
public class ReportSettingsMaster
{
    public int CodeId { get; set; }
 
    public string CodeName { get; set; }
 
    public string CodeKey { get; set; }
}



Report.cs
#region [Assemblies References]
using System;
using Telerik.Reporting;
using Telerik.Reporting.Drawing;
using System.Data;
using System.Collections.Generic;
using Telerik.Reporting.Charting;
using Telerik.Reporting.Charting.Styles;
using System.Runtime.Serialization;
using System.IO;
using System.Text;
using System.Drawing;
using System.Linq;
#endregion
namespace Telstrat.Reports
{
    /// <summary>
    /// Summary description for Report1.
    /// </summary>
    public partial class SampleEvaluationsReport : Telerik.Reporting.Report
    {
          DataTable dtResults = new DataTable();
 
        #region [Constructor]
          public SampleEvaluationsReport()
        {
            //Providing the DataSource event for the report         
            InitializeComponent();
 
            for (int i = 0; i < 15; i++)
            {
 
                dtResults.Columns.Add(" Column " + i.ToString(), i == 0 ? typeof(string) : typeof(int));
            }
 
            for (int i = 0; i < 70; i++)
            {
                Random r = new Random();
                dtResults.Rows.Add(new object[] { "Chart Series "+i.ToString(),
                                                  r.Next(100),
                                                  r.Next(100),
                                                  r.Next(100),
                                                  r.Next(100),
                                                  r.Next(100),
                                                  r.Next(100),
                                                  r.Next(100),
                                                  r.Next(100),
                                                  r.Next(100),
                                                  r.Next(100),
                                                  r.Next(100),
                                                  r.Next(100),
                                                  r.Next(100),                                                 
                                                  r.Next(100) }
                                                   );
            }
            generateChart(dtResults,1,2); 
 
 
        }
        #endregion
 
        #region [generateChart]
 
        private float _standardHeight = 11.7f;
        private double _reportMargin = 0;
        private int formatedLabelmaxlength = 0;
        private int formatedLabelmaxdepth = 0;
        private string formatTextWrap(string sourceText)
        {
            int divider = 80;
 
            string[] sourceTextlist = sourceText.Split(' ');
 
            int lineCount = 0;
            string strResultText = string.Empty;
            string strLine = string.Empty;
            foreach (string strWord in sourceTextlist)
            {
 
                if (strLine.Length < divider)
                {
                    strLine += strWord + " ";
                    formatedLabelmaxlength = formatedLabelmaxlength < strLine.Length ? strLine.Length : formatedLabelmaxlength;
                }
                else
                {
                    formatedLabelmaxlength = formatedLabelmaxlength < strLine.Length ? strLine.Length : formatedLabelmaxlength;
                    lineCount++;
                    strResultText += strLine + "\n";
                    strLine = string.Empty;
 
                }
 
 
            }
 
            if (strLine.Length > 0)
            {
                strResultText += strLine;
            }
 
            formatedLabelmaxdepth = formatedLabelmaxdepth < lineCount ? lineCount : formatedLabelmaxdepth;
 
 
            return strResultText;
 
 
 
        }
 
 
        private void generateChart(DataTable dtResults, int chartType, int GraphType)
        {
 
            ChartSeriesType CurrentChartType = ChartSeriesType.Bar;
            ChartSeriesOrientation ChartOrientation = ChartSeriesOrientation.Vertical;
            float reportWidth = 5;
            float reportHeight = 5;
            float xAxisMargin = 0f;
            float xAxisLableMargin = 0f;
 
 
 
            int xAxisRotationAngle = 0;
            AlignedPositions xAxisTextAlignedPositions = AlignedPositions.Left;
            AlignedPositions xAxisLabelAlignedPositions = AlignedPositions.Top;
            AlignedPositions xAxisAxisLabel = AlignedPositions.Top;
 
 
            #region Format Data
            for (int i = 0; i < dtResults.Rows.Count; i++)
            {
                dtResults.Rows[i][0] = formatTextWrap(dtResults.Rows[i][0].ToString());
            }
            #endregion
 
            #region Graph Type
            switch (chartType)
            {
                case 1://Column
                    CurrentChartType = ChartSeriesType.Bar;
                    ChartOrientation = ChartSeriesOrientation.Vertical;
                    xAxisTextAlignedPositions = AlignedPositions.Left;
                    xAxisLabelAlignedPositions = AlignedPositions.Top;
                    xAxisAxisLabel = AlignedPositions.Top;
                    xAxisRotationAngle = 270;
 
                    break;
                case 2: //Bar
                    CurrentChartType = ChartSeriesType.Bar;
                    ChartOrientation = ChartSeriesOrientation.Horizontal;
                    xAxisTextAlignedPositions = AlignedPositions.Left;
                    xAxisLabelAlignedPositions = AlignedPositions.Right;
                    xAxisAxisLabel = AlignedPositions.Left;
                    xAxisRotationAngle = 0;
 
                    #region Reverse the Data
 
                    DataTable clonedtResults;
                    clonedtResults = dtResults.Clone();
                    for (int intRow = dtResults.Rows.Count - 1; intRow >= 0; intRow--)
                    {
                        clonedtResults.ImportRow(dtResults.Rows[intRow]);
                    }
                    dtResults.Rows.Clear();
                    foreach (DataRow dr in clonedtResults.Rows)
                    {
                        dtResults.ImportRow(dr);
                    }
 
                    #endregion
                    break;
                case 3: //Line                   
                    CurrentChartType = ChartSeriesType.Line;
                    ChartOrientation = ChartSeriesOrientation.Vertical;
                    xAxisTextAlignedPositions = AlignedPositions.Left;
                    xAxisLabelAlignedPositions = AlignedPositions.Top;
                    xAxisAxisLabel = AlignedPositions.Top;
                    xAxisRotationAngle = 270;
 
                    break;
                default: break;
            }
 
 
 
            #endregion
 
 
            int totalBarCount = dtResults.Rows.Count * (dtResults.Columns.Count - 1);
            int maxXAxisTextlength = formatedLabelmaxlength > 80 ? 80 : formatedLabelmaxlength;
            GetChartProperties(ChartOrientation, totalBarCount, maxXAxisTextlength, ref reportWidth, ref reportHeight, ref  xAxisMargin, ref xAxisLableMargin);
 
 
 
            #region Chart Formating
 
            this.chartGeneric.Skin = "Mac";
            this.chartGeneric.AutoLayout = false;            
            this.chartGeneric.AutoTextWrap = false;
            this.chartGeneric.BitmapResolution = 96F;
           
            this.chartGeneric.ImageFormat = System.Drawing.Imaging.ImageFormat.Png;  
            this.chartGeneric.ChartTitle.Visible = false;
 
            this.chartGeneric.PlotArea.Appearance.Position.X = 0;
            this.chartGeneric.PlotArea.Appearance.Position.Y = 0;
            this.chartGeneric.PlotArea.Chart.Appearance.Position.X = 0;
            this.chartGeneric.PlotArea.Chart.Appearance.Position.Y = 0;
 
            this.chartGeneric.PlotArea.EmptySeriesMessage.TextBlock.Text = "There is nothing to display";
            this.chartGeneric.PlotArea.XAxis.AxisLabel.Visible = true;
            this.chartGeneric.PlotArea.YAxis.AxisLabel.Visible = true;
            this.chartGeneric.SeriesOrientation = ChartOrientation;
            this.chartGeneric.PlotArea.XAxis.AxisLabel.Appearance.Dimensions.Margins = new ChartMargins(0);
            this.chartGeneric.PlotArea.XAxis.AxisLabel.Appearance.Dimensions.Paddings = new ChartPaddings(0);
 
            this.chartGeneric.PlotArea.XAxis.AutoShrink = false;
            this.chartGeneric.PlotArea.XAxis.AutoScale = false;
 
 
            this.chartGeneric.PlotArea.XAxis.Appearance.TextAppearance.MaxLength = 255;
            this.chartGeneric.PlotArea.XAxis.Appearance.TextAppearance.AutoTextWrap = AutoTextWrap.False;
            this.chartGeneric.Appearance.TextQuality = TextQuality.SystemDefault;
            this.chartGeneric.PlotArea.XAxis.Appearance.Color = Color.Black;
 
 
            this.chartGeneric.PlotArea.XAxis.LayoutMode = ChartAxisLayoutMode.Between;
            this.chartGeneric.DefaultType = CurrentChartType;
 
            this.chartGeneric.PlotArea.XAxis.AxisLabel.TextBlock.Text =  dtResults.Columns[0].ColumnName;
            this.chartGeneric.PlotArea.YAxis.AxisLabel.TextBlock.Text = "(in numbers) ";
 
 
            this.chartGeneric.PlotArea.Appearance.Dimensions.Margins.Top = 50;
            this.chartGeneric.PlotArea.Appearance.Dimensions.Margins.Right = 250;
 
            this.chartGeneric.Appearance.BarWidthPercent = totalBarCount > 5 ? 100 : 20;
            this.chartGeneric.Appearance.BarOverlapPercent = -10;
 
 
 
            this.chartGeneric.PlotArea.XAxis.AxisLabel.Appearance.Dimensions.Margins.Left = new Telerik.Reporting.Charting.Styles.Unit(5);
 
 
            this.chartGeneric.PlotArea.XAxis.Appearance.TextAppearance.Position.AlignedPosition = xAxisTextAlignedPositions;
            this.chartGeneric.PlotArea.XAxis.Appearance.LabelAppearance.Position.AlignedPosition = xAxisLabelAlignedPositions;
            this.chartGeneric.PlotArea.XAxis.AxisLabel.Appearance.Position.AlignedPosition = xAxisAxisLabel;
 
 
            this.chartGeneric.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = xAxisRotationAngle;
 
 
            this.chartGeneric.PlotArea.Appearance.Dimensions.Margins.Left = 50;
 
            if (ChartOrientation == ChartSeriesOrientation.Vertical)
            {
                this.chartGeneric.PlotArea.Appearance.Dimensions.Margins.Left = 50;
                this.chartGeneric.PlotArea.Appearance.Dimensions.Margins.Bottom = xAxisMargin;
                this.chartGeneric.PlotArea.XAxis.Appearance.TextAppearance.Dimensions.Margins.Bottom = xAxisLableMargin;
 
            }
            else
            {
 
                this.chartGeneric.PlotArea.Appearance.Dimensions.Margins.Left = xAxisMargin;
                this.chartGeneric.PlotArea.Appearance.Dimensions.Margins.Bottom = 50;
                this.chartGeneric.PlotArea.XAxis.Appearance.TextAppearance.Dimensions.Margins.Left = xAxisLableMargin;
 
            }
 
            #endregion
 
            #region Legend Formating
            this.chartGeneric.Legend.Appearance.Position.AlignedPosition = AlignedPositions.TopRight;
            this.chartGeneric.Legend.Appearance.Dimensions.Margins = new ChartMargins(5);
            this.chartGeneric.Legend.Appearance.Dimensions.Paddings = new ChartPaddings(5);
            this.chartGeneric.Legend.Appearance.Overflow = Overflow.Column;
            this.chartGeneric.Legend.Appearance.Dimensions.Width = 75;
            this.chartGeneric.Legend.Appearance.ItemTextAppearance.AutoTextWrap = AutoTextWrap.True;
            this.chartGeneric.Legend.Appearance.Location = LabelLocation.OutsidePlotArea;
            this.chartGeneric.Legend.Appearance.ItemTextAppearance.Position.AlignedPosition = AlignedPositions.Top;
 
            #endregion
 
 
            #region Chart Series
 
            chartGeneric.Series.Clear();
            chartGeneric.DataSource = dtResults;
            List<ChartSeries> chartSeries = new List<ChartSeries>();
            chartGeneric.PlotArea.XAxis.DataLabelsColumn = dtResults.Columns[0].ColumnName.Trim();
            for (int counter = 1; counter < dtResults.Columns.Count; counter++)
            {
                ChartSeries series = new ChartSeries()
                {
                    DataYColumn = dtResults.Columns[counter].ColumnName,
                    Name = dtResults.Columns[counter].Caption,
                    YAxisType = ChartYAxisType.Primary,
                    Type = chartGeneric.DefaultType
 
                };
 
                //series.Appearance.FillStyle.FillType = FillType.Gradient;
                series.Appearance.LabelAppearance.LabelLocation = Telerik.Reporting.Charting.Styles.StyleSeriesItemLabel.ItemLabelLocation.Inside;
                //series.Appearance.TextAppearance.FillStyle.MainColor = Color.White;
                //series.Appearance.TextAppearance.FillStyle.FillType = FillType.Solid;
                if (ChartOrientation == ChartSeriesOrientation.Vertical)
                {
                    series.Appearance.LabelAppearance.Position.AlignedPosition = AlignedPositions.Top;
 
                }
                else
                {
                    series.Appearance.LabelAppearance.Position.AlignedPosition = AlignedPositions.Right;
                }
                series.Appearance.BarWidthPercent = 90;
                series.Appearance.TextAppearance.TextProperties.Color = Color.Black;
                series.Appearance.TextAppearance.Dimensions.Margins = new ChartMargins(0);
                series.Appearance.TextAppearance.Dimensions.Paddings = new ChartPaddings(0);
                //series.Appearance.TextAppearance.TextProperties.Font = new System.Drawing.Font(FontFamily.GenericSansSerif, 12, GraphicsUnit.Pixel);
 
                chartSeries.Add(series);
            }
 
            // add the series to the chart, chart to page.
            chartGeneric.Series.AddRange(chartSeries.ToArray());
 
            #endregion
 
            #region Chart Dimensions
 
            this.chartGeneric.Docking = DockingStyle.None;
            this.chartGeneric.Appearance.Position.AlignedPosition = AlignedPositions.Center;
            this.chartGeneric.Location = new PointU(new Telerik.Reporting.Drawing.Unit(0), new Telerik.Reporting.Drawing.Unit(0));
            this.chartGeneric.Width = new Telerik.Reporting.Drawing.Unit(reportWidth, Telerik.Reporting.Drawing.UnitType.Inch);
            this.chartGeneric.Height = new Telerik.Reporting.Drawing.Unit(reportHeight, Telerik.Reporting.Drawing.UnitType.Inch);
 
            //this.chartGeneric.Width = new Telerik.Reporting.Drawing.Unit(8, Telerik.Reporting.Drawing.UnitType.Inch);
            //this.chartGeneric.Height = new Telerik.Reporting.Drawing.Unit(10, Telerik.Reporting.Drawing.UnitType.Inch);
 
            #endregion
 
            #region Page Dimensions
            this.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.Custom;
            this.PageSettings.Landscape = true;
            this.PageSettings.PaperSize = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(8.27, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(11.69f, Telerik.Reporting.Drawing.UnitType.Inch));
 
 
            //this.PageSettings.PaperSize = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(reportWidth + 0.5, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(reportHeight + 1.0 + this.pageHeaderSection1.Height.Value, Telerik.Reporting.Drawing.UnitType.Inch));
 
            //this.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.Custom;
            //Setting the page Width and Height
 
            // this.PageSettings.PaperSize = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(7.0f + 0.5, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(10.25f, Telerik.Reporting.Drawing.UnitType.Inch));
 
 
 
            //if (GraphType == 2)
            //{
            //    this.PageSettings.PaperSize = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(reportWidth + 0.5, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(_standardHeight, Telerik.Reporting.Drawing.UnitType.Inch));
            //}
            //else
            //{
            //    this.PageSettings.PaperSize = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(_standardHeight, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(reportHeight + 1.0 + this.pageHeaderSection1.Height.Value, Telerik.Reporting.Drawing.UnitType.Inch));
            //}
 
 
            //this.PageSettings.PaperSize = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(10, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(12, Telerik.Reporting.Drawing.UnitType.Inch));
                //       this.PageSettings.Landscape = true;
//            this.PageSettings.PaperSize = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(10, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(reportHeight + 1.0 + this.pageHeaderSection1.Height.Value, Telerik.Reporting.Drawing.UnitType.Inch));
 
            #endregion
 
 
 
        }
 
        private void GetChartProperties(ChartSeriesOrientation objChartOrientation, int totalBarCount, int maxXAxisTextlength, ref float reportWidth, ref float reportHeight, ref float xAxisMargin, ref float xAxisLableMargin)
        {
 
            if (objChartOrientation == ChartSeriesOrientation.Horizontal)
            {
                float tempwidth = reportWidth;
                reportWidth = reportHeight;
                reportHeight = tempwidth;
            }
 
 
 
            xAxisMargin = (maxXAxisTextlength * 7) + 60;
            xAxisLableMargin = (maxXAxisTextlength * 6) + 10;
 
 
 
            if (objChartOrientation == ChartSeriesOrientation.Vertical)
            {
                if (maxXAxisTextlength > 50)
                {
                    reportHeight += (float)(6 - (reportWidth - (maxXAxisTextlength * 0.0625)));
                }
                if (formatedLabelmaxdepth < totalBarCount)
                {
 
                    if (totalBarCount > 5)
                    {
                        //reportWidth += (float)reportWidth + (totalBarCount - 3) / 9;
                        reportWidth += (float)reportWidth + (totalBarCount * .3f);
                    }
                }
                else
                {
                    if (formatedLabelmaxdepth > 3)
                    {
                        reportWidth += (float)reportWidth + (formatedLabelmaxdepth * .1f);
                    }
                }
            }
            else
            {
                if (maxXAxisTextlength > 50)
                {
                    reportWidth += (float)(8 - (reportWidth - (maxXAxisTextlength * 0.0625)));
 
                }
                if (formatedLabelmaxdepth < totalBarCount)
                {
 
                    if (totalBarCount > 5)
                    {
                        // reportHeight += (float)reportHeight + (totalBarCount - 5) / 9;
                        reportHeight += (float)reportHeight + (totalBarCount * .3f);
 
                    }
                }
                else
                {
                    if (formatedLabelmaxdepth > 3)
                    {
                        reportHeight += (float)reportHeight + (formatedLabelmaxdepth * .1f);
                    }
                }
            }
 
 
 
            reportHeight = reportHeight > 300 ? 300 : reportHeight;
            reportWidth = reportWidth > 300 ? 300 : reportWidth;
 
        }
 
        #endregion
    }
}



Thanks.

regards,
Kiran

Peter
Telerik team
 answered on 13 Feb 2012
3 answers
442 views

Hi,

I am facing an issue when the html data show in the telerik report.
I am using Reporting Q3 2011 .
I have placed HTMLTextBox control in the report page.
After I taken html page and read its content to the string  and assigned this string to the
HTMLTextbox obect value.when running report error occurs.
The reason of this error is 'the html' page contains tables.
I am attaching my htmlpage along with this email.
How can generate the report of this html page?
This is an urgent requirement.

Thanks
Sindu.



Steve
Telerik team
 answered on 13 Feb 2012
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?