Telerik Forums
Reporting Forum
3 answers
317 views
I'm trying my hand at a custom aggregate class.  The report is bound directly to the datasource, and I put a text box in the report footer using the custom aggregate.  I was expecting the class to be instantiated once and accumulate values like all the examples show.  But in tracing the code execution in VS, I find that a new instance of the class is instantiated for every row in the dataset, meaning that no actual accumlation happens in the Accumulate method. 
The report has two levels of grouping, and I tried moving the text box to the footer of the inner group to see if it was an issue with being on the report footer.  No difference.

Can someone from Telerik please explain this?  Seems like if the function is called at the report level, there should be one instance of the class that accumulates the values for the whole bound data set.  Otherwise, all the code examples you have wouldn't work (i.e. this: http://blogs.telerik.com/blogs/posts/10-04-29/dynamic-sorting-of-reporting-crosstabs-using-a-custom-aggregate-function.aspx ) because the accumulation is actually held in a class level variable.

I'm pretty confused.
Peter
Telerik team
 answered on 31 Oct 2012
1 answer
86 views
Hello,
Good afternoon, I have a report with more than one subreport in the preview is displayed on a single page was not necessary to move between pages when printed and conformed to the number of leaves, when you switch to the version and update the project Control_Panel_Q2_SP1_2012_v6_1_12_820 leave to do so, each subreport shows me every page in subreport properties have active "KeepTogether = True" and subreports are in the area of "reportFooter" I need to have this functionality as I do.

greetings and thanks
IvanY
Telerik team
 answered on 31 Oct 2012
0 answers
122 views
I'm exporting to excel using biff format and I need to implement the below.
1) How do I group ceratin column names and assign a group name to them. This group header name needs to span the columns grouped and appear at the top. Please see my sample excel sheet attached.

2) how do I specify different colors for different columns in the exported excel sheet while exporting to excel in radgrid. I do not want to use html formatting due to excel warning message.

Please help with code.
Attached files
ZR
Top achievements
Rank 1
 asked on 30 Oct 2012
1 answer
100 views

Hi.

I'm using Telerik Reporting Q2 2012.
I want to create a chart which like attached image(chart.png).

Following is DataSource:
YEAR        MARKET            AMOUNT         RATE
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
2005        MARKET_A              38.98       
2005        MARKET_B              326.9       
2006        MARKET_A              48.36          24%
2006        MARKET_B             367.89          13%
2007        MARKET_A              59.13          22%
2007        MARKET_B             476.44          30%
2008        MARKET_A              75.27          27%
2008        MARKET_B             594.79          25%
2009        MARKET_A              92.75          23%
2009        MARKET_B             723.68          22%
2010        MARKET_A              25.15         -73%
2010        MARKET_B             192.56         -73%
I create four chartSeries objects (for two bars and two lines).
And set chart.DataGroupColumn to column "MARKET".

Designer.cs

private void InitializeComponent()
{
    // variable initialize and detail design code
    // ...
    this.chart1.Bindings.Add(new Telerik.Reporting.Binding("DataSource", "= Fields.Data"));
    this.chart1.DataGroupColumn = "MARKET";
    this.chart1.DataSource = this.objectDataSource1;
    this.chart1.Docking = Telerik.Reporting.DockingStyle.Fill;
    this.chart1.IntelligentLabelsEnabled = true;
    this.chart1.Name = "chart1";
    this.chart1.PlotArea.XAxis.AutoScale = false;
    this.chart1.PlotArea.XAxis.DataLabelsColumn = "YEAR";
    // create ChartSeries
    chartSeries1.DataYColumn = "AMOUNT";
    chartSeries1.Name = "Series 1";
    chartSeries2.DataYColumn = "AMOUNT";
    chartSeries2.Name = "Series 4";
    chartSeries3.DataYColumn = "RATE";
    chartSeries3.Name = "Series 2";
    chartSeries3.YAxisType = Telerik.Reporting.Charting.ChartYAxisType.Secondary;
    chartSeries4.DataYColumn = "RATE";
    chartSeries4.Name = "Series 3";
    chartSeries4.YAxisType = Telerik.Reporting.Charting.ChartYAxisType.Secondary;
    this.chart1.Series.AddRange(new Telerik.Reporting.Charting.ChartSeries[] 
    {
        chartSeries1, chartSeries2, chartSeries3, chartSeries4
    });
    // objectDataSource1
    this.objectDataSource1.DataMember = "Data";
    this.objectDataSource1.DataSource = typeof(SFuture.Common.Service.ReportModel);
    this.objectDataSource1.Name = "objectDataSource1";
      
    // Report1 design code
    // ...
}

But it's not work.
Please take a look into the attached image(bad_chart.png).

Any idea?
Thank you for the support!

Elian
Telerik team
 answered on 30 Oct 2012
2 answers
274 views
I am Having a really difficult time with this, it seems like it should be so simple. I wish there were better/more complete examples. It seems a lot of post about this but not a lot of info.

