Telerik Forums
Reporting Forum
3 answers
1.3K+ views
Hi,  
     I use stored procedures and sql queries to get data for my report parameters and the report data. The idea is to let user select from dropdown values and filter the required data. In one of the html styled text box, I need to present the user selected multi-values of a dropdown...

I used this..

Schools: {Join('; ', Parameters.SchoolNames.Value)}

that just works fine....

But the problem is the parameter values some times may contain '&'.. Thats throwing me an error.. Then I realised that I have to escape it for HTML Text box....

How can I do this in my scenario.. I have tried, the following with no luck..

Schools: {Join('; ',Replace(Parameters.SchoolNames.Value,'&','&'))}     







Nasko
Telerik team
 answered on 20 Jan 2015
4 answers
221 views
The Telerik provided example for the report viewer style is below.
<style>
#reportViewer1 {
position: absolute;
left: 5px;
right: 5px;
top: 120px;
bottom: 5px;
overflow: hidden;
font-family: Verdana, Arial;
}
</style>

The question is, how can the report viewer use relative pathing? No matter how the style is changed, the report will disappear if not exactly as above.
Stef
Telerik team
 answered on 20 Jan 2015
3 answers
162 views
Hello,

I want to define the scale of the y-axis dynamically based on my data source. My current implementation uses the ItemDataBound event from the graph-object. It is the earliest moment, when the data are bound to the subreport. At this moment the scale is not properly set.

var dataItem = (Telerik.Reporting.Processing.DataItem)sender;
var list = dataItem.DataSource as IList<InclinationProfileItemModel>;
 
if (list == null) return;
 
list = new List<InclinationProfileItemModel>(list.OrderBy(l => l.InclinationInDistanceUnitToStart));
var minY = list.First().InclinationInDistanceUnitToStart;
var maxY = list.Last().InclinationInDistanceUnitToStart;
var inclMax = Math.Abs(maxY - minY);
 
if (inclMax < 1)
    this.UnitToStartLineSeriesGraphAxisY.Scale = new NumericalScale
    {
        MajorStep = 0.25,
        MinorStep = 0.25,
        Minimum = Math.Min(0, Math.Floor(minY)),
        Maximum = Math.Max(1, Math.Ceiling(maxY))
    };
else if (inclMax < 5)
    this.UnitToStartLineSeriesGraphAxisY.Scale = new NumericalScale
    {
        MajorStep = 1,
        MinorStep = 1,
        Minimum = Math.Min(0, Math.Floor(minY)),
        Maximum = Math.Max(1, Math.Ceiling(maxY))
    };
else if (inclMax < 20)
    this.UnitToStartLineSeriesGraphAxisY.Scale = new NumericalScale
    {
        MajorStep = 5,
        MinorStep = 5,
        Minimum = Math.Min(0, Math.Floor(minY)),
        Maximum = Math.Max(1, Math.Ceiling(maxY))
    };
else
    this.UnitToStartLineSeriesGraphAxisY.Scale = new NumericalScale
    {
        MajorStep = 10,
        MinorStep = 10,
        Minimum = Math.Min(0, Math.Floor(minY)),
        Maximum = Math.Max(1, Math.Ceiling(maxY))
    };

How can I solve my problem? Is there a way to set the properties of NumericalScale to an earlier moment? Any other solution for dynamically define a NumericalScale? Binding?

Best regards,
Roland
Nasko
Telerik team
 answered on 20 Jan 2015
1 answer
483 views
I'm looking for a Reporting Sample from a C# Object where the Datasource for a report is a generic collection of say a Sales Class.
Just a couple of fields on a report is all I'm looking for. Is there any sample code out there on this site that can help me.
Thanks

--Pat Brown
Nasko
Telerik team
 answered on 20 Jan 2015
1 answer
147 views
Hi
I noticed that when I use Reportviewer with Clientmode=Static, the toolbar's history-back button doesn't work correctly anymore. Instead of navigating to the previous page, it now shows the print-dialog.
Telerik, can you check this. Is this a bug or am I doing something wrong?

Note, I use Telerik Reporting 2014Q3 version 8.2.14.1204

