Telerik Forums
Reporting Forum
8 answers
2.0K+ views
Hi,
I have report which has conditional formatting based on clientId. if the clientid is some x, I need to hide some controls. But when I hide these controls, right side controls are moving to left and bottom controls moving to top. How can I fix control's position with out considering other controls visibility. Please help on this.
Steve
Telerik team
 answered on 27 Feb 2012
1 answer
124 views
I get an error(in the designer preview) that reads "An error has occured while processing Report 'MyReport': Unable to cast the type 'System.Nullable '1' to type 'System.Object'. LINQ to Entities only supports casting Entity Data Model primitive types."

I know that this has to do with the datasource I'm choosing to use. I'm 'extending' the model's Entity partial class with a method that should return an enumerable collection of classes that contain my data that I pulled from the model with LINQ. Sort of like the code that is given here: http://www.telerik.com/ClientsFiles/311739_EntityFrameworkDemo.zip

Here's the method I'm using to get data:
public partial class MyDataModelEntities
    {
        public IEnumerable<SessioinReportData> QuerySessionReport()
        {
            var query = from user in this.users
                        from session in this.sessions
                        where user.id.Equals(session.assigned_user_id)
                        select new SessioinReportData
                        {
                            CreatedBy = user.user_name ?? "",
                            SessionType = session.session_type ?? "Unknown",
                            DateEntered = (session.date_entered != null ? session.date_entered.Value.ToString("MM/dd/yyyy") : "n/a"),
                            NumericID = session.numeric_id,
                            Status = session.status
                        };
            return query;
        }
         
    }
 
    /// <summary>
    /// This contains data needed for the report
    /// </summary>
    public class SessioinReportData
    {
        public string CreatedBy { get; set; }
        public string SessionType { get; set; }
        public string DateEntered { get; set; }
        public int NumericID { get; set; }
        public string Status { get; set; }
         
    }

Here's the code for one of the entity objects that I'm using:
namespace MyProject.Web.Model
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.ServiceModel.DomainServices.Hosting;
    using System.ServiceModel.DomainServices.Server;
 
    // The MetadataTypeAttribute identifies sessionMetadata as the class
    // that carries additional metadata for the session class.
    [MetadataTypeAttribute(typeof(session.sessionMetadata))]
    public partial class session
    {
        internal sealed class sessionMetadata
        {
 
            // Metadata classes are not meant to be instantiated.
            private sessionMetadata()
            {
            }
 
            public Nullable<Guid> assigned_user_id { get; set; }
 
            public Nullable<bool> confirm_flag { get; set; }
 
            public Nullable<Guid> created_by { get; set; }
 
            public Nullable<DateTime> date_end { get; set; }
 
            public Nullable<DateTime> date_entered { get; set; }
 
            public Nullable<DateTime> date_modified { get; set; }
 
            public Nullable<DateTime> date_start { get; set; }
 
            public Guid id { get; set; }
 
            public Nullable<Guid> modified_user_id { get; set; }
 
            public string notes { get; set; }
 
            public Nullable<Guid> parent_id { get; set; }
 
            public string session_type { get; set; }
 
            public string status { get; set; }
        }
    }
}

I've tried adjusting for the Nullable types in a dew different ways. Nothing seems to work. If you don't know of any suggestions on how to fix this, at least tell me what you think the problem lies with.
Hrisi
Telerik team
 answered on 27 Feb 2012
3 answers
326 views
i am trying to do a conditional statement in a report that results in a

chr(0252) or a

chr(0251) as the result.  a "x" or a checkmark in wingding font.  using telerik latest reporting and VS 2010.  this works in ssrs vs 2008 but not in telerik.  it does not recognizt the CHR()

An error has occurred while processing TextBox 'textBox87':

The expression contains undefined function call chr().

 
how do yuo do this in telerik reporting?  need this asap

 

 

 

 

Elian
Telerik team
 answered on 27 Feb 2012
1 answer
105 views
I am attempting to export a database of over 1,000 individuals to an excel file. Attached is a screenshot of the results I get when I try to do this. It only displays 10 results at a time for some reason, rather than the entire set of data. Clearly it is not acceptable to repeat this process 300 times (or more as the community continues to expand) to export the entire user database. I was wondering if there was some way to get the program to export the entire list into one excel spreadsheet. Any thoughts/suggestions?
Hadib Ahmabi
Top achievements
Rank 1
 answered on 27 Feb 2012
