Telerik Forums
Reporting Forum
6 answers
221 views

Need help. Textbox action (Navigate to Report (object instance)) does not work. Textbox is not clickable on html5 report viewer. It is working on web form report viewer (Same logic on creating the report.).

I'm using a custom report resolver where datasource is from a dataset and the report is from a xml file. 

code snippet:

        private void AssignSubreportDatasource(global::Telerik.Reporting.Report parent, DataSet ds)
        {
            var items = parent.Items.Find("textBox14", true); // contains NavigateToReportAction
            if (items != null)
            {
                foreach (var item in items)
                {
                    var sub1 = (((item as global::Telerik.Reporting.TextBox).Action
                        as global::Telerik.Reporting.NavigateToReportAction).ReportSource
                        as global::Telerik.Reporting.InstanceReportSource).ReportDocument
                        as global::Telerik.Reporting.Report;

                    var objds = sub1.DataSource as global::Telerik.Reporting.ObjectDataSource;
                    objds.DataSource = ds.Tables[0];
                }
            }
        }
///////

        public global::Telerik.Reporting.ReportSource Resolve(string reportId)
        {
            global::Telerik.Reporting.InstanceReportSource reportSource = new global::Telerik.Reporting.InstanceReportSource();

            System.Data.DataSet ds = DeserializeDataset(datafile);
            var report = (global::Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
            AssignSubreportDatasource(report, ds); //assigns navigate to subreport datasource
            AssignDataSource(report, ds); //assigns inline subreport datasourcereport.DataSource = ds;
            report.DataSource = ds;

            reportSource.ReportDocument = report;

            foreach (var telerikParam in reportSource.ReportDocument.ReportParameters)
            {
                telerikParam.Value = "0";

            }

            return reportSource;
        }


   

Nasko
Telerik team
 answered on 25 Aug 2017
3 answers
1.4K+ views

Hello,

I'm using a standalone *.trdx report with winforms application, In the designer I defined the parameters and linked the file with a storedprocedure which requires 3 parameters (KidName, DateFrom, DateTo), and I tested from the Telerik Report Designer and it works well in the datasource wizard

 

but I cannot pass the values from the .net application

I tried this code but I always get a message Missing or Invalid parameter value. Please input valid data for all parameters

this is the code I'm using:

    uriReportSource.Parameters.Add(new Telerik.Reporting.Parameter("@KidName", KidName));
    uriReportSource.Parameters.Add(new Telerik.Reporting.Parameter("@DateFrom", DateFrom));
    uriReportSource.Parameters.Add(new Telerik.Reporting.Parameter("@DateTo", DateTo));
    uriReportSource.Parameters["@KidName"].Value = KidName;
    uriReportSource.Parameters["@DateFrom"].Value = DateFrom;
    uriReportSource.Parameters["@DateTo"].Value = DateTo;
 
reportViewer1.ReportSource = uriReportSource;
reportViewer1.RefreshReport();

 

Please fix my code and explain what I need to do

Ivan Hristov
Telerik team
 answered on 25 Aug 2017
12 answers
363 views

Hi

I have a dataset containing a location and a number as a % so from 0 - 100.

All I want to do is display the Location with this number against all other locations.

I've been playing with this or a while now, and the best I can get is the graph showing at a fixed height, which is great if there are only 2 or 3 locations, but each bar is really small if there are more, alternatively with the control sized large with only 2 locations is again looks silly as both bars take up the whole control.

All I want it to do is display consistently for n number of locations.

Can someone point me in the right direction please.

 

Andy

Ivan Hristov
Telerik team
 answered on 24 Aug 2017
1 answer
240 views

I have a report with one parameter that the user can change. However, the Preview button is disabled and I can't figure out why. I'm using the HTML report viewer with MVC.

I have other reports with same functionality where the Preview button is enabled.

 

 

Ivan Hristov
Telerik team
 answered on 24 Aug 2017
2 answers
373 views
Hello,

I need to count how much values can be selected from a multi-value parameter, so I can display "Selected 15 of 20". So somehow I need to get the 20.

I can display how much values I have selected (15) with "= Parameters.v_test.Value.Length", but I can't find a solution for the other value (20).

Maybe someone has any idea. Is this possible without user functions?

Thanks,
Diego
Diego
Top achievements
Rank 1
 answered on 24 Aug 2017
3 answers
605 views

Hi,

after adding following html paragraphs (1) to the HtmlTextBox value we are getting <p> tags converted to div and span (2) when report is rendered.

1) <p>first paragraph</p><p>second paragraph</p>

2) <div title="" class="htmlTextBox1 s1-" style="position:absolute;overflow:hidden;left:0px;top:309px;width:588px;height:48px;">

