Telerik Forums
Reporting Forum
3 answers
268 views

Hello,

We currently have a picture box on our PDF report that we want to open in a new tab / window on click but it is not working.

The designer file looks like this

            // 
            // pictureBox1
            // 
            navigateToUrlAction1.Url = "= MapLocation(Fields.UniqueId)"; // This calls and returns a url and is working fine
            navigateToUrlAction1.Target = Telerik.Reporting.UrlTarget.NewWindow; // Added this manually just in case, when using the designer and choosing New window under Link target it does not add this line, I assume its default behavior?
            this.pictureBox1.Action = navigateToUrlAction1;

 

We have tried to set the url to just http://google.com but same results.

Todor
Telerik team
 answered on 16 Mar 2020
2 answers
140 views
I have a dataset of products I'm trying to graph from a web service. When using the date field (which is a unix timestamp) as the category and the count of IDs as the values it's providing the incorrect results, even when I set the base unit to days/months/years etc. When I use another field other than date, the count returns what it should (as displayed in the difference between the two graphs in the screenshot). I've experimented with changing the groupings via the ToString() method on the date however it is producing inconsistent results. Any advice on what might be causing this?
Lachlan
Top achievements
Rank 1
 answered on 12 Mar 2020
1 answer
14.1K+ views
When I try to open the designer in visual studio I get the following error:
Value cannot be null. Parameter name: instance

I tried reinstalling the latest version of reporting but that did not fix it.

The designer worked before, the error began happening randomly one day.

Any suggestions?



Todor
Telerik team
 answered on 12 Mar 2020
7 answers
1.1K+ views

i followed the attachment in this post to create an object datasource. now i have to pass ten parameters into the datasource for getting some data from a query with almost one billion rows if not applied parameters. since i need to reuse existing infrastructure i have to use the method in our data layer project to get data. so adding dynamic object datasource is a must. how will i pass these parameters to the object datasource

also i would like to know if there is any way to pass all these 10 parameters as a model so i can forward the model from our webapi controller?

Todor
Telerik team
 answered on 11 Mar 2020
4 answers
493 views

Hello,

This is a thread that continues from the following post: https://www.telerik.com/forums/filter-graph-data

To give a default value to a graph, I have used this expression in the report parameter:

= AddMonths(Last(Fields.wDate), -12)

The above displays the past 12 months of data on a graph which has 5 years (60 months) of data.

However, the data that I have does not include weekends and public holidays. So in scenarios such as:

Latest date (Last(Fields.wDate)) is 2nd March 2020, and the 12 month previous data is from 2nd March 2019. 2nd March 2020 is on a Monday so data is recorded, but 2nd March 2019 was on a Saturday hence there is no data on it, which results in an error saying 'Missing or invalid parameter value. Please input valid data for all parameters.'

Is there a way where, if the -12 value is on a weekend or public holiday, it picks the data closest to it, for e.g. 4th March in this case. Or alternatively a function where I just get the latest year's worth of data by default? I have tried = Today().AddMonths(-12) but it also has the same issue.

I have also attached a screenshot of my report parameter.

Thank You

Kunal
Top achievements
Rank 1
 answered on 10 Mar 2020
3 answers
359 views
I create a report from JsonFile, I'm using vuejs, with asp.netcore, if i wanna change the json DataSource, for the data that i got from the consul to the REST api i vue, How can i do it dinamically
Todor
Telerik team
 answered on 10 Mar 2020
2 answers
130 views

Hello,

 I have an HTML Text Box that is rendering text as (at least) a double spaced. This needs to be single spaced. I have tried setting each list Item's (<li>

) enclosing span  to a line height of 105% and 100%  for two different attempts. Neither changed the spacing.

How is line spacing set?

 

HTML:

