Telerik Forums
Reporting Forum
1 answer
248 views
I'm trying to display the value of a datetime in a testbox, and I want to vary the format based on a grouping parameter, so I use a binding like this to the format:

=Iif(Parameters.DateGroupFlag.Value = 1, "{0:Y}", Iif(Parameters.DateGroupFlag.Value = 2, "{0:d}", Iif(Parameters.DateGroupFlag.Value = 3, "{0:Y}", Iif(Parameters.DateGroupFlag.Value = 4, "{Y}", Iif(Parameters.DateGroupFlag.Value = 5, "{0:t}", Iif(Parameters.DateGroupFlag.Value = 6, "{0:t}", Iif(Parameters.DateGroupFlag.Value = 7, "{0:Y}", "{0:Y}")))))))

and this basically works, but I don't see how I can handle two special cases.
One is to display the year(eg "2013") only, and the other is to display the day only("Thursday").
Any ideas welcome
Joe
Top achievements
Rank 1
 answered on 30 Jan 2013
0 answers
49 views
Hello

We just converted to this version of Telerik and are having problems with all of our reports that use subreports.
I have looked at several options that people have suggested but so far no luck. 

Can someone please help?

Here is the code that we are using --

We set SubReportDS with
  MainReport report1 = new MainReport();
  report.SubReportDS = MyData;

and define SubReprtDS with --

public object SubReportDS
{
   set {   
    MainReport report1 = new MainReport();  

       Telerik.Reporting.SubReport subReport1 = 
        (Telerik.Reporting.
SubReport)report1.Items.Find("subReport", true)[0];

    Telerik.Reporting.InstanceReportSource
        (Telerik.Reporting.
InstanceReportSource) subReport1.ReportSource;  

    Telerik.Reporting.Report sub2 = (Telerik.Reporting.Report)irs.ReportDocument;

 

    sub2.DataSource =  value;
    }
}

The end result of this is a report that contains that main section which is populated.  It also
subReport sections but none of the subReport sections have data in them. 

Any help will be appreciated.
Thank you - Raka.

 

Raka
Top achievements
Rank 1
 asked on 29 Jan 2013
1 answer
186 views
I have parameters:
Reporting-Parameters-Combobox01.png

Also I receive it
Reporting-Parameters-Combobox02.png

Reporting viersion is 6.2.13.110. and VS2010 SP1
How can i get a combobox?
ADM-IT Denis Pujdak
Top achievements
Rank 1
 answered on 26 Jan 2013
