Telerik Forums
Reporting Forum
1 answer
40 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.0K+ 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
96 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
301 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
193 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
251 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
119 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
79 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
4 answers
175 views

I have a report with three subreports.  The FilesAttached subreport is working, but the other two subreports do not show any data.  Here is my binding code.  Is there something I am missing?  Where else should I look?

Dim summaryReport As New telSummaryReport
summaryReport.DataSource = DS.Tables("SCR")
summaryReport.subNotes.ReportSource.DataSource = DS.Tables("Notes")
summaryReport.subFilesAttached.ReportSource.DataSource = DS.Tables("Files")
summaryReport.subCCB.ReportSource.DataSource = DS.Tables("Decisions")
  
Dim reportProcessor As Telerik.Reporting.Processing.ReportProcessor = New Telerik.Reporting.Processing.ReportProcessor()
Dim result As Telerik.Reporting.Processing.RenderingResult = reportProcessor.RenderReport("PDF", summaryReport, Nothing)
  
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()
Eric
Top achievements
Rank 1
 answered on 10 Dec 2010
0 answers
105 views
We are working on a project where we will have somewhere over 100 reports that are going to be accessed/viewed via a web application. The reports will be defined in a separate class. The list of reports will change over time, some will be added, some will be removed. We can recompile and redistribute the reports DLL, but I am trying to avoid having to modify and recompile the applicatoin when the reports change.

What I'd like to do is to somehow automate the list of reports, display a list of reports to the user, with the ability to click and see any of the individual reports. The easiest thing would be is if there was some kind of FOR EACH iteration that I could do to populate a menu or treeview. Alternatively I've looked at storing the report list in a database table and using that for the selection. I would then like to have a single form that includes a reportviewer, and populate/configure the reportviewer when an item is selected.

The Telerik Reporting web demo is something like the interface I'm looking for, with a list of reports and a reusable page section, but I don't think it's dynamic, and it appears to use different ASPX files ror each report -- which I'd like to avoid.

Anyone have any suggestions about the best way to go about this, or better yet an example?
Derek
Top achievements
Rank 1
 asked on 10 Dec 2010
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?