<p><span style="font-size: 13px; font-family: consolas"><span style="font-size: 13px; font-family: consolas">&nbsp;Notes to Merchant:</span></span></p><p><span style="font-size: 13px; font-family: consolas"><span style="font-size: 13px; font-family: consolas"> <p></p><p></p></span><p></p></span></p><p></p><p></p><p></p><p></p><p></p><p></p><ol><li><p><span style="font-size: 13px; font-family: consolas; line-height: 100%"><span style="font-size: 13px; font-family: consolas">&nbsp;1. No substitution of any articles allowed</span></span></p></li><li><p><span style="font-family: consolas; line-height: 100%">&nbsp;<span style="font-size: 13px"><span style="font-size: 13px">2. Articles must not exceed the stated cost of $200.00, unless with authorized signature.</span></span></span></p></li><li><p><span style="font-family: consolas; line-height: 100%">&nbsp;<span style="font-size: 13px"><span style="font-size: 13px">3. Invoices must not exceed the stated amount on the request form, unless with authorized signature.</span></span></span></p></li><li><p><span style="font-family: consolas; line-height: 100%">&nbsp;<span style="font-size: 13px"><span style="font-size: 13px">4. Do not accept request forms from parents 30 past date marked on voucher.</span></span></span></p></li><li><p><span style="font-family: consolas; line-height: 100%">&nbsp;<span style="font-size: 13px"><span style="font-size: 13px">5. All invoices must be received 30 days from the date of distribution to be honored.</span></span></span></p></li><li><p><span style="font-family: consolas; line-height: 100%">&nbsp;<span style="font-size: 13px"><span style="font-size: 13px">6. Send or bring invoices monthly to:</span></span></span></p></li></ol><p><span style="font-family: consolas"></span></p><p><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff">&lt;</span></span></span><span style="font-size: 13px; font-family: consolas; color: #800000"><span style="font-size: 13px; font-family: consolas; color: #800000"><span style="font-size: 13px; font-family: consolas; color: #800000">div</span></span></span><span style="font-size: 13px; font-family: consolas"><span style="font-size: 13px; font-family: consolas"> </span></span><span style="font-size: 13px; font-family: consolas; color: #ff0000"><span style="font-size: 13px; font-family: consolas; color: #ff0000"><span style="font-size: 13px; font-family: consolas; color: #ff0000">style</span></span></span><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff">="</span></span></span><span style="font-size: 13px; font-family: consolas; color: #ff0000"><span style="font-size: 13px; font-family: consolas; color: #ff0000"><span style="font-size: 13px; font-family: consolas; color: #ff0000">text-align</span></span></span><span style="font-size: 13px; font-family: consolas"><span style="font-size: 13px; font-family: consolas">:</span></span><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff">center"&gt;</span></span></span><span style="font-size: 13px; font-family: consolas"><span style="font-size: 13px; font-family: consolas">Baltimore City Schools</span></span><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff">&lt;</span></span></span><span style="font-size: 13px; font-family: consolas; color: #800000"><span style="font-size: 13px; font-family: consolas; color: #800000"><span style="font-size: 13px; font-family: consolas; color: #800000">br</span></span></span><span style="font-size: 13px; font-family: consolas"><span style="font-size: 13px; font-family: consolas"> </span></span><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff">/&gt;</span></span></span><span style="font-size: 13px; font-family: consolas"><span style="font-size: 13px; font-family: consolas">Office of Home and Hospital Program</span></span><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff">&lt;</span></span></span><span style="font-size: 13px; font-family: consolas; color: #800000"><span style="font-size: 13px; font-family: consolas; color: #800000"><span style="font-size: 13px; font-family: consolas; color: #800000">br</span></span></span><span style="font-size: 13px; font-family: consolas"><span style="font-size: 13px; font-family: consolas"> </span></span><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff">/&gt;</span></span></span><span style="font-size: 13px; font-family: consolas"><span style="font-size: 13px; font-family: consolas">2000 Edgewood Street – Lower Level</span></span><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff">&lt;</span></span></span><span style="font-size: 13px; font-family: consolas; color: #800000"><span style="font-size: 13px; font-family: consolas; color: #800000"><span style="font-size: 13px; font-family: consolas; color: #800000">br</span></span></span><span style="font-size: 13px; font-family: consolas"><span style="font-size: 13px; font-family: consolas"> </span></span><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff">/&gt;</span></span></span><span style="font-size: 13px; font-family: consolas"><span style="font-size: 13px; font-family: consolas">Baltimore, MD 21216</span></span><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff">&lt;</span></span></span><span style="font-size: 13px; font-family: consolas; color: #800000"><span style="font-size: 13px; font-family: consolas; color: #800000"><span style="font-size: 13px; font-family: consolas; color: #800000">br</span></span></span><span style="font-size: 13px; font-family: consolas"><span style="font-size: 13px; font-family: consolas"> </span></span><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff">/&gt;</span></span></span><span style="font-size: 13px; font-family: consolas"><span style="font-size: 13px; font-family: consolas">Attention: Allen Blackwell / Annette White</span></span><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff">&lt;/</span></span></span><span style="font-size: 13px; font-family: consolas; color: #800000"><span style="font-size: 13px; font-family: consolas; color: #800000"><span style="font-size: 13px; font-family: consolas; color: #800000">div</span></span></span><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff"><span style="font-size: 13px; font-family: consolas; color: #0000ff">&gt; <p></p><p></p><p></p></span></span></span></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><ol></ol> 

