Telerik Forums
Reporting Forum
1 answer
171 views
Hi,

Can someone please advise me how I can achieve the following:

I have a report whose page orientation is landscape.  I want to print it from my in-browser (IE8) Silverlight 4 application.  I want the print dialog button to appear so the user can choose a printer or change defaults, but I want the report to print in landscape by default (unless the user specifically changed this in the print dialog) and not print according to the printer's defaults. 

If I set UseNativePrinting to false then nothing happens when I press the Report Viewer's print button.  If I create my own button with the following code executing on the click event :
var reportViewerModel = reportViewer.DataContext as ReportViewerModel;
if (reportViewerModel.State.Equals("ViewerPageState"))
{
   reportViewerModel.PrintReportCommand.Execute(null);
}
nothing happens.

This should be easy.  Please help.

Thanks.
Peter
Telerik team
 answered on 14 Dec 2010
1 answer
149 views
Hi, 

I'm currently evaluating your reporting package. I've been able to deploy the report service (the one that does the rendering) successfully on both a self-hosted WCF application as well as IIS-5. I can view my reports successfully when I run the Silverlight Report Viewer in Silverlight's out of browser mode with elevated trust level enabled. 

However, I get a problem when this the elevated trust level option is unchecked or when I run the Silverlight application in it Web mode.  When the report viewer is opened it briefly tries to connect to the report viewer service, but very quickly comes up with the following error: 

"An exception occurred during the operation, making the result invalid.  Check InnerException for exception details."

I'm not sure how to get more info from the error. I'm a little confused as everything works fine in the out of browser mode, but not in the web mode. Is there a difference I need to be aware of, and you do have any suggestions as to a possible solution? 

Thanks. 
Fletcher Aluminium
Top achievements
Rank 1
 answered on 14 Dec 2010
1 answer
56 views
've just created a simple project with 3 reports. 1 Report shows static text. 2nd report shows a list of some entity (assigned as datasource in constructor) of the report class) as follows:
this.DataSource = new List<Test>()
{
new Test(){Name = "hasan"},
new Test(){Name = "Ali"}
};

3rd report just contains two sub report objects in its detail section.

When I run the application I see only one of the sub reports. Can someone check the source at http://www.filedropper.com/telerikreporttest and tell me what the problem is?

If I check preview of individual report, they show the data perfectly fine but something wrong happens on runtime.

Also the behavior seems unpredictable because sometimes it shows data from both the reports but repeats the static text as many times as there are rows in the second subreport. This happens if I change the order of subreports in the detail seciton of Master report.

Thanks

Hasan Khan
Top achievements
Rank 1
 answered on 13 Dec 2010
1 answer
1.1K+ views
Hi,

I have a problem , I can not figurer out / it is not working how to change the background when a date field is not set.(is null)

Here is what I have come yp with so far.....

realizing that the datetime value will be datetime.minvalue when the underlying data is null, I made the following in an formatting rules expression.

=Fields.SyncDate.Date.Ticks < :=1  but nothing happens, 

Any ideas on how to make this happen ?.

Best Ole
Peter
Telerik team
 answered on 13 Dec 2010
2 answers
123 views
How would I create a function using my EntityDiagrams file and a LINQ statement, to bind to a textbox I wasnt to add to my Report?
I tried creating this function in Report1.cs:

public static string myFunction( )
{
MyEntityDiagrams1 conn = new MyEntityDiagrams1();
var getResults = from a in conn.Products
                             select a.Name;
return getResults.ToString( );
}

Then in the TextBox I add to my report, I right click, go to Expressions and choose myFunction( ), but I get an error when I try to view in Preview.
Richard M
Top achievements
Rank 1
 answered on 13 Dec 2010
7 answers
336 views
Hi,

in Q2 2010 Telerik Reporting I set the DataSource of a Report to null in the constructor and created dynamically sized textfields dynamically, dependent on some ReportParameter sent by a Silverlight Application via the Telerik WCF Service, in the overridden OnNeedDataSource method.. This worked like a charm.

In Q3 2010 Telerik Reporting the constructor of the Report also gets called twice like before. Once while requesting the report initially to be previewed in the Silverlight Report Viewer, the second time if exporting the Report to PDF or any other format from the Menu of the Silverlight Report Viewer. The first time the constructor is called, OnNeedDataSource gets called correctly and the dynamic Textfields get created, the second time the constructor is called (before saving to file), OnNeedDataSource does not get called, even though the DataSource is again set to null in the constructor.

In Short: Preview shows correct Report like in Q2. Saving to PDF (or any other format) produces blank file in Q3. In Q2 the Report was being saved correctly.

Since this is a time-critical issue, I am temporarily stepping back to Q2 2010 as of now. I hope this issue can be resolved.

Some code reconstructed to visualize what I wrote in the upper paragraphs:

Constructor:

