Telerik Forums
Reporting Forum
1 answer
243 views

Can we change the layout of the HTML 5 viewer . Like Parameter at the top of the report instead On right side.

Also I want to display a dropdown box instead of default Listbox for report parameter.

 

Please let me know if it is possible

 

Stef
Telerik team
 answered on 19 Feb 2016
3 answers
326 views

I have a master report with two subreports. The dimensions of each areabout a A4 page. I use two parameters to hide the subreports. So normaly the report should be two pages if both parameters are activated and one page if only one parameter is activated.

But I always got two pages, page one empty if only subreport two is activated and page two empty if only parameter one is activated.

I am using the following bindung für the two subreports

Subreport 1: 

  • Expression: = Parameters.param1.Value
  • Path: Visible

Subreport 2:

  • Expression: = Parameters.param1.Value
  • Path: Visible

What can I do that the subreports will not use any space when visible=false? If I have a look at the 'HTML Redering' the space is empyt, but if I have a look at the print preview or do an export the space ist used.

The problem is that i have to create a Master/SubReport using 50 subreports where the user can select the desired subreports.

Stef
Telerik team
 answered on 19 Feb 2016
1 answer
116 views

Is there a way to trigger a custom action when a user clicks on a record? Basically I have a report view showing several records. When the user clicks on a row, I'd like to execute code based on the row's ID that they clicked. Seems straight forward but I don't see anything in the documentation other than bookmarks and URLs.

Telerik Reporting Q1 2015

VS 2013

VB.net

Stef
Telerik team
 answered on 19 Feb 2016
1 answer
150 views

Is it possible to have a legend based on  series data points?

 

Peter

Katia
Telerik team
 answered on 18 Feb 2016
1 answer
552 views

I have a program that gets some data from a database and prints a report to a printer on schedule. It runs unattended so there can never be user input. I have it printing to the default printer, but I'd like to print to a defined network printer (\\servername\printername). 

 

How can I code that?

Stef
Telerik team
 answered on 17 Feb 2016
6 answers
762 views

Is there any way to export my report as JPEG?

I'm used to designing my report by Telerik ASP.NET MVC report .

Hope to get some helps.
Nasko
Telerik team
 answered on 17 Feb 2016
6 answers
157 views

Hi;

 

I would like to know how to build a report with a customized graph. It is specifically for a customization report but the question is general in the aspect of how to customize a graph. 

 

An attached bitmap has been added witha graph output I'd like to achieve.

 

Peter

 

Stef
Telerik team
 answered on 16 Feb 2016
5 answers
193 views

Hello,
with the latest production release.

  1. Create a new report.
  2. Drag a Table to the details section.
  3. Drag a Panel to a cell of the table

Error message:

Object reference not set to an instance of an object.

Stef
Telerik team
 answered on 15 Feb 2016
1 answer
131 views

I have a site that allows users to upload images to the report. The users can upload as many images as they want and the images get appended to the report.

The report viewer initially contains a report and the users images are appended at the button of the report. The way I append the images: I have created a one page report that has an image in the middle of the report. I iterate through all the image paths and add a new report for each image.

 

Here is an example of when the report processes the error. When a user adds 1 image and renders the report the report view looks great but once they add more images and try to render the report the report view crashes.

Below is the Error and Stack Trace:

URL: /api/Reports/clients/160626-95db/instances/160630-aeac/documents/161216-3e80161216-c106/info

"message":"",
"exceptionMessage":"Index was out of range. Must be non-negative and less than the size of the collection.\r\nParameter name: index",
"exceptionType":"Telerik.Reporting.Services.Engine.DocumentRenderException",
"stackTrace":" at Telerik.Reporting.Services.Engine.Document.GetDocumentInfo()\r\n at Telerik.Reporting.Services.Engine.ReportEngine.GetDocumentInfo(String clientID, String instanceID, String documentID)\r\n at Telerik.Reporting.Services.WebApi.ReportsControllerBase.GetDocumentInfo(String clientID, String instanceID, String documentID)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()"

 