Michael
Top achievements
Rank 1
 answered on 10 Mar 2020
2 answers
139 views

 I need to print a voucher document, one page/ document per person.

 I have defined a data source to retrieve a single record (Select FullName, StudentId from Table where Student ID = '1234567')  but when I try to set the value of a text box in 'Edit Expression' there are no Fields in the Field list. When I key in =Fields.FullName, nothing appears in the preview. When I key in [=Fields.FullName] then I see [=Fields.FullName] in the Preview.

 

What am I missing?

 

Thank you

Michael
Top achievements
Rank 1
 answered on 10 Mar 2020
3 answers
160 views

Hi, 
I have the following problem. I have a report that contains a few graphs with X axis as DateTime and a subreport which is also a graph reused in many reports. It is not acceptable to me to set label, major and minor points units and ranges in designer since in one case I can have 7 days process, and in other case 5 minutes process. According to this I need to calculate total time and decide if I will set label, major and minor points in seconds, minutes or hours, and also to calculate range so that I have approximately 10 major points on the graphs X axes. To achieve this i am modifying values set in designer programmatically at runtime. I tried the following approaches, neither is working:

1. I used ItemDataBound event on report and subreport hoping that in the time it fires I will have report data source filled, so that I can use data source to get collection of data to calculate. This was not the case. Data source was still null at the time of firing. 

2.I tried to calculate explicitly by calling the public method in a report that will do the calculation. This was a successful approach for the graphs in the report since I call this method from outside the report after assigning data source, but still can't find a way to call public method in the subreport from the main report after the subreport bound the data source.

I would appreciate help.

Todor
Telerik team
 answered on 09 Mar 2020
1 answer
383 views

I used to Telerik reporing for data show. It is work order. but after update 2020 R1. I can not replace the connection string. please help.

my controller:

[Route("api/reports")]
    public class ReportsController : ReportsControllerBase
    {
        string reportsPath = string.Empty;

        public ReportsController(IHostingEnvironment environment)
        {
            this.reportsPath = Path.Combine(environment.WebRootPath, "UserUpload\\Reports");
            this.ReportServiceConfiguration = new ReportServiceConfiguration
            {
                HostAppId = "Html5DemoApp",
                Storage = new FileStorage(),
                ReportResolver = new ReportTypeResolver()
                                    .AddFallbackResolver(new ReportFileResolver(this.reportsPath)),
            };
        }


        [HttpGet("reportlist")]
        public IEnumerable<string> GetReports()
        {
            return Directory
                .GetFiles(this.reportsPath)
                .Select(path =>
                    Path.GetFileName(path));
        }
    }

 

viewer code:

<script>
    function ReportRendering(e,args) {
        var info = args.deviceInfo;
        //info.set("FontEmbedding", "Full");
    }
   
    function OnLoad()
    {
        var win = window.parent.GetWindow("WdIframe");
        var report = win.reportName;
        var parameters = win.reportParam;
        var printMode = /(chrome)/.test(navigator.userAgent.toLowerCase())
            ? telerikReportViewer.PrintModes.FORCE_PDF_PLUGIN
            : telerikReportViewer.PrintModes.FORCE_PDF_FILE;


        $("#reportViewer")
            .telerik_ReportViewer({
                serviceUrl: "../api/reports/",
                reportSource: {
                    report: report,
                    parameters: parameters,
                },
                viewMode: telerikReportViewer.ViewModes.PRINT_PREVIEW,
                scaleMode: telerikReportViewer.ScaleModes.SPECIFIC,
                scale: 1.0,
                enableAccessibility: false,
                sendEmail: { enabled: false }
            });


        //$("#reportViewer").telerik_ReportViewer({
        //    serviceUrl: "../Api/reports/",
        //        reportSource: {
        //            //report: "Telerik.Reporting.Examples.CSharp.ReportCatalog, CSharp.ReportLibrary",
        //            report: report,
        //            parameters: parameters,
        //    },
        //    renderingBegin:ReportRendering,
        //    viewMode: telerikReportViewer.ViewModes.PRINT_PREVIEW,
        //    scaleMode: telerikReportViewer.ScaleModes.SPECIFIC,
        //    scale: 1.0
        //});
        if (win.mode == "Print") {
            var reportViewer = $("#reportViewer").data("telerik_ReportViewer");
            reportViewer.bind(telerikReportViewer.Events.PAGE_READY, function (e) {
                reportViewer.commands.print.exec();
            });
        }
    }
    $(document).ready(OnLoad());
</script>

 

Katia
Telerik team
 answered on 06 Mar 2020
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?