2 answers
160 views
Hello,

I use a PictureBox to display a dynamic loaded Imagelist (Hardcopyscans) of a Document Manegement System.
Now i need to scale the report automaticaly so it fits the width of the 1st picture in the List.

But i allways got two pages instead of one, because the reportsize seems to be to small for the image.
Or, if i scale up the report size, the image wil be shown to small or does some uggly, scaling - that results in unreadable text.

Also, if i receive a "landscape formated image" the size of the report shuld manage this situation, not cuting off the document in two separate pages.

Right now i use something like this in the NeedDataSource Handler:
if (dicFormat["PageSettigs"] == "Landscape") 
    this.Report.PageSettings.Landscape = true;
else 
    this.Report.PageSettings.Landscape = false;

SizeU u1 =
new SizeU(new Unit(lstImage[0].Width, UnitType.Pixel),
new Unit(lstImage[0].Height, UnitType.Pixel));
this.Report.PageSettings.PaperSize = u1;

The content of the image shuld be printed best in 1:1 size.
Whats the best way to manage this?
Roger
Top achievements
Rank 1
 answered on 27 Feb 2012
0 answers
76 views
Hi,

I'm using the following code in order to group two columns by values.
I have a question regarding this issue: How can merge the grouped cells (Please view the attached image)?

c# code:
static string oldValueStatic = string.Empty;
        static string oldValueStatic2 = string.Empty;
 
        private void Nightly_ItemDataBinding(object sender, EventArgs e)
        {
            oldValueStatic = string.Empty;
            oldValueStatic2 = string.Empty;
        }
 
        public static string CutDuplicates(string data)
        {
 
            if (0 == string.Compare(oldValueStatic, data, true))
            {
                data = string.Empty;
            }
            else
            {
                oldValueStatic = data;
            }
            return data;
        }
 
        public static string CutDuplicates2(string data)
        {
 
            if (0 == string.Compare(oldValueStatic, data, true))
            {
                data = string.Empty;
            }
            else
            {
                oldValueStatic = data;
            }
            return data;
        }

I'm calling the functions as below:
= CutDuplicates(Fields.Env)

It is very appreciated to explain by supplying a step-by-step instructions how to solve the above issue.

Regards,
Bader
Bader
Top achievements
Rank 1
 asked on 26 Feb 2012
2 answers
477 views
I am getting above error when trying to assign below string to HtmlTextBox.

"question 1 (tips: <P><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-AU; mso-fareast-language: EN-US; mso-bidi-language: AR-SA" lang=EN-AU><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-AU; mso-fareast-language: EN-US; mso-bidi-language: AR-SA" lang=EN-AU>After this is</SPAN></SPAN></P>)"

Telerik.Reporting.HtmlTextBox txtBox = new Telerik.Reporting.HtmlTextBox();
txtBox.Value = value;
In the above code value is equal to above string. How can I solve this error?

Also I want to know how to use StripHTMLTags function. Or if there is any other way to remove HTML tags.

HtmlTextBox1.Value = StripHTMLTags(IncomingHTMLText);

Above doesn't work. It gives an error saying that StripHTMLTags  is not found.

Help would be appreciated....
Milen | Product Manager @DX
Telerik team
 answered on 24 Feb 2012
2 answers
106 views
Nevermind.
AccMan
Top achievements
Rank 1
 answered on 24 Feb 2012
1 answer
82 views
I have a report with one parameter, a dropdown list where the length exceeds the width of the report,  when the report is rendered, a scrollbar covers most of the dropdown list parameter.  I'm assuming this is because of some sort of style setting that handles the overflow.  Is there a way to change the displayed width of the dropdown so that this scrollbar does not appear?  As is, the report is virtually unusable.

Elian
Telerik team
 answered on 24 Feb 2012
3 answers
292 views

Hi team, well i have a problem with my report.

My report have 5 pages. I want show de header only in the first page and the footer only in the last page. This is easy i enable the property printOnFirst in the header and printOnLast in the Footer.
Now I want the blank space header and footer to shrink, to report data go well without those spaces, because my header is large

how i can do it ?
Casey
Top achievements
Rank 1
 answered on 23 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?