Here is the report:

namespace LT.Services.Reporting.EFV.Reports.Reports.ScannedImage
{
    partial class rptScannedImage
    {
        #region Component Designer generated code
        /// <summary>
        /// Required method for telerik Reporting designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            Telerik.Reporting.Group group1 = new Telerik.Reporting.Group();
            Telerik.Reporting.ReportParameter reportParameter1 = new Telerik.Reporting.ReportParameter();
            Telerik.Reporting.ReportParameter reportParameter2 = new Telerik.Reporting.ReportParameter();
            Telerik.Reporting.ReportParameter reportParameter3 = new Telerik.Reporting.ReportParameter();
            Telerik.Reporting.ReportParameter reportParameter4 = new Telerik.Reporting.ReportParameter();
            Telerik.Reporting.ReportParameter reportParameter5 = new Telerik.Reporting.ReportParameter();
            Telerik.Reporting.ReportParameter reportParameter6 = new Telerik.Reporting.ReportParameter();
            Telerik.Reporting.Drawing.StyleRule styleRule1 = new Telerik.Reporting.Drawing.StyleRule();
            Telerik.Reporting.Drawing.StyleRule styleRule2 = new Telerik.Reporting.Drawing.StyleRule();
            Telerik.Reporting.Drawing.StyleRule styleRule3 = new Telerik.Reporting.Drawing.StyleRule();
            Telerik.Reporting.Drawing.StyleRule styleRule4 = new Telerik.Reporting.Drawing.StyleRule();
            this.groupFooterSection = new Telerik.Reporting.GroupFooterSection();
            this.groupHeaderSection = new Telerik.Reporting.GroupHeaderSection();
            this.detail = new Telerik.Reporting.DetailSection();
            this.pictureBox1 = new Telerik.Reporting.PictureBox();
            ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
            // 
            // groupFooterSection
            // 
            this.groupFooterSection.Height = Telerik.Reporting.Drawing.Unit.Inch(0.0520833320915699D);
            this.groupFooterSection.Name = "groupFooterSection";
            this.groupFooterSection.Style.Visible = false;
            // 
            // groupHeaderSection
            // 
            this.groupHeaderSection.Height = Telerik.Reporting.Drawing.Unit.Inch(0.0520833320915699D);
            this.groupHeaderSection.Name = "groupHeaderSection";
            this.groupHeaderSection.Style.Visible = false;
            // 
            // detail
            // 
            this.detail.Height = Telerik.Reporting.Drawing.Unit.Inch(1.0000008344650269D);
            this.detail.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
            this.pictureBox1});
            this.detail.Name = "detail";
            this.detail.PageBreak = Telerik.Reporting.PageBreak.After;
            // 
            // pictureBox1
            // 
            this.pictureBox1.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(3.9418537198798731E-05D), Telerik.Reporting.Drawing.Unit.Inch(0D));
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(1.0000003576278687D), Telerik.Reporting.Drawing.Unit.Inch(1D));
            this.pictureBox1.Sizing = Telerik.Reporting.Drawing.ImageSizeMode.AutoSize;
            this.pictureBox1.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.None;
            // 
            // rptScannedImage
            // 
            group1.GroupFooter = this.groupFooterSection;
            group1.GroupHeader = this.groupHeaderSection;
            group1.Name = "group";
            this.Groups.AddRange(new Telerik.Reporting.Group[] {
            group1});
            this.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
            this.groupHeaderSection,
            this.groupFooterSection,
            this.detail});
            this.Name = "rptScannedImage";
            this.PageSettings.Margins = new Telerik.Reporting.Drawing.MarginsU(Telerik.Reporting.Drawing.Unit.Inch(0D), Telerik.Reporting.Drawing.Unit.Inch(0D), Telerik.Reporting.Drawing.Unit.Inch(0D), Telerik.Reporting.Drawing.Unit.Inch(0D));
            this.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.Custom;
            this.PageSettings.PaperSize = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(8.5D), Telerik.Reporting.Drawing.Unit.Inch(11D));
            reportParameter1.Name = "PageNumber";
            reportParameter1.Type = Telerik.Reporting.ReportParameterType.Integer;
            reportParameter1.Value = "1";
            reportParameter2.Name = "ImageToAdd";
            reportParameter2.Value = "D:\\KDrive\\LT001\\LT001001\\001000003.tif";
            reportParameter3.Name = "ImageExists";
            reportParameter3.Type = Telerik.Reporting.ReportParameterType.Boolean;
            reportParameter3.Value = "= True";
            reportParameter4.Name = "RegistrationNumber";
            reportParameter4.Value = "000000000";
            reportParameter5.Name = "IsEmbeddedResource";
            reportParameter5.Value = "= False";
            reportParameter6.Name = "FileResourceName";
            reportParameter6.Value = "LT.Services.Reporting.EFV.Reports.Contents.Images.eSubmission_CoverPage.jpg";
            this.ReportParameters.Add(reportParameter1);
            this.ReportParameters.Add(reportParameter2);
            this.ReportParameters.Add(reportParameter3);
            this.ReportParameters.Add(reportParameter4);
            this.ReportParameters.Add(reportParameter5);
            this.ReportParameters.Add(reportParameter6);
            this.Style.BackgroundColor = System.Drawing.Color.White;
            styleRule1.Selectors.AddRange(new Telerik.Reporting.Drawing.ISelector[] {
            new Telerik.Reporting.Drawing.StyleSelector("Title")});
            styleRule1.Style.Color = System.Drawing.Color.Black;
            styleRule1.Style.Font.Bold = true;
            styleRule1.Style.Font.Italic = false;
            styleRule1.Style.Font.Name = "Tahoma";
            styleRule1.Style.Font.Size = Telerik.Reporting.Drawing.Unit.Point(18D);
            styleRule1.Style.Font.Strikeout = false;
            styleRule1.Style.Font.Underline = false;
            styleRule2.Selectors.AddRange(new Telerik.Reporting.Drawing.ISelector[] {
            new Telerik.Reporting.Drawing.StyleSelector("Caption")});
            styleRule2.Style.Color = System.Drawing.Color.Black;
            styleRule2.Style.Font.Name = "Tahoma";
            styleRule2.Style.Font.Size = Telerik.Reporting.Drawing.Unit.Point(10D);
            styleRule2.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
            styleRule3.Selectors.AddRange(new Telerik.Reporting.Drawing.ISelector[] {
            new Telerik.Reporting.Drawing.StyleSelector("Data")});
            styleRule3.Style.Font.Name = "Tahoma";
            styleRule3.Style.Font.Size = Telerik.Reporting.Drawing.Unit.Point(9D);
            styleRule3.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
            styleRule4.Selectors.AddRange(new Telerik.Reporting.Drawing.ISelector[] {
            new Telerik.Reporting.Drawing.StyleSelector("PageInfo")});
            styleRule4.Style.Font.Name = "Tahoma";
            styleRule4.Style.Font.Size = Telerik.Reporting.Drawing.Unit.Point(8D);
            styleRule4.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
            this.StyleSheet.AddRange(new Telerik.Reporting.Drawing.StyleRule[] {
            styleRule1,
            styleRule2,
            styleRule3,
            styleRule4});
            this.Width = Telerik.Reporting.Drawing.Unit.Inch(1.0000393390655518D);
            this.ItemDataBinding += new System.EventHandler(this.rptScannedImage_ItemDataBinding);
            ((System.ComponentModel.ISupportInitialize)(this)).EndInit();

        }
        #endregion

        private Telerik.Reporting.DetailSection detail;
        private Telerik.Reporting.GroupHeaderSection groupHeaderSection;
        private Telerik.Reporting.GroupFooterSection groupFooterSection;
        private Telerik.Reporting.PictureBox pictureBox1;

    }
}