Here is what I am trying to do. I have an aspx page with a report viewer control. I have a simple report built in it's own class that has a SqlDataSource. The SqlDataSorce have one parameter for the record ID. In my aspx page I get a QueryString for the records ID and want to pass it to the SqlDataSource. I have tried both the Report Parameter method and trying to pass straight to the SqlDataSource.

Here is my code in my report that sets the SQL Param:
Public Property Param1() As Integer
        Get
            Return DirectCast(Me.SqlDataSource1.Parameters("@wo_id").Value, Integer)
        End Get
        Set(ByVal value As Integer)
            Me.SqlDataSource1.Parameters("@wo_id").Value = value
        End Set
    End Property

And Here is what I have on my aspx page:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim wo_id As String = Request("wo")
Dim rpt = New WorkRequestRpt()
Dim instanceReportSource = New Telerik.Reporting.InstanceReportSource()
instanceReportSource.ReportDocument = rpt
rpt.Param1 = CInt(wo_id)
Me.ReportViewer1.ReportSource = instanceReportSource 'New WorkRequestRpt()
ReportViewer1.RefreshReport()
End Sub

This is slight different than the examples I saw because I kept getting an error that certain methods were now obsolete.

Every time I open the report it is just blank. I don't know if I need to use the Need_DataSource event or what. Also, do I need some parameter on the report? If I remove the parameter and just have a straight query it work fine. Something is not passing the vale to the SqlDataSource.

A real good example with all of the steps would be great (the video is hard to follow, especially with some of the methods becoming obsolete). I think it would also help a lot of other out.


Thanks,
Craig
IvanY
Telerik team
 answered on 30 Oct 2012
2 answers
447 views
Hello,

I have created a simple report using the standalone report designer.
This report is saved as a .trdx file and located in the same folder as my binaries (I initially wanted it to be in a subfolder, but go the same error)

here is my code to generate  a pdf file:

UriReportSource report = new UriReportSource();
report.Uri = "KiwixInterventionSheetActions.trdx";
            
report.Parameters.Add(new Telerik.Reporting.Parameter("CustomerId", customer_id));
            
ReportProcessor reportProcessor = new ReportProcessor();
File.WriteAllBytes(target_filename, reportProcessor.RenderReport("PDF", report, null).DocumentBytes);

When I do the RenderReport, I get the exception message: "Invalid URI: The format of the URI could not be determined."
If I use a different file name, I get another exception saying that the file cannot be found, so this means that the Uri is correctly interpreted at some stage.

If I use a XmLReportSource instead and fill the Xml field from the content of the file by using following code:

XmlReportSource report = new XmlReportSource();
report.Xml = File.ReadAllText("KiwixInterventionSheetActions.trdx");

then it works, but I need to be able to support UriReportSource, because my final application uses sub-reports specified as files. Whne using the XmlReportSource, the main report works, but the pdf contains identical error message for the sub reports.

Thanks in advance

Fred
Frederic
Top achievements
Rank 1
 answered on 30 Oct 2012
1 answer
330 views
Is it possible to customize an ASP.NET (C#) report to hide one or two columns at runtime depending on the presence of a column in the datasource, or any other way? Ideally we would pass in a DataTable to the report without certain columns, or use a flag to determine whether or not to show the column.
IvanY
Telerik team
 answered on 30 Oct 2012
1 answer
269 views
Hi

I'm using Telerik Reporting Q1 2012. I want to render the following html code in an HtmlTextBox:

<span style="font-family: 'pluto light';">Test</span>


Unfortunately, the text is in Microsoft Sans Serif and not in Pluto Light. I think there is a problem, because the font has a space. With fonts like Verdana it works fine.

Do you have any hint for me?

Thanks,
Chris
IvanY
Telerik team
 answered on 30 Oct 2012
1 answer
54 views
hay guys
how to create report without wizard
this project have design but show report with calling query string in it
note: query string do not writed in desigin writ in code editor
tanks.......................
IvanY
Telerik team
 answered on 30 Oct 2012
1 answer
434 views
Hi,

I've seen this thread here: - http://www.telerik.com/community/forums/reporting/telerik-reporting/how-to-allow-dynamic-grouping-selections-paramters-in-a-report.aspx as well as the example reports.

This enables me to apply dynamic grouping in my report by setting the grouping value to "=IIF(Parameters.GroupBy.Value is null,"",Fields(Parameters.GroupBy.Value))", which is working fine.

However, I want to place a table control inside of the group and obviously filter based on the group that it's in.

I've set the table binding to "DataSource=ReportItem.DataObject", but what would the syntax of the filter be because I can't declare the actual field name in the "ReportItem.Parent.DataObject.FieldNameHere" part as it's dynamic?

I've tried various variations of the below in the filter setting of the table, but without success.

=IIF(Parameters.GroupBy.Value is null,"",Fields(Parameters.GroupBy.Value)) = =ReportItem.Parent.DataObject.(Parameters.GroupBy.Value)

Many thanks!
IvanY
Telerik team
 answered on 29 Oct 2012
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
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?