Telerik Forums
Reporting Forum
3 answers
733 views
Hi,

If I want to use the Exec function in a table- or list row (outside group) to access data in context of a different scope (Report2, which is the name of the report item),
i get an error that the scope does not exist (see attachment).

My expression is in this format: [= Exec("Report2", Sum(Fields.theFieldName))]

Shouldn't this be possible, or am I wrong?

Thanks,

Casper
Casper
Top achievements
Rank 1
 answered on 19 Aug 2019
0 answers
92 views

Dear Mr/Mrs

Hello, I trying to set parameters to my app and does not working...

What is my problem ?

 

mojtaba
Top achievements
Rank 1
 asked on 18 Aug 2019
6 answers
610 views

I am using Table Wizard to display data. I am getting out the way I want but on every page break Table wizard draw an vertical line if it has more data in same table. Attached Image show my Problem (ProblemScreenshot). 

Can anyone help?

Thank You

Todor
Telerik team
 answered on 16 Aug 2019
2 answers
632 views

Hello,

I have a report that needs to dynamically change its currency symbol based on the customer.

Localization is set to true, and I have tried setting the data binding both on the entire report and specific text boxes that are formatted with {0:C2}.

When changing the culture manually to both the report and text box it works but applies those cultures to ALL reports.

The query field that shows the currency type returns as one of the following:

USD , EUR, GBP, CAD, CNY

This is the expression I am trying to use to dynamically change the culture of the text box based on the currency type returned.

IIF(Fields.InvoiceCurrencyCode IS NULL, (Default), IIF(Fields.InvoiceCurrencyCode = USD, (Default),IIF(Fields.InvoiceCurrencyCode = CAD,(Default),IIF(Fields.InvoiceCurrencyCode = GBP, en-GB,IIF(Fields.InvoiceCurrencyCode = EUR, nl-NL,IIF(Fields.InvoiceCurrencyCode = CNY,zh-CN,(Default)))))))

I have tried adding double quotations surrounding comparer and true values and it does not change anything.

In the Binding the property is set to Culture.

What am I missing to make this work?

Please and thank you.

Silviya
Telerik team
 answered on 16 Aug 2019
1 answer
268 views

I'm having issues with trying to add column that will perform arithmetic using info from 2 different tables with different datasources...

And because I need to expand upon info in the field.  I don't think I can put in simple arithmetic using the textboxes.. but I can't select the field from the other table... so how can I do this?  I attached a pic explaining it...

 

Please help?

Lily
Top achievements
Rank 1
Veteran
 answered on 15 Aug 2019
6 answers
1.7K+ views

Hello,

I have a report to show vehicle datas.

For each group here the vehicle, e.g. PCH W 100,  I calculate the difference with the formula

= (MAX(Fields.Mileage) - MIN(Fields.Mileage)) + " km"

(See black arrows in the attached screenshot!)

The result should be summed up and displayed in the bottom line.

But I have no idea how to make it.

This throw an exeption:

= Sum((MAX(Fields.Mileage) - MIN(Fields.Mileage)))

 

Best Regards.

 

 

 

 

Simon
Top achievements
Rank 1
 answered on 14 Aug 2019
4 answers
680 views

 

following exception occured in .net core api:

Telerik.Reporting.Processing.Data.SqlDataSourceException: Unable to establish a connection to the database. Please verify that your connection string is valid. In case you use a named connection string from the application configuration file, make sure the name is correct and the connection string settings are present in the configuration file of your application. ---> System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.

   at System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue)
   at System.Data.Common.DbConnectionOptions.ParseInternal(Dictionary`2 parsetable, String connectionString, Boolean buildChain, Dictionary`2 synonyms, Boolean firstKey)
   at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Dictionary`2 synonyms)
   at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
   at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)
   at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
   at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
   at Telerik.Reporting.Processing.Data.SqlCommandProvider.CreateConnection(String connectionString)
   at Telerik.Reporting.Processing.Data.SqlQueryProvider.CreateConnection()

Silviya
Telerik team
 answered on 14 Aug 2019
1 answer
147 views

I have a master report and a subreport.  The master report has a section that is assigned a data source and creates a line for each item in the data source, and one segment of that section is the subreport.  This is all done in UI, not programmatically.  The parameters are set up and sent properly, and if I just assign the parameters to a textbox in the subform, they are rendered properly.  However, I need that subreport to take a parameter and do some programmatic work, not just assign it to a field with UI configurations.  In this case, it reads a string parameter, calls other code with that string to generate more data, and uses that data to draw custom text objects on the form.

The parameter passing to a field works fine.  The code that reads does the extra building works fine.  What doesn't work is that the code in the subform is unable to read the parameters.  If I read ReportParamters[0].Value in the constructor method of the subform, it returns the default value of the parameter, not the value that shows up in the textbox.  I have tried capturing each of the raised events and testing on those points, all with the same results.  So far, it appears that the ReportParameters are not passed to the subform until all of the code-based events have transpired.  If I try to read the text-box programmatically, the value given is the formula for the parameter, not the value of the passed parameter.  Is there an event that I am missing, or is a subform just not expected to do any programmatic work with the parameters given?

Clifton
Top achievements
Rank 1
 answered on 13 Aug 2019
1 answer
298 views

Hi,

i need wrap text in tool tip TextBox. How i can do this?

 

Best reguards 

Kevin Moschella

Silviya
Telerik team
 answered on 13 Aug 2019
1 answer
939 views

// following example to create pdf from report template which created using standalone designer template

public class ReportsController : ReportsControllerBase
 {
     readonly string reportsPath = string.Empty;
        
     private IHostingEnvironment _hostingEnvironment;
        

    public ReportsController(ConfigurationService configSvc)
    {
        this.reportsPath = Path.Combine("PathWhereReportTemplatesStored", "Reports"); //concatenate the path using the OS path delimiter.
        
        this.ReportServiceConfiguration = new ReportServiceConfiguration
        {
            ReportingEngineConfiguration = configSvc.Configuration,
            HostAppId = "Html5DemoAppCore",
            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));
    }
         
    //https://www.telerik.com/support/kb/reporting/styling-and-formatting-reports/details/exporting-a-report-to-pdf-programmatically
    [HttpGet]
    public IActionResult createPdf()
    {
        string fileName = "report_" + DateTime.Now.Ticks + ".pdf";

        // https://docs.telerik.com/reporting/report-sources-viewers
        var uriReportSource = new Telerik.Reporting.UriReportSource();
        
        // Specifying an URL or a file path
        uriReportSource.Uri = reportsPath + "\\reportTemplate.trdp";    // report template designed using standalone report designer
        
        // Optional, pass param values to report, Adding the initial parameter values
        uriReportSource.Parameters.Add(new Telerik.Reporting.Parameter("param1", "value"));
        uriReportSource.Parameters.Add(new Telerik.Reporting.Parameter("param2", "value"));

        ReportProcessor reportProcessor = new ReportProcessor();

        RenderingResult result = reportProcessor.RenderReport("PDF", uriReportSource, null);     

        // to write pdf on disc, omit if not required
        using (FileStream fs = new FileStream("PathWhereYouWantToWritePdfOnDisk" + "pdfName.pdf", FileMode.Create))
        {
            fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
        }    

        return File(result.DocumentBytes, "application/pdf", fileName);    // in case , user clicks on link and download report
    }

 }

Silviya
Telerik team
 answered on 13 Aug 2019
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?