Telerik Forums
Reporting Forum
2 answers
10 views
Hello

I have these rows of data coming from DataSource example is in the attached file image


- Want to do some math expressions of every row like Subtraction(BRUTO - DESCUENTO) and show the value in NETO painted in the pink line and circle for individual rows of data.
- I tried to use the expressions SUM(DOC_UNID_BRUTO) and SUM(DOC_UNID_DESCUENTO) try to get the Total SUM of these fields but are just getting the individual first value.
- And the last thing is I want to do a subtraction of the total of NETO and DESCUENTO in the last bottom right corner
1 answer
13 views

I'm relatively new to the Standalone Report Designer, so I apologize if this is expected behavior. I'm connecting to Postgres and have everything set up correctly (AFAIK). If I open the .NET Report Designer via the EXE, the data connection initializes and I get data. However, if I click on a TRDP file to open the designer, the data connection doesn't initialize and I get an "Unable to establish a connection to the database" message with inner exception "Cannot load type for DbProviderTypeName "Npgsql.NpgsqlFactory". Why would opening the EXE directly be any different from opening via TRDP? This feels like a bug, but there may some documentation I just haven't made it to yet.

My current setup:

  • Standalone Report Designer v18.0.24.305
  • Npgsql v6.0.10
  • Npgsql.dll exists in the same directory as Telerik.ReportDesigner.Net.exe
  • Connection string and assembly reference added to Telerik.ReportDesigner.Net.dll.config
  • config file snippet:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <connectionStrings>
        <clear />
        <add name="Telerik.Reporting.Examples.CSharp.Properties.Settings.TelerikConnectionString" connectionString="Data Source=No Local Servers Found!;Initial Catalog=AdventureWorks;Integrated Security=SSPI" providerName="System.Data.SqlClient"/>
        <add name="{theName}" connectionString="{theConnectionString}" providerName="Npgsql" />
    </connectionStrings>
  
    <Telerik.Reporting>
        <AssemblyReferences>
            <add name="Npgsql" />
        </AssemblyReferences>
    </Telerik.Reporting>
</configuration>

1 answer
111 views

Hi, I have stored procedure which is splitted on 2 parts.

CREATE PROCEDURE dbo.MyProcedure
@ReportPart smallint
AS
IF @ReportPart = 0
BEGIN
SELECT ColumnPart0Id, ColumnPart0Name, ColumnPart0Code
FROM Table
END
ELSE IF @ReportPart = 1
BEGIN
SELECT ColumnPart1Address, ColumnPart1PostCode, ColumnPart1Contractor
FROM Table
END


When I execute procedure in Telerik Report Designer (SQL Data Source) with

EXEC dbo.MyProcedure
@ReportPart = 0

everything is ok, but after execute query

EXEC dbo.MyProcedure
@ReportPart = 1

I have error "Can't setup column 'ColumnPart0Name'. This value violates limit MaxLength of this column".

It's weird because in @ReportPart = 1 there isn't any column name like ColumnPart0Name, it exists in first "IF" .

Is it bug?

Query works fine in SSMS.

 

Wojciech
Top achievements
Rank 1
Iron
 answered on 18 Oct 2023
2 answers
95 views

Hi support team,

Currently I have 3 reports called A, B, C with format *.trdp

I used CustomReportResolver to bind datasource for these reports. The problem is I have to use if else condition to know which report is A or B or C to get and bind correct data to the report. Imagine I have 100 reports it will be nightmare for me.

Do we have any way to resolve this or any way to get data source at run time for Standalone Report except the way I described above ?

NOTE: Before I used Visual Studio Report Designer and use NeedDataSource event in each report to get data for them now I have this issue when migrate to Standalone Report Designer.

Example Code:

