Telerik Forums
Reporting Forum
2 answers
759 views
Hello,

In my code I assign the string "HIGH" to a TextBox in my Report. The report shows the value "HIGH" correctly in the report. I would like to format the TextBox in such a way that the text's colr is Red when it contains "HIGH". Therefore I have created a Conditional Formatting Rule saying  that if TextBoxName.Value = ="HIGH" (see attached image) the the style should have a red font color.

However this does not work. Dies conditional formatting work if the value of the textbox is assigned directly through code?

Any help is appreciated.

Thanks in advance
Ionel
Top achievements
Rank 1
 answered on 02 Aug 2011
2 answers
316 views
Hello.  I have a report with 2 params.  The datasource of the second param uses the selected value of the first param. 
Example:    Param 1 is a list of car manufactures, and Param 2 is a list of Models for the selected car manufacture.

I have set this up, and it is working correctly.  However, what I would like to do is have Param 2 automatically select the first option after the user selects from Param1.
Example:  User chooses "Ford", and "Mustang" is automatically selected in Param 2 (because its the first in the list), and the Mustang report is displayed.  (Currently, after selecting from Param1, the dropdown for Param2 says "<select a value>")

How can I accomplish this?

Thanks,
Justin
Patrick
Top achievements
Rank 1
 answered on 01 Aug 2011
1 answer
138 views
Hello,

I am new to reporting but I have created a new class project for my Telerik Reports and have a simple report working perfect in the report viewer on my aspx page (located in my web project). Now when I try to run the same thing in the Report Designer Preview Tab it fails. I do not have a datasource associated with this report but I do have NeedDataSource. I have determined that the NeedDataSource routine fails (again only in Preview/Html Tabs) when my Linq query tries to iterate through the result set e.g. For Each g In gc...

Again this code works fine when viewed through the WebReportViewer.
Private Sub GoalCompare_NeedDataSource(ByVal sender As Object, ByVal e As System.EventArgs)
...
Dim o As MIBEntitiesModel = New MIBEntitiesModel(My.Settings.MIBConnection)
 
Dim gc As System.Linq.IQueryable(Of MIB1.VwMIB_GoalCompare) = Nothing
 
gc = From m In o.VwMIB_GoalCompares Select m
If iSelectedLevel = enSelectedLevel.DSC Then
    gc = gc.Where(Function(x) x.DistrictWN.Equals(sDSCWN) AndAlso x.Year.Equals(iThisYear) AndAlso x.Week.Equals(iThisWeek))
ElseIf iSelectedLevel = enSelectedLevel.RSC Then
    gc = gc.Where(Function(x) x.RegionalWN.Equals(sRSCWN) AndAlso x.Year.Equals(iThisYear) AndAlso x.Week.Equals(iThisWeek))
ElseIf iSelectedLevel = enSelectedLevel.SSC Then
    gc = gc.Where(Function(x) x.StateWN.Equals(sSSCWN) AndAlso x.Year.Equals(iThisYear) AndAlso x.Week.Equals(iThisWeek))
End If
gc = gc.OrderBy(Function(x) x.LevelID).ThenBy(Function(x) x.UserID).ThenBy(Function(x) x.RowCategoryID)
 
For Each g In gc
...
Next
...
End Sub

Possibly I am missing a required assembly?? Any help would be greatly appreciated! Thank you!
Jeff
Top achievements
Rank 1
 answered on 01 Aug 2011
2 answers
94 views
Hi,

I have a couple of question about the Telerik.Reporting product.

1) I created a report that containt a group. This group have a header and a footer. This group may contain over 40 rows (so, too much to stand on only one page) and I want to know if it was a way to print his header at the beginning of each page. Here a picture of what I mean : link

2) Always with the same report, I want to know if it is possible to show a group as soon as it is loaded, even if the other group aren't, In other worlds, let's said that my report have a group that appears 100 times. What I want is that, the first group appears once it is load, then the second, then the third, ... and not that I have to wait a couple of seconds before they all appears.

3) Last question : is it possible to not show a footer on the first page, but to show it on all the other pages. In fact, I want to show the number of the page, but I not on the first page. I read that I can use report book, but I'm not sure it is the right solution in my case. 

Thank you in advance

PS : I have a another question. It is possible to open a report in a pdf inside a web page (like this). In the learning guide, they only show how to open it in a standard pdf. not inside a web page. Thanks 
David
Top achievements
Rank 1
 answered on 29 Jul 2011
2 answers
277 views
hello,

I am using telerik cross tab report but unable to load large data. Report generation proccess is too slow or result in out of memory exception. My stored procedure come up with all records in 1 min and 14 seconds but report don't come up after many minutes, but the same report working fine for 5000 records. Please share the solution?

Thanks

Peter
Telerik team
 answered on 29 Jul 2011
1 answer
153 views
I have an issue with Telerik Reporting Q3 2009 when I export a report to PDF.  The report has a textbox and a table.  The textbox content takes up about 1/4 of a page and the table content takes up about a full page (or more).

What I want is the for table to start immediately after the textbox but I've found that unless the entire table fits on the same page as the textbox it starts rendering on the 2nd page.

Instead of:
[page 1] Textbox + Whitespace
[page 2] Table
[page 3] Table continued

I want:
[page 1] Textbox + Table
[page 2] Table continued

I've played with KeepTogether property but it didn't make a difference.  Any help is appreciated!  Thanks.
Steve
Telerik team
 answered on 29 Jul 2011
2 answers
962 views
Hi guys,

