Telerik Forums
Reporting Forum
2 answers
190 views
Dear Telerik Support Team,

would it be possible for you to provide with a sample solution on how to generate a report containing a Chart (Lines) that is filled with a SqlDataSource with a multi valued parameter using  the datagroupcolumn value.

I have tried for hours to achieve this but cannot get it to work. The chart does not split the selected values into series or the datasource does not select multiple data.

To recreate the problem the steps would be as follows:

- Create a report with a multi value parameter that accepts instance ids e.g. person ids
- Create a SqlDataSource with the same parameter and pass the reports parameter value to it
- Create a chart and set the DataGroupColumn to the persons id to get a series for each person contained in the datasource
- Execute the preview and select two or more persons via the report parameter
- The chart will only display one series, independant of what is selected as a parameter whereas a crosstable set to the same datasource with column grouping set to the person id will display multiple rows.

I did not add any series explicitly. If I add some series explicitly the legend text will be the explicitly specified name. What I need would be the value of the DataGroupColumn as a Legend entry. The workaround you provide in your example with #NAME:#VALUE does not work as it references the Series name.

Is there a way to tell the Chart which DataSource Columns to use for X,Y, LEGEND if no Series have been defined explicitly?
I have found the PlotArea.XAxis.DataLabelsColumn but nothing for Y or Legend. Is it mandatory to specify series explicitly?

I'd appreciate a quick response,
thank you for your time.
Muhammad
Top achievements
Rank 1
 answered on 09 Aug 2012
1 answer
134 views
We have purchased Q2 2012 .i have a query in reporting

I need to dyamically bind the columns based on the dataset columns.i have used the sample you have provided, but no luck .
we are not getting any data in reporting panel.

i have created on .aspx page using web form development and used the below shown code.
On button click it has to display 5 rows from the table i have mentioned.
Note: i can see the Getdata() method returns 5 rows in debug mode.But this dataset is not able to bind in report viewer.

what is the wrong in my code.please guide us

ASPX page
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="teleriksample.test" %>
<%@ Register Assembly="Telerik.ReportViewer.WebForms, Version=6.1.12.611, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
    Namespace="Telerik.ReportViewer.WebForms" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server"></head>
<body>
    <form id="form1" runat="server">
    <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
    <telerik:ReportViewer ID="ReportViewer1" runat="server"></telerik:ReportViewer>
    </form>
</body></html>

Code behind part
 public DataTable GetData()
        {
            string conn1 = "Data Source=AES159\\SQLEXPRESS;Initial Catalog=TestDB;User Id=sa;Password=passwd@123;";
            SqlConnection sqlconn = new SqlConnection(conn1);


            string selectCommandText =      "SELECT top 5 * from login_master";

            sqlconn.Open();
            SqlDataAdapter dataAdapter = new SqlDataAdapter(selectCommandText, sqlconn);
            DataTable dataTable = new DataTable();

            dataAdapter.Fill(dataTable);
            sqlconn.Close();
            return dataTable;
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            Telerik.Reporting.ObjectDataSource objectDataSource = new Telerik.Reporting.ObjectDataSource();
            objectDataSource.DataSource = GetData(); // GetData returns a DataTable
            //objectDataSource.CalculatedFields.Add(new Telerik.Reporting.CalculatedField("FullName", typeof(string), "=Fields.Name + ' ' + Fields.ProductNumber")); // Adding a sample calculated field.

            // Creating a new report
            Telerik.Reporting.Report report1 = new Telerik.Reporting.Report();

            // Assigning the ObjectDataSource component to the DataSource property of the report.
            report1.DataSource = objectDataSource;
            
    
            //// Use the InstanceReportSource to pass the report to the viewer for displaying
            Telerik.Reporting.InstanceReportSource reportSource = new Telerik.Reporting.InstanceReportSource();
            reportSource.ReportDocument = report1;

            //// Assigning the report to the report viewer.
            ReportViewer1.ReportSource = reportSource;

            // Calling the RefreshReport method in case this is a WinForms application.
            //ReportViewer1.RefreshReport();

            ReportViewer1.Visible = true;

        }

regards,
Sanjay

Steve
Telerik team
 answered on 09 Aug 2012
1 answer
190 views
Hi,
I  have a 13- digit number. and i want to create a barcode in report. how can i create this.
i wanted to create a barcode for books.
can anyone help me..


code 128 is working fine with 10 digits..but i need 13 digit or universal for books.
because i tried all sybology .but it did'nt work 

thanks
Elian
Telerik team
 answered on 08 Aug 2012