Here is the location I add the image to the report

public partial class rptScannedImage : Telerik.Reporting.Report
    {
        private static readonly CacheHelper _cacheHelper = CacheHelper.Instance;
        private Object thisLock = new Object();


        public rptScannedImage()
        {
            //
            // Required for telerik Reporting designer support
            //
            InitializeComponent();
            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }
        private void rptScannedImage_ItemDataBinding(object sender, EventArgs e)
        {
            lock (thisLock)
            {
                bool imageExists = (bool)this.ReportParameters["ImageExists"].Value;
                int pageNumber = (int)this.ReportParameters["PageNumber"].Value;
                string imageFile = (string)this.ReportParameters["ImageToAdd"].Value;
                bool isEmbeddedResource = (bool)this.ReportParameters["IsEmbeddedResource"].Value;
                string fileResourceName = (string)this.ReportParameters["FileResourceName"].Value;

                if (!imageExists)
                {
                    var txtNotAvailable = new Telerik.Reporting.TextBox();
                    txtNotAvailable.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(0.5D), Telerik.Reporting.Drawing.Unit.Inch(2.5D));
                    txtNotAvailable.Name = "txtNotAvailable";
                    txtNotAvailable.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(7.5D), Telerik.Reporting.Drawing.Unit.Inch(5.5));
                    txtNotAvailable.Style.Font.Name = "Times New Roman";
                    txtNotAvailable.Style.Font.Size = Telerik.Reporting.Drawing.Unit.Point(72D);
                    txtNotAvailable.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center;
                    txtNotAvailable.Value = "Dummy Registered Document Image for " + (string)this.ReportParameters["RegistrationNumber"].Value;
                    this.detail.Items.Add(txtNotAvailable);
                }
                else
                {
                    Image image = null;
                    // if it's not an embedded resourece 
                    if (!isEmbeddedResource)
                    {
                        // we need to clone the image for thread safety
                        image = ReportDataMethod.GetImage(imageFile);
                    }
                    else
                    {
                        image = Reporting.EFV.Reports.ReportDataMethod.GetImageFromResource(fileResourceName);
                    }

                    double width = image.Width / image.HorizontalResolution;
                    double height = image.Height / image.VerticalResolution;
                    SizeU size = new SizeU(Unit.Inch(width), Unit.Inch(height));
                    Telerik.Reporting.Processing.Report rpt = (Telerik.Reporting.Processing.Report)sender;
                    rpt.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.Custom;
                    rpt.PageSettings.PaperSize = size;

                    pictureBox1.MimeType = "image/png";
                    pictureBox1.Value = image;
                }
            }
        }

 