public ReportSource Resolve(string reportId, OperationOrigin operationOrigin, IDictionary<string, object> currentParameterValues)
{
    var reportPath = Path.Combine(this.ReportsPath, reportId);
    var reportPackager = new ReportPackager();

    Report report = null;
    using (var sourceStream = File.OpenRead(reportPath))
    {
        report = (Report)reportPackager.Unpackage(sourceStream);
    }

    if (reportId == "A")
    {
        if (operationOrigin == OperationOrigin.GenerateReportDocument)
        {
            report.DataSource = GetDataForReportA();
        }        
    }
  else if (reportId == "B")
    {
        if (operationOrigin == OperationOrigin.GenerateReportDocument)
        {
            report.DataSource = GetDataForReportB();
        }        
    }
else if (reportId == "C")
    {
        if (operationOrigin == OperationOrigin.GenerateReportDocument)
        {
            report.DataSource = GetDataForReportC();
        }        
    }

    return new InstanceReportSource
    {
        ReportDocument = report
    };
}


Thanks

Amr
Top achievements
Rank 1
Iron
 updated answer on 23 Aug 2023
1 answer
59 views

I'm pretty new to Telerik Report Designer, and I could use some help. Let me also preface this by saying, I'm looking for a solution that doesn't require code, and only uses the tools available in Telerik itself (if such a solution even exists).

I'm working on a report to calculate the number of vacant beds in living spaces. To do so, I'm getting the difference between the total number of beds and the number of residents.

The problem is, the data for getting the number of beds and the data for getting the number of residents are in two different Data Sources... so, I can't use an expression to calculate the difference, as I can only use the Data Source that's bound to the report for expressions. I have been able to use tables to display both values, but the fact remains, I can't calculate the difference between them.

I know I can set one of the values as an invisible parameter, but the problem with that is, that value becomes fixed, and is the same for every living space in the report, when I need it to be different for each one.

Does anyone know of a solution to this? Again, one that doesn't require code.

Thanks in advance.

1 answer
223 views

We have a JSON dataset where one of the nodes is a list of products. We have generated a DataSource based on this product list. Within each product node, there is an AdditionalInfos node, which is a list of data that complements each product. Find example attached.


        "ProductList": {
           "Product": [
          {
            "@Item": "Item1",
            "@BeginDate": "17/05/2023",
            "@Total": 253054.99,
            "AdditionalInfos": {
              "AdditionalInfo": [
                {
                  "@Key": "Vehiculo",
                  "@Value": "MCG02"
                },
                {
                  "@Key": "Terminal",
                  "@Value": "TERMINAL A"
                },
 
              ]
            }
          },
          {
            "@Item": "Item2",
            "@BeginDate": "16/05/2023",
            "@Total": 1234678.12,
            "AdditionalInfos": {
              "AdditionalInfo": [
                {
                  "@Key": "Vehiculo",
                  "@Value": "MCG03"
                },
                {
                  "@Key": "Terminal",
                  "@Value": "TERMINAL B"
                },
 
              ]
            }
          },
          {
            "@Item": "Item3",
            "@BeginDate": "15/05/2023",
            "@Total": 5646548.35,
            "AdditionalInfos": {
              "AdditionalInfo": [
                {
                  "@Key": "Vehiculo",
                  "@Value": "MCG04"
                },
                {
                  "@Key": "Terminal",
                  "@Value": "TERMINAL B"
                },
 
              ]
            }
          },
         ]
	}

Our goal is to generate a graphical representation of the product lines grouped by the AdditionalInfo lines with the Key "Terminal." The desired output should be as follows:

Terminal A
        Item1      17/05/2023       253054.99
Terminal B
        Item2     16/05/2023       1234678.12
Item3     15/05/2023       5646548.35

We would like to know the best approach to achieve this in Telerik Reporting Standalone. Is it possible to generate a DataSource with all the information at the same level and then perform grouping based on it?

Any guidance or examples would be highly appreciated. Thank you in advance for your assistance!

1 answer
249 views

We have a case where we have the following json data source as the source of data:

