Telerik Forums
Reporting Forum
4 answers
280 views
I'm building an executive summary report that uses a single group. I only need a summary, so the Details section is hidden, and I only populate the group header and footer with aggregate data (see the reportdesigner.png attachment).  I have brute-forced a solution by manually computing my summary values, the first page of the resulting report is in the reportcapture.png attachment.

The problem is that I will be doing a similar report that is organized the same way, but given it will be generating charts from the details rather than just computing summary information, my current code-behind brute-force solution likely won't work as well.  And I'm thinking that I shouldn't have had to brute-force it in the first place.

The background is that I have a set of Entity-Data Framework objects projected from a simple SQL database.  The two tables in question are a table of Circuits (mapped to Circuit objects in C#), and a master table of logged voltage/power entries.  Each power entry was measured by a meter (and has a relation to yet another table of Meters) and was of course measured from a specific Circuit

EDF has projected an ObjectSet of Circuits, which is my DataSource for the report.  Within each Circuit object, EDF made me a Navigation Property called LoggedACMeterDatas.  I group the report based on the Circuit.id (the table key).  So each group header has as its "focus" a specific Circuit.  Hence the "Fields.Name" and "Fields.Circuit.Location.Name" resolve to the correct thing on a single Circuit object.

The problem is now I want to access the LoggedACMeterDatas (an EntityCollection that is projected from a Foreign-Key Relation), in order to fill in some summary information in the report.  For example, the "Period Start" and "Period End" are the earliest and latest timestamp in the LoggedACMeterDatas .  The power summary fields are each an average of a specific field across all the LoggedACMeterDatas for the current Circuit in the grouping.

I would have liked to build an Expression along the lines of Min(Fields.LoggedACMeterDatas.Timestamp) for the Period Start.  After all, specifying Fields.Name in the group header (which in the context of the entire report is a collection, but in the context of the group is a scalar) seems to do the right thing.  But I could find no way to do that with field that is an EntityCollection.  Similarly, for the power summaries, something like Avg(Fields.LoggedACMeterDatas.VoltagePhase1) to get an average of all the VoltagePhase1 members of the sub-collection.  In short, I can specify Fields.LoggedACMeterDatas in an Expression, but there seems to be precious little I can do with it.

So my brute-force was to add the following properties to the Circuit class, essentially doing the above in code-behind, where I can do something useful with the LoggedACMeterDatas member:
public Double AverageVoltagePhase1
{
get { return (from entry in LoggedACMeterDatas select entry.VoltagePhase1).Average(); } }
public Double AverageVoltagePhase2
{
get { return (from entry in LoggedACMeterDatas where entry.VoltagePhase2.HasValue select entry.VoltagePhase2.Value).Average(); } }
public Double AverageVoltagePhase3
{
get { return (from entry in LoggedACMeterDatas where entry.VoltagePhase3.HasValue select entry.VoltagePhase3.Value).Average(); } }
public Double AverageCurrentPhase1
{
get { return (from entry in LoggedACMeterDatas select entry.CurrentPhase1).Average(); } }
public Double AverageCurrentPhase2
{
get { return (from entry in LoggedACMeterDatas where entry.CurrentPhase2.HasValue select entry.CurrentPhase2.Value).Average(); } }
public Double AverageCurrentPhase3
{
get { return (from entry in LoggedACMeterDatas where entry.CurrentPhase3.HasValue select entry.CurrentPhase3.Value).Average(); } }
public Double AverageWattsPhase1
{
get { return (from entry in LoggedACMeterDatas select entry.WattsPhase1).Average(); } }
public Double AverageWattsPhase2
{
get { return (from entry in LoggedACMeterDatas select entry.WattsPhase2).Average(); } }
public Double AverageWattsPhase3
{
get { return (from entry in LoggedACMeterDatas select entry.WattsPhase3).Average(); } }
public Double AveragePowerFactor
{
get { return (from entry in LoggedACMeterDatas select entry.AvgPowerFactorAllPhases).Average(); } }
public DateTime StartPeriod
{
get { return (from entry in LoggedACMeterDatas orderby entry.Timestamp select entry.Timestamp).First(); } }
public DateTime EndPeriod
{
get { return (from entry in LoggedACMeterDatas orderby entry.Timestamp select entry.Timestamp).Last(); } }

So as I said above, the brute-force workaround is ok in this case, but it seems like I should have been able to do all this in the realm of the report.  Secondly, I don't see how I'm going to be able to build a Chart instead of a table of scalar averages---I'm going to need some mechanism by which I can hand off the EntityCollection to the Chart.  But I don't see how I can do that.

Any help appreciated...
Ivan
Telerik team
 answered on 21 Feb 2011
5 answers
356 views
Hi,

Is there a way to pass parameters from the SIlverlight Report Viewer (or in fact any way from a silverlight app) to the reportservice to be passed into the Report to be run?
I have looked in the documentation and forums but all the examples I can find refer to ASPX or winforms scenarios.

This is an urgent issue for me so if anyone can help it would be much appreciated.

(for clarity, I am trying to pass an 'out of band' type of parameter, not one the user selects. Essentially I need to pass the users id to the report from the client application in order to retrieve appropriate data)

Thanks

Andrew
Steve
Telerik team
 answered on 18 Feb 2011
1 answer
85 views
How can I use UDFs in subreport?  The same function works great in main report, however, it throws error when I use it in subreport.

An error has occurred while processing TextBox 'textBox8':The expression contains undefined function call FormatNos().

In main report, I just use FormatNos(...).  For subreport, the same function is called like <classname>.FormatNos() - I did select them from expression edition by expanding "User functions" - so no typo here.

Would I need to duplicate the functions in all subreport classes?
Peter
Telerik team
 answered on 18 Feb 2011
1 answer
147 views

Hi Support Team,

I am using Telerik reporting V4.2. In one report have used to Sub report. For I have assign different data sources programmatically. But second sub report takes values of first sub report. Please see in bellow images.

Both Report output, Data Source result for Subreport1 and Data Source result for Subreport2 please find in attachment.

Datasource assign code to main report and subreport.

    DataSet dsReportMaster = clsReports.SelectInvoiceReportMaster(intInvoiceId, clsProjectSession.CompanyAdminUserID);
 DataSet dsReportDetails = clsReports.SelectInvoiceReportDetails(intInvoiceId);
 DataSet dsReportProjectSummery = clsReports.SelectInvoiceReportDetailsProjectSummery(intInvoiceId);
 Report objReport = new Report();
 objReport = new InvoiceReport();
 objReport.DataSource = dsReportMaster;
 SubReport subReportDetails = objReport.Items.Find("subReport1", true)[0] as SubReport;
 subReportDetails.ReportSource.DataSource = dsReportDetails;
 SubReport subProjectSummery = objReport.Items.Find("subReport2", true)[0] as SubReport;
 subProjectSummery.ReportSource.DataSource = dsReportProjectSummery;

Please help me to resolve my issue.

Thanks
-Kalpesh 

 

Peter
Telerik team
 answered on 18 Feb 2011
1 answer
167 views
Here is my scenario.

I have report viewer consisting of 10 panels, each panel is responsible for dynamically loading the data from the database. A report has simple header. All the panels/tables have the same properties and settings and none of them are overlapping.

If I try to generate a report for all of this 10 tables then report generates blank pages in between with other data(data generates just fine). 

But if i take out first 4 panels and then generate a report then it doesn't have any blank pages and the report looks fine. But if i add any/all table from first 4 tables to the report , it renders blank pages. These first 4 problematic tables are very simple and and short sized.

I tried changing the position/order of the tables/panels, made sure all the panels have same properties ,but no luck.

I tried the KB article and generated report with contrasting background too, but I couldn't see anyone of them on rendered blank pages. . I toggled the KeepTogether property between true and false, that doesn't help either.

Silverlight Telerik Reports version is Q3_2010_v4_2_10_1221_dev

Is this a known issue?
Peter
Telerik team
 answered on 18 Feb 2011
8 answers
605 views
Is there a way to customize the loading image as well as the styling text of the ProcessingReportMessage on the Report Viewer?  I know most of your controls are easily customizable, but I cannot seem to find information for this particular task.

I'm hiding the entire report and I just want to show the toolbar (by setting the height = 0px).  However the loading image and text is a little too big and overbearing when accompanied with the toolbar only.

Thanks for the help as always.

Steve
Telerik team
 answered on 18 Feb 2011
4 answers
429 views
Hi everyone;

I have a problem with printing reports in landscape format in WORD document. My report is a very simple one with the following properties set:
Landscape = True
Paper kind = A4

Also I am using Telerik reporting Q1 2010 and Office 2010

however when I export the report to Word I hava noticed that the page size is A3 instead of A4. This makes my prints to go over the boundries of the page therefore missing some of the data. Anyone has any idea what the problem is? Any help would be appreciated.

Thanks;

Amir
Travis
Top achievements
Rank 1
 answered on 18 Feb 2011
2 answers
164 views
Hello,

  I have a problem with the Web Report Preview on Windows Azure.

If my application runs in Development Fabric or is deployed to the cloud, the Print Button doesn't work. If I run the same in local Webserver (Right click on WebRole and choose Debug), it works, but not in the Cloud. All I get is a progress bar in the lower left corner of the browser and then nothing.
The other switched on features are the Zoom control and the Reload button. These work perfect, but not the print button.

I use the following Tools/Versions:
  • WIndows 7 32 and 64 bit
  • Visual Studio 2008 Professional 9.0.30729.1 SP
  • Telerik Reporting Q3 2009, 3.2.9.1211
  • Azure SDK 1.1
  • Azure Tools for VS 2008 V1.1 (02.2010)
  • Browser: IE8 with or without compatibility switch turned on, FireFox 3.6

Anyone used the Report Preview Print function successful on Windows Azure yet?

Greetings
  Thomas
Richard Guo
Top achievements
Rank 1
 answered on 17 Feb 2011
2 answers
195 views
Hello,
I use a reportProcessor to generate PDF directly from a report, I'm unable to catch the exception that are thrown inside the subreports
I always get

RenderingResult res =reportProcessor.RenderReport("PDF", report, null);
bool hasError = res.HasErrors <- false

What I've been able to do till now is :

public xxx()
        {
            InitializeComponent();
            reportFactory = new ReportFactory();
            this.NeedDataSource += new EventHandler(xxx_NeedDataSource);
            this.subReport1.ReportSource.Error += new Telerik.Reporting.ErrorEventHandler(ReportSource_Error);
        }
 
        private void ReportSource_Error(object sender, Telerik.Reporting.ErrorEventArgs eventArgs)
        {
             
         //how do I propagate the error here to the reportrender?
             
        }

Thanks in advance
Paolo
Beau Button
Top achievements
Rank 1
 answered on 17 Feb 2011
1 answer
71 views
I have a database in the following form:

Date                    Green           Red          Yellow
02/15/2011         234               5248         0 
02/16/2011         24                 53             0 
02/17/2011         54                 248           0 
02/18/2011         72                 345           0 
02/19/2011         87                 36             0 

I wanted to make a PIE chart inside a Report in which  each 'slice'  represents the specified color (on the column name) and the data inside provides the size of the slice. So far I have not managed to find a way. In case this is not possible, what would be a good way to implement this chart ? 

Thanks in advance for your help



Ves
Telerik team
 answered on 17 Feb 2011
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?