I have two fields on a report (start date and end date) and I'd like to create a calculated field showing the number of hours. I can't find any date formatting functions such as datediff, datepart etc that would allow me to do this. Any ideas? I guess I could add a field to the sql server view but it would cause complications in another tier...
Steven
Top achievements
Rank 1
 answered on 29 Jul 2011
1 answer
286 views
Hi,

I need show data of three different datasources in the same report. I'm trying to use a subreport but I don´t have success. 

public class ViagemInfo
{
    public int IDEmpresa { get; set; }
    public int AnoViagem { get; set; }
    public int IDViagem { get; set; }
    public int IDConta { get; set; }
    public List<MotoristaViagemInfo> MotoristasViagem { get; set; }
}
 
public class MotoristaViagemInfo
{
    public int IDMotorista { get; set; }
    public int Nome { get; set; }
}
     
private void LoadData(int IdEmpresa, int AnoViagem, int IdViagem)
{
    ViagemInfo viagemInfo;
    try
    {
        using (PedidoProxy.Pedido svcProxy = new PedidoProxy.Pedido())
        {
            //load the ViagemInfo with a List<MotoristaViagemInfo>
            viagemInfo = svcProxy.ObterViagemDetalhada(IdEmpresa);
        }
        CertificadoViagem reportCertificado = new CertificadoViagem();
        reportCertificado.ReportParameters["IdEmpresa"].Value = IdEmpresa;
        reportCertificado.DataSource = viagemInfo;
    }
    catch
    {
        throw;
    }
}

How am I set a datasource of subreport with a MotoristasViagem property of viagemInfo?
Peter
Telerik team
 answered on 28 Jul 2011
3 answers
468 views
I have a bar chart in my report,  X-axis is the employee name, Y-axis is the sales amount.   If sales amount over X, I would like to color the bar "Green".  If they are below X, color the bar "Red".  How can I do this?  I tried looking at Conditional Formatting but it's not working. 

Please guide me into right direction. 

Thanks!
Peter
Telerik team
 answered on 28 Jul 2011
5 answers
309 views
Hello,

How can I access the a textbox value from chart needdatasource method?
My code:
private void Pie_NeedDataSource(object sender, EventArgs e)
       {
           Telerik.Reporting.Processing.Chart chart = sender as Telerik.Reporting.Processing.Chart;
           //Telerik.Reporting.Chart defChart = (Telerik.Reporting.Chart)chart.ItemDefinition;
           //Processing.TextBox textBox21 = (defChart.Items["textBox21"] as Processing.TextBox);
           Telerik.Reporting.Chart chartDef = (Telerik.Reporting.Chart)chart.ItemDefinition;
           Telerik.Reporting.Charting.ChartSeries series = new Telerik.Reporting.Charting.ChartSeries();
           series.Type = ChartSeriesType.Pie;
           Telerik.Reporting.Charting.ChartLegend legend = new Telerik.Reporting.Charting.ChartLegend();
 
           string CoverDescription;
           int itemValue;
          
           string commandText = string.Empty;
           SqlConnection connection = new SqlConnection(global::QTaskReporting.Properties.Settings.Default.QTDbConnString);
           commandText = "SELECT COUNT(*) AS ItemCount, SDesc FROM vwSubTasksAndStatuses where TaskID=" + textBox21.Value + " GROUP BY SDesc";
           SqlCommand cmd = new SqlCommand(commandText, connection);
           SqlDataAdapter da = new SqlDataAdapter(cmd);
           DataSet ds = new DataSet();
           da.Fill(ds);
            
           foreach (DataRow rowView in ds.Tables[0].Rows)
           {
               Telerik.Reporting.Charting.ChartSeriesItem seriesItem = new Telerik.Reporting.Charting.ChartSeriesItem();
 
               //The chart Y value will be based on the Value amount
               seriesItem.YValue = Convert.ToInt32(rowView["ItemCount"]);
               seriesItem.Appearance.FillStyle.FillType = Telerik.Reporting.Charting.Styles.FillType.Solid;
 
               //The chart item label should be set to the Value amount
               itemValue = Convert.ToInt32(rowView["ItemCount"]);
               seriesItem.Label.TextBlock.Text = itemValue.ToString("##");
               seriesItem.Label.Appearance.LabelLocation = Telerik.Reporting.Charting.Styles.StyleSeriesItemLabel.ItemLabelLocation.Inside;
               seriesItem.Label.TextBlock.Appearance.TextProperties.Color = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(58)))), ((int)(((byte)(112)))));
 
               //Assign the chart item description
               CoverDescription = rowView["SDesc"].ToString();
               seriesItem.Name = CoverDescription.Trim();
 
               //Give the "Shortfall in Cover" chart item an exploded appearance
               if (seriesItem.Name == "New")
               {
                   seriesItem.Appearance.Exploded = true;
               }
 
               series.AddItem(seriesItem);
 
           }
 
           //Display the legend
           series.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.ItemLabels;
           series.Appearance.Border.Color = System.Drawing.Color.White;
           series.Appearance.Border.Visible = false;
           series.Appearance.DiameterScale = .90;
 
           series.Appearance.ExplodePercent = 10;
 
           chartDef.Series.Clear();
           chartDef.Series.Add(series);
 
           chartDef.Legend.Appearance.Position.AlignedPosition = Telerik.Reporting.Charting.Styles.AlignedPositions.TopRight;
       }

In the above code I need to use the textbox value in the sql syntax.
Both chart and textbox are placed within a table (Please view the attached screen-shot).

Please, I need your help,
It is appreciated to send me the modified code.

Regards,
Bader
Peter
Telerik team
 answered on 28 Jul 2011
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?