Here is the way I append the images in the resolver

    // Add File Attachment to report
                            // Attach image files as pages
// Gets the paths
                            var pngImagePaths = ReportDataMethod.GetFilePaths(eFormID);
                            if (pngImagePaths != null)
                            {
                                var pageCountID = 1;
                                foreach (var imagePath in pngImagePaths)
                                {
                                    // Add cover page (Eventually we will add this to all E-Forms
                                    // Add scanned file
                                    // note that setting filePath or File Resource Name to null will
                                    // cause the preview to crash on reload
                                    PDFToImageParameters fileParams = new PDFToImageParameters()
                                    {
                                        FilePath = imagePath,
                                        FileResourceName = "",
                                        ImageExists = true,
                                        IsEmbeddedResource = false,
                                        PageCount = pageCountID
                                    };
                                    var fileReport = UpdateScannedImageReportWithParams(eFormID, pageCountID == 1 ? "File Attachment" : String.Empty, pageCountID++, fileParams);
                                    book.Reports.Add(fileReport);
                                }
                            }

 

Any help would be appreciated.

 

Thanks!

 

Stef
Telerik team
 answered on 15 Feb 2016
1 answer
184 views

Hi,

I'm getting error - Value cannot be null. Parameter name: instance, after I upgraded my solution to the current telerik reports verson. Can you please let me know how I can fix this issue.

Please see the attached file for more information.

 

Thanks.

 

 

Stef
Telerik team
 answered on 15 Feb 2016
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?