/// <summary>
        ///   Initializes a new instance of the <see cref = "OverviewReportBase{T}" /> class.
        /// </summary>
        public OverviewReportBase()
        {
            //
            // Required for telerik Reporting designer support
            //
            InitializeComponent();
 
            // Set DataSource to null, so that the NeedDataSource Event gets fired.
            // This is done because otherwise the ReportParameters are not getting filled from the Silverlight Client.
            DataSource = null;
        }
OnNeedDataSource method:
/// <summary>
        ///   Called when the report needs a data source.
        /// </summary>
        /// <param name = "sender">The sender.</param>
        /// <param name = "e">The <see cref = "System.EventArgs" /> instance containing the event data.</param>
        protected override void OnNeedDataSource(Object sender, EventArgs e)
        {
            Unit writeableArea = CalculateWidthOfWriteableArea();
            IEnumerable<String> columnNames = ((Object[]) ReportParameters["columnNames"].Value).OfType<String>();
            Int32 columnCount = columnNames.Count();
            IEnumerable<Int32> columnPercentages =
                ((Object[]) ReportParameters["columnPercentages"].Value).Select(x => Int32.Parse(x.ToString()));
            Double summedUpWidth = 0D;
            for (Int32 i = 0; i < columnCount; i++)
            {
                Unit controlWidth = writeableArea.Multiply(columnPercentages.ElementAt(i)).Divide(100);
                TextBox captionTextBox = new TextBox
                                             {
                                                 Location =
                                                     new PointU(new Unit(summedUpWidth, UnitType.Mm),
                                                                new Unit(0, UnitType.Cm)),
                                                 Size = new SizeU(controlWidth, new Unit(0.75, UnitType.Cm)),
                                                 Name =
                                                     String.Format(CultureInfo.InvariantCulture, "captionTextBox{0}", i),
                                                 StyleName = "Caption",
                                                 TextWrap = false,
                                                 Value = RetrieveDisplayName(columnNames.ElementAt(i))
                                             };
                labelsGroupHeader.Items.Add(captionTextBox);
                TextBox dataTextBox = new TextBox
                                          {
                                              Location =
                                                  new PointU(new Unit(summedUpWidth, UnitType.Mm),
                                                             new Unit(0, UnitType.Cm)),
                                              Size = new SizeU(controlWidth, new Unit(0.75, UnitType.Cm)),
                                              Name = String.Format(CultureInfo.InvariantCulture, "dataTextBox{0}", i),
                                              StyleName = "Data",
                                              TextWrap = false,
                                              Value = RetrieveValuePathOfColumn(columnNames.ElementAt(i))
                                          };
                detail.Items.Add(dataTextBox);
                summedUpWidth += controlWidth.Value;
            }
            SetDataSourceHere();
            base.OnNeedDataSource(sender, e);
        }
Best Regards
Tomas
Top achievements
Rank 1
 answered on 13 Dec 2010
1 answer
217 views
Can someone tell me what Telerik runtime assemblies I would need to distribute with my application to support Telerik reporting 2010-Q3 edition?

My concern is this. We are using 2009-Q3 Telerik Premium as our UI platform toolset. We have no plans to upgrade. We'd like to start using the 2010-Q3 version of the Telerik reporting components. Can 2009-Q3 UI assemblies co-exist with 2010-Q3 Telerik reporting runtime assemblies?

Peter
Telerik team
 answered on 13 Dec 2010
3 answers
291 views
Hi, Telerik!
    I would be indebted to you, if you help me to explain me how to pass parameters from silverlight application to report viewer. it's uregent! please! 
Steve
Telerik team
 answered on 10 Dec 2010
1 answer
138 views
Hi Terlik ,

I have asked many question in this forum and telerik has solved .

But now i have stuck up with grouping in reporting.

I am not able to understand how to group in report.

I have used my query to get the data everthing works as excepted.

Now i want to group by patient name in report and display to the user.

Can u refer an way how to do grouping.

I have tired all the telerik links but none helped me .

Kinldy provide a good link so that i can understand how grouping works in reports.

It is an SOS situation for me ,please Help.

Thanks
Steve
Telerik team
 answered on 10 Dec 2010
1 answer
95 views
Hello,

First of all great job for Telerik Reporting!

I am having trouble passing throw ObjectSource an Object that contains a Order with a IList<OrderDetails> like this :

 public Order.OrderMetaData cmd { get; set; }
        public IList<OrderDetail.OrderDetailMetaData> ligneCmd { get; set; }
 public Order.OrderMetaData cmd { get; set; }
        public IList<OrderDetail.OrderDetailMetaData> ligneCmd { get; set; }
public Order.OrderMetaData cmd { get; set; }
public IList<OrderDetail.OrderDetailMetaData> ligneCmd { get; set; }

The result is that I have access to the cmd Fields but i didnt find the way to display the details. At the end i would like to report Order with there details...

I ve post what i have in output.
Steve
Telerik team
 answered on 10 Dec 2010
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?