<div class="s2-" style="top:0px;left:3px;">
<span class="s3-">first paragraph</span>
</div>
<div class="s2-" style="top:33px;left:3px;">
<span class="s3-">second paragraph</span>
</div>
</div>

 

Is there a way to prevent this and keep original paragraph tags as they are? This makes incorrect height between lines and adds extra space after each text line.

 

Thanks

Katia
Telerik team
 answered on 24 Aug 2017
1 answer
106 views

I am using Telerik_Reporting_R2_2017_SP1_11_1_17_614.

I currently have a c# List of objects that I can calculate at runtime. Each object has the following class:

public class Thing {
    public DateTime XVal { get; set; } 
    public double YVal { get; set; } 
    public string Label { get; set; } 

}

XVal - is values usually range over several years with 10000s points (often but not always separated at 15 minute intervals). I only know the min and max values at runtime.

YVal - values are typically between 0 and 50, but I only know this range at runtime.

Label - 6 different labels that are known at runtime - not used at the moment (but long term I would like a different plot for each one).

To start, I would like to plot an x-y scatter plot of each element of the list (ignoring Label), such that each element of the list creates a point with coordinates (Xval, Yval). I have tried to follow the graph wizard tutorial, selected scatter plot and added X and Y arrays, set the category to the XVal and left the series blank. I then create a list of Thing objects and set the DataSource property of the scatter graph to that list. However, the plot always comes back with no data (min and max of both axes are 0 and 1 respectively). 

How can I create this scatter plot. 

Richard
Top achievements
Rank 1
 answered on 23 Aug 2017
1 answer
541 views

I am creating a reporting site that is an Angular app housed within MVC 5. When I try to instantiate the telerikReportViewer, it gives me the following error:

SyntaxError: Unexpected token :
at start (VM825 telerikReportViewer.js:4539)
at ZoneDelegate.invoke (zone.js:391)    
at Object.onInvoke (ng_zone.ts:261)    
at ZoneDelegate.invoke (zone.js:390)    
at Zone.run (zone.js:141)    
at zone.js:818    
at ZoneDelegate.invokeTask (zone.js:424)    
at Object.onInvokeTask (ng_zone.ts:253)    
at ZoneDelegate.invokeTask (zone.js:423)    
at Zone.runTask (zone.js:191)

On line 4539 of telerikReportViewer.js, it throws the error on the 9th index of 'scripts'. While debugging, 'scripts' was displayed as such:

(11) ["", "", "", "", "System.import('../src/main.js').catch(function (err) { console.error(err); });", "", "", "", "var params = {↵            AuthToken: $("#AuthToke…    };↵↵        GlobalHeaderFooter.setup(params);", "{"appName":"Chrome","requestId":"f51b2a9f21e04898972e2e5463503faa"}", ""]
0:""
1:""
2:""
3:""
4:"System.import('../src/main.js').catch(function (err) { console.error(err); });"
5:""
6:""
7:""
8:"var params = {↵            AuthToken: $("#AuthToken").val(),↵            CurrentProjectId: $("#CurrentProjectId").val(),↵            CurrentServiceId: ($("#CurrentServiceId").val() == "") ? null : $("#CurrentServiceId").val(),↵            HelpUrl: "https://communities.bentley.com/communities/other_communities/sign-in_assistance_and_web_services/",↵            SignOutUrl: $("#SignOutUrl").val(),↵            LegalUrl: "https://dev-webportal-eus.cloudapp.net" + "/Legal"↵        };↵↵        GlobalHeaderFooter.setup(params);"
9:"{"appName":"Chrome","requestId":"f51b2a9f21e04898972e2e5463503faa"}"
10:""
length:11

 

I'm not sure what the problem is. It is saying that there is an unexpected colon, but line 9 seems to be normal. I believe this is a cause for my viewer to not show up on the page, but I'm not sure. 

Katia
Telerik team
 answered on 23 Aug 2017
1 answer
123 views

Hi,

I have to meet some requirements for a client:

1) Add different color bands in the chart to separate different levels.

2) Add the possibility to have multiline label on the axis. 

See the image in attachement.

 

I would like to know if it is possible to achieve that with telerik reporting graph.

Ivan Hristov
Telerik team
 answered on 22 Aug 2017
4 answers
77 views
I've never used the Telerik Reporting functionality, and before I delve into it too deep, I'm wondering something about capability.  All our apps, C# MVC apps, do not ever connect to a database.  We have a service layer, a C# REST API, that all our applications connect to, authenticate against, and retrieve data from.  Is it possible, using the Telerik Reporting functionality, be able to build a report using Lists?  Says a List<Invoice> where Invoice is a complex object containing header data, and a List of detail line item data?  If it does allow for this, where can I find some good examples or documentation on how to implement this?  Or does it absolutely have to connect to and use a database directly?
Peter
Telerik team
 answered on 21 Aug 2017
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?