1 answer
117 views
Hi!

I'm currently working with a sub report, and trying to set the stylename of a textbox dynamically in code based on it's value.

switch (data.Value)
    {
        case "Value1":
            tbxScanState.StyleName = "Stylename1";
            break;
        case "Value2":
                tbxScanState.StyleName = "Stylename2";
                break;
    }

However, it seems that this changes the stylename for tbxScanState in all of the subreports, rather than just the subreport I'm currently working with. Do you know how I might achieve my goal?
Steve
Telerik team
 answered on 08 Aug 2012
1 answer
72 views
Hi..
I'm trying to bind 1 datasource and add another series programmatically.
But my code to add  new series does not show up. If I remove the datasource it does. 
What's wrong with this?   thx!

   SQL = "SELECT  *  TEMP_HUMID_ANALYSIS ";
            


            this.chartTEMP_HUMID.DataSource = new SqlDataSource(DC.Connection.ConnectionString, SQL);
            
// THIS WORKS


// THIS DOES NOT nothing.. if I remvoe the above it works
            // Red Series
            ChartSeries serie1 = new ChartSeries();
            serie1.Name = "Red";
            serie1.Type = ChartSeriesType.Area;
            serie1.YAxisType = ChartYAxisType.Secondary;


            serie1.Appearance.Border.Visible = false;
            serie1.Appearance.FillStyle.FillType = Telerik.Reporting.Charting.Styles.FillType.Hatch;
            serie1.Appearance.FillStyle.MainColor = System.Drawing.Color.Red;
            serie1.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.SeriesName;


            Telerik.Reporting.Charting.ChartSeriesItem item = new Telerik.Reporting.Charting.ChartSeriesItem();
            
            item.XValue = 70;
            item.YValue = 0;


            serie1.AddItem(item);




            item = new Telerik.Reporting.Charting.ChartSeriesItem();


            item.XValue = 68.7;
            item.YValue = 82;


            serie1.AddItem(item);




            item = new Telerik.Reporting.Charting.ChartSeriesItem();


            item.XValue = 80;
            item.YValue = 55;


            serie1.AddItem(item);




            item = new Telerik.Reporting.Charting.ChartSeriesItem();


            item.XValue = 83.3;
            item.YValue = 0;


            serie1.AddItem(item);




            this.chartTEMP_HUMID.Series.Add(serie1);

Steve
Telerik team
 answered on 08 Aug 2012
1 answer
177 views
I am in the process of upgrading from 2008 Q3 reporting tool to 2012 Q1, and am having to find new ways to do what we were doing.

I found this FAQ, and it is essentially exactly what I need to do: http://www.telerik.com/help/reporting/faq-display-pdf-browser.html

It is marked as 2012 Q2...is this new between Q1 and Q2?  How would I do it with the Q1 tools?  The problem I am running into is there does not seem to be a RenderReport method I can use.

Thanks.

Rich
Steve
Telerik team
 answered on 08 Aug 2012
1 answer
101 views
Hi there!

I am trying to use telerik reporting to show customer's invoice table. I want every page with just one customer and one invoice table so I use report group. But I don't know how to set the datasource of the invoice table in every page. Can anyone help me?

My data structure is 

Customer
{
string customer_name;
List<Invoice> invoiceList;
}
 And I pass a List of Customers to report, and want it to show in this way

first page
customer1.name
the table of invoices of customer1
----------
second page
customer2.name
the table of invoices of customer2
----------
third page
.....
IvanY
Telerik team
 answered on 07 Aug 2012
1 answer
72 views
Before binding a report to a aspx report viewer, I run the following command:
rpt.Items["detail"].Visible=false;

However, the detail is still shown on the rendered report. Should this work?
Elian
Telerik team
 answered on 07 Aug 2012
2 answers
116 views
Hi,

  I'm creating a report which have two subreports. I'd like know how to do set datasource in the subreports?
I followed that sample (http://bit.ly/MJh8Ch) and report's documentation, but didn't work!

Thanks!

Flávio da Maia Jr.

Steve
Telerik team
 answered on 07 Aug 2012
10 answers
245 views
I am creating an invoice report and I need to align my subtotals and totals to the bottom of the screen right above the page footer on the last page of the invoice.

I beleive I have everything working except that the group footer appears just below the last line item on the invoice instead of at the bottom of the page. I've tried setting the vertical align property under style to bottom but that doesn't seem to do it.

Any hints?
Michal
Top achievements
Rank 1
 answered on 07 Aug 2012
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?