Best regards,
Frank
Stef
Telerik team
 answered on 20 Jan 2015
1 answer
83 views
I have a NavigateToReportAction assigned to a TextBox in a GroupHeaderSection of my report. In the code I assign the DataSource of my ReportSouce to this.DataSource. This works locally but the SubReports is blank on the testing server.

I am running an out-of-proc session. I made changes for other DataSource assignments to account for this but, no matter what I try, I can't seem to bind the NavigateToReportAction DataSource.

Here's what I have right now:

public ParentReport()
{
    InitializeComponent();
    ItemDataBinding += ReportDataBinding;
}
 
public void ReportDataBinding(object sender, EventArgs e)
{
    var processingReport = (Telerik.Reporting.Processing.Report)sender;
    var report = (Telerik.Reporting.Report)processingReport.ItemDefinition;
    GroupHeaderArea2 = (Telerik.Reporting.GroupHeaderSection)report.Items.Find("GroupHeaderArea2", true)[0];
    GroupHeaderArea2.ItemDataBinding += AssignSubReportDataSource;
}
 
public void AssignSubReportDataSource(object sender, EventArgs e)
{
    Telerik.Reporting.Processing.GroupSection groupSection = (Telerik.Reporting.Processing.GroupSection)sender;
    Telerik.Reporting.Processing.TextBox txtName = (Telerik.Reporting.Processing.TextBox)groupSection.ChildElements.Find("txtName", true)[0];
    NavigateToReportAction action = (NavigateToReportAction)((Telerik.Reporting.TextBox)txtName.ItemDefinition).Action;
    InstanceReportSource subReportSource = (InstanceReportSource)action.ReportSource;
    ((Telerik.Reporting.Report)subreportSource.ReportDocument).NeedDataSource += subReport_NeedDataSource;
}
 
protected void subReport_NeedDataSource(object sender, EventArgs e)
{
    ((Telerik.Reporting.Processing.Report)sender).DataSource = this.DataSource;
}

I have tried to use a Binding in my SubReport to assign the DataSource as suggested in:
http://www.telerik.com/forums/how-to-bind-the-datasource-of-a-subreport-in-the-designer.

If anyone has any tips on how to do that properly that would be helpful. Any insight is appreciated as I have been working on this issue for a while. Again, this is working locally, but not on the server.

Thanks!
Hinata
Top achievements
Rank 1
 answered on 20 Jan 2015
4 answers
585 views
Following the documentation here:
http://www.telerik.com/help/reporting/designing-reports-parameters-using-multivalue-parameter.html

It says, "In order to have multiple values selected, you should set the Value property of the parameter to an IEnumerable instance containing the desired values. This can be done using the code behind or an expression."

My question is:  How do you specify one or more default values using an "expression"?


Thanks - Wayde
KS
Top achievements
Rank 1
 answered on 20 Jan 2015
5 answers
356 views
Is there a way to remove the <select all> option in a multi-value report parameter?
Stef
Telerik team
 answered on 20 Jan 2015
1 answer
77 views
Hi
Is there any way to add many documents (each one may be from a different report) into a Report Viewer?

Best regards
Tasos Sarris
Nasko
Telerik team
 answered on 19 Jan 2015
3 answers
229 views
I have a simple Master/Detail type report that I'm trying to develop, however I'm running into a binding issues with relating the Detail to the Master. The only "advanced" part of this is that I am setting the datasource dynamically for the subreport and then creating a new InstanceReportSource. Could that possibly have something to do with it? Below is various screenshots of how I have everything setup and the results I'm getting. 

1) A simple texbox on the report to display the value of the field I'm pulling from the datasource (This works)
2) The Sub Report
3) The Parameters of the ReportSource for the subreport. There is a single StudentId parameter. This is set to the same field that is being displayed (Item 1)
4) The Report Parameters of the SubReport
5) The output of the SubReport when it is run. The Date column is setup to use the StudentId parameter (Item 4)
6) The code that is being used to set the DataSource for the SubReport

Any ideas or suggestions would be Greatly appreciated! Thanks in advance!

Robert Bross
Top achievements
Rank 1
 answered on 19 Jan 2015
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?