Telerik Forums
Reporting Forum
0 answers
168 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
116 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
301 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
549 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
370 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
297 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
67 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
484 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
15 answers
3.0K+ views
Hello!

I'm playing around with the standalone designer and find the DataSource handling not really practical:

First, when you create a DataSource, the Wizard offers to save it in the application configuration file, which is of course read-only if the desinger is installed somewhere under Program Files. Instead the standalone Designer should store this information in a per-user configuration.

My scenario is to call the reports from my application, where the connection string changes depending on user input in a database connection dialog.
In this case the handling of the different DataSource objects in the report items and subreports etc. is rather tedious.
So far, I have to recursively find all Data Items in the report/subreports and change the connection string. This works as long as all items really use the same connection.

The proposed workaround with defining a report parameter and using binding requires a lot of discipline from the designer, OK for a programmer but not really practical for "Powerusers".

I would like to be able to define connections separately from sql statements (multiple DataSource objects using the same logical connection object)  and have these connections easily accessible in the designer UI and the API.

Am I missing something?

Regards
Erwin

BTW: really looking forward to being able to drop crystal report support from my application, as soon as the designer gets a bit more friendly for end users. Keep on with the great work!
Peter
Telerik team
 answered on 29 Oct 2012
4 answers
102 views
Hello,

I am using Telerik Reporting Q1 2012 (6.0.12.215).  I have a main report whose datasource is an object that returns a <List> collection. I also have two other fields in the report header that are set when the report is instantiated, these textboxes are set with parameters from my Winform application.  Also on this main report is a field that allows us to drill through to another report. When the field is clicked the drill through report opens fine however when I go back to the main report the value of the fields in the report header are gone however the datasource still maintains it result set.

How can I ensure that the values in the textboxes remain after I return to the main report...as it looks like their values are lost when navigating to the drill through report.

Thanks,

Kerry
Kerry
Top achievements
Rank 1
 answered on 29 Oct 2012
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?