{
    "Transaction":
    {
        "ProductList": {
            "Product":[
                {
                    "@Item": "Product Name 001",
                    "@Price": 1.00,
                    "Taxes": {
                        "Tax" :[
                            {
                                "@Type": "TaxType1",
                                "@Amount": 1.00
                            },
                            {
                            "@Type": "TaxType2",
                            "@Amount": 2.00
                            }
                        ]
                    }
                },
                {
                    "@Item": "Product Name 002",
                    "@Price": 1.00,
                    "Taxes": {
                        "Tax" :[
                            {
                                "@Type": "TaxType2",
                                "@Amount": 1.00
                            },
                            {
                            "@Type": "TaxType2",
                            "@Amount": 2.00
                            }
                        ]
                    }
                }
            ]
        }
    }
}

We have imported it into Telerik Designer in such a way that it appears like this in the Data Source Explorer:

We want to display in a table, for each Product line, the sum of all its Product.Taxes.Tax.Amount in addition to the product's own data. e.g
ProductName 001 | Product Price 001 | Sum(Product.Taxes.Tax.Amount) for Product 1
ProductName 002 | Product Price 002 | Sum(Product.Taxes.Tax.Amount) for Product 2

We can easily access attributes of Product such as "Item" or "Price". The problem arises when we want to access the sum of the Product.Taxes.Tax.Amount for each product.

It seems that the expression editor and Data Source configurator is not able to reach the depth level of Product.Taxes.Tax.Amount. We tried to acces via JSON Path in the Data Source but didn't work

How can we represent the Product.Taxes.Tax.Amount sum for each Product in a table?

Thanks in advance!

2 answers
77 views

Currently, I have two different parameters. One uses Fields.ID the other needs to use Field.ID2 However, using the code below. I am unable to rename ID to ID2. If I use ID It modifies Parameter1's ID field instead of Parameter2's ID field. I need to use dual union to be able to select all employees but when I run it with the "AS" command for renaming ID to ID2 it errors out(see below code). If I run it without the dual union. It works and renames ID to ID2. But, then I do not have the ability to select all employees which I need. How can I fix this in the report designer? is there a better way or am I using my code wrong, what would be a good solution to this?

 

How can I get this to work and rename ID to ID2 for the second source using the code below so that I can still use the dual union?

 

[Doesn't work]

SELECT TO_NCHAR('All Employees') AS FirstName, TO_NCHAR('*') AS LastName, 0 AS ID FROM DUAL
UNION
select FirstName, LastName, ID AS ID2

FROM Personnel
ORDER BY LastName NULLS FIRST

 

[Works]

select FirstName, LastName, ID AS ID2

FROM Personnel
ORDER BY LastName NULLS FIRST

 

 

Thank you!

1 answer
82 views

Good Afternoon Telerik Forums,

I have a MainData (SQLDataSource) a (Tech1DataSource) and a (Tech2DataSource).

 

I have 4 parameters currently. From Date(start date), To Date(end date), Tech1IDParameter, Tech2IDParameter.

If I remove Tech2IDParameter- the report loads fine without an error. However, when I add in Tech2IDParameter (pointing to Tech2DataSource) I get the error below.

 

Tech1IDParameter and Tech2IDParameter are virtually identical in the settings and parameter fields except for what they query. Any help would be greatly appreciated! Please see the error below.

 

Unable to get report parameters.
An error has occurred.
Cannot evaluate parameter 'Tech2IDParameter'.

Austin
Top achievements
Rank 2
Iron
Iron
Iron
 updated answer on 14 Feb 2023
1 answer
81 views

Good Afternoon Telerik,

 

Currently, I have 1 report where I am searching for all the machines in the database using a parameter querying Machine OS(with values in it like Android, IPhone, Windows 10, Windows 8, etc..). It is located in a table called Assets. Here is a sample query of what I am querying. When I run the table with the only sql datasource it returns my selection on the preview data. However, when I run it on the Telerik server the parameter field on the right hand side is completely blank with no values.

SELECT

at.machine name, at.machineos

FROM assets at

WHERE at.machineos IN (:MachineOS)

 

However, when I add a new SQLDataSource with the same information above and attach the datasource under the parameter to that. It displays the values and correctly queries the data. How can I get it to retrieve the values of the first datasource without making another datasource with the same exact query?

 

(I should also mention, the database is running on a oracle server)

Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?