1 answer
271 views
Report Constructor code
=======================
           //chart 
            DataTable dtStudent = new DataTable();
            //Columns of data table            
            dtStudent.Columns.Add("Name", typeof(string));
            dtStudent.Columns.Add("Date", typeof(DateTime));
            dtStudent.Columns.Add("Value", typeof(int));
  
            //rows in the data table
            //date1
            dtStudent.Rows.Add("Multiplication", "2013-01-12",  25);
            dtStudent.Rows.Add("division", "2013-01-12",  10);
            dtStudent.Rows.Add("Addition", "2013-01-12", 15);
            //date2
            dtStudent.Rows.Add("Multiplication", "2013-01-13",  30);
            dtStudent.Rows.Add("division", "2013-01-13",  11);
            dtStudent.Rows.Add("Addition", "2013-01-13",  14);
            //date3
            dtStudent.Rows.Add("Multiplication", "2013-01-14",  28);
            dtStudent.Rows.Add("division", "2013-01-14",  23);
            dtStudent.Rows.Add("Addition", "2013-01-14",  25);
            //date4
            dtStudent.Rows.Add("Multiplication", "2013-01-15",  40);
            dtStudent.Rows.Add("division", "2013-01-15",  49);
            dtStudent.Rows.Add("Addition", "2013-01-15",  18);
  
            Telerik.Reporting.Chart defChart = new Telerik.Reporting.Chart();
            defChart.BitmapResolution = 96F;
            defChart.ImageFormat = System.Drawing.Imaging.ImageFormat.Emf;
            defChart.IntelligentLabelsEnabled = false;
            defChart.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.32, ((Telerik.Reporting.Drawing.UnitType)(Telerik.Reporting.Drawing.UnitType.Cm))), new Telerik.Reporting.Drawing.Unit(1.8, ((Telerik.Reporting.Drawing.UnitType)(Telerik.Reporting.Drawing.UnitType.Cm))));
            defChart.PlotArea.EmptySeriesMessage.Appearance.Visible = true;
            defChart.PlotArea.EmptySeriesMessage.Visible = true;
            defChart.PlotArea.XAxis.AxisLabel.Visible = true;
            defChart.PlotArea.YAxis.AxisLabel.Visible = true;
            defChart.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(15, ((Telerik.Reporting.Drawing.UnitType)(Telerik.Reporting.Drawing.UnitType.Cm))), new Telerik.Reporting.Drawing.Unit(10, ((Telerik.Reporting.Drawing.UnitType)(Telerik.Reporting.Drawing.UnitType.Cm))));
  
  
            defChart.ChartTitle.Visible = false;
  
            var distinctResult = (from row in dtStudent.AsEnumerable()
                                  select row.Field<string>("Name")).Distinct();
  
            foreach (string name in distinctResult)
            {
  
                var dataResult = from row in dtStudent.AsEnumerable()
                                 where row.Field<string>("Name") == name
                                 select new
                                 {
                                     Name = row.Field<string>("Name"),
                                     Date = row.Field<DateTime>("Date"),
                                     Value = row.Field<int>("Value")
                                 };
  
  
                Telerik.Reporting.Charting.ChartSeries chartSeries = new Telerik.Reporting.Charting.ChartSeries();
                chartSeries.Type = Telerik.Reporting.Charting.ChartSeriesType.Line;
                chartSeries.Name = name;
                chartSeries.Appearance.LabelAppearance.Visible = false;
  
                defChart.Legend.Visible = false;
  
                foreach (var record in dataResult)
                {
                    ChartSeriesItem item = new ChartSeriesItem();
                    item.XValue = record.Date.ToOADate();
                    item.YValue = record.Value;
                    chartSeries.AddItem(item);
                }
                defChart.Series.Add(chartSeries);
            }
            defChart.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Reporting.Charting.Styles.ChartValueFormat.ShortDate;
            defChart.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 315;
            defChart.PlotArea.XAxis.Appearance.LabelAppearance.Position.AlignedPosition = Telerik.Reporting.Charting.Styles.AlignedPositions.TopLeft;
            defChart.PlotArea.XAxis.LayoutMode = Telerik.Reporting.Charting.Styles.ChartAxisLayoutMode.Inside;
            defChart.PlotArea.XAxis.IsZeroBased = false;
            defChart.PlotArea.XAxis.AutoScale = true;
            defChart.PlotArea.XAxis.LabelStep = 1;
  
            //Margins
            Telerik.Reporting.Charting.Styles.ChartMargins chartMargins2 = new Telerik.Reporting.Charting.Styles.ChartMargins();
            chartMargins2.Bottom = new Telerik.Reporting.Charting.Styles.Unit(40D, Telerik.Reporting.Charting.Styles.UnitType.Percentage);
            chartMargins2.Top = new Telerik.Reporting.Charting.Styles.Unit(5D, Telerik.Reporting.Charting.Styles.UnitType.Percentage);
            chartMargins2.Right = new Telerik.Reporting.Charting.Styles.Unit(20D, Telerik.Reporting.Charting.Styles.UnitType.Percentage);
            chartMargins2.Left = new Telerik.Reporting.Charting.Styles.Unit(5D, Telerik.Reporting.Charting.Styles.UnitType.Percentage);
            defChart.PlotArea.Appearance.Dimensions.Margins = chartMargins2;
  
            this.detail.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { defChart });
  
  
Calling aspx page:
==============
Student.aspx
===============
 <telerik:ReportViewer ID="ReportViewer1" runat="server" Height="580px" Width="1080px"></telerik:ReportViewer>
  
Code behind
================
 Telerik.Reporting.InstanceReportSource instanceReportSource = new Telerik.Reporting.InstanceReportSource();
             
            StudentLineReport objRep = new StudentLineReport();
  
 instanceReportSource.ReportDocument = objRep;
            this.ReportViewer1.ReportSource = instanceReportSource;

I m rendering a line chart from the report viewer as well as design preview. The design preview is showing the complete chart, but while running it in the report viewer, the chart is not displayed completely(see attachments). Also while exporting the chart to the PDF, it is rendered in different size.

Please find the attached snapshots and the code for the scenario.

Please let me know how to show the chart completely in the telerik report viewer. Also the chart should appear of same size in both telerik report viewer and exported pdf file. kindly help me on this one.

Stef
Telerik team
 answered on 25 Jan 2013
1 answer
77 views
Hi there,

currently I am working on a project to create custom reports.
I do that in this way:
I created a WCF-Service with a method which returns a Stream. This stream is the custom report, rendered to a pdf that is shown in a RadPDFViewer.
I do that because we need to send a list of all Reports that should be merged to one reportbook where every report is one single site with different data.
To create one report, I use this function:
public Report GetReport(ReportEntry entry)
{
dynamic newReport = new Object();
string parameterNameWithError = string.Empty;
string parameterValue = string.Empty;
string parameterType = string.Empty;
try
{
Type reportType = Type.GetType("ReportingService.Reports." + entry.Name);
newReport = Activator.CreateInstance(reportType);
foreach (var para in entry.ParameterList)
{
parameterNameWithError = para.Name;
parameterValue = para.Value;
parameterType = para.Type;
newReport.ReportParameters[para.Name].Value = para.Value;
}
}
catch (Exception ex)
{
newReport = new Reports.ErrorReport();
newReport.ReportParameters["ReportName"].Value = entry.Name;
newReport.ReportParameters["ParameterName"].Value = parameterNameWithError;
newReport.ReportParameters["ParameterValue"].Value = parameterValue;
newReport.ReportParameters["ParameterType"].Value = parameterType;
newReport.ReportParameters["ErrorMessage"].Value = ex.Message;
}
return newReport;
}

Now I want to create a function that gives me a list of all available reports with its ReportParameters.
I already get a list of reports, but I am now looking for a way to get the parameters.
This is what I have at the moment:

Type[] classes = Assembly.GetExecutingAssembly().GetExportedTypes();
foreach (Type t in classes)
{
  if (t.FullName.Contains("Reports.Report"))
  {
    PropertyInfo[] props = t.GetProperties();
    foreach(var prop in props)
    {
      if(prop.Name.Equals("ReportParameters"))
      {
        // What should I do here ???
      }
    }
}

Any kind of idea or hint?

Best Regards
Manfred







Steven
Top achievements
Rank 1
 answered on 25 Jan 2013
1 answer
147 views
Hi,

Please could you give me some advice on the following. We are developing an application that will allow users to define their own custom reports that will be generated from our application data. The proposal is to simply allow the user to specify the grouping and column details that they wish to include in the report and then save their selection. A report would then be produced using telerik reporting based on the details they have selected.

One approach that we have considered to implement the above would be to create an xml file to generate the report from. This xml would be based on the xml generated by the telerik report serialization method, which would allow us then to create the report by deserializing the report using the telerik methods.

The thinking behind the above is that it would create a clean method of storing (they need to be saved for re-use and further amendments of the grouping/fields) and generating the report based on the same xml source. Do you think that this would be acceptable way of generating our reports?

Also is there any documentation defining the telerik xml file format, and is this format likely to change and potentially break any files we create?

Thanks
Steve
Telerik team
 answered on 25 Jan 2013
1 answer
172 views
In the stand alone designer, is it possible to set a report section or panel to be collapsibile so that it may be collapsed and expanded at run time in the viewer?
Stef
Telerik team
 answered on 25 Jan 2013
4 answers
219 views
Hi,

I need to display "No Record Found" Message in Section of Parent report when subreport has no record to display.

Please suggest what to do ??

Thanks...
Ajay
Top achievements
Rank 1
 answered on 25 Jan 2013
4 answers
117 views
Having a problem with charts when deployed to a server on Azure.  It seems any chart put on a report will cause an error:

An error has occurred while processing Chart 'chart1': Parameter is not valid.

The chart is a completely unconfigured chart.  No data. Nothing, but it causes an error just being there.  If the chart is removed the report works properly.

The same report works locally, deployed to IIS, and testing in Azure Compute Fabric locally, but will not work when deployed to production.

The instance is configured to run framework 4.5, using the free cloud websites program. (Which should make it easy for testing)
Steve
Telerik team
 answered on 25 Jan 2013
5 answers
338 views
I have a Silverlight Report Viewer.  I have a few parameters I am using to filter my results, and they have AllowNull set to true. But can I change the text of the checkbox from "Null" to "All"?
Steve
Telerik team
 answered on 25 Jan 2013
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?