Telerik Forums
Reporting Forum
1 answer
11 views
I have a scenario where I have multiple components, including tables, panels with textboxes, and charts/graphs. I want to add a page break after a specific panel to ensure that it appears on the new page regardless of the size of the content on the previous page. I do not see any straightforward way to do this, and the keepTogether property doesn't always work.
1 answer
37 views

Hi,

 

We have a requirement to create a report using the "Standalone Report Designer". We just want to open the standalone reporting tool from our desktop application at a button click and allow user to create their own reports. For that we have to pass the content of the report from the desktop application to the standalone tool. We tried to pass the argument in "Process.Start" Method. But we got an error message as in the attached image. 

Could you please help us to work on the standalone Report Designer tool with  C# WPF desktop application?

We want to know how the below items will be work.
1) How to open the standalone report designer programmatically (C#)?
2) How to pass the content from C# to the tool?

Thank You !

2 answers
47 views
currently we are using webservice datasource to generate a report but i want to change this datasource from webservicedatasource to jsondatasource, when i manually put the json in inline, its working perfectly but how to pass the data from programatically , as of now we are using telerik.reportserver.httpclient dll and createdocumentdata model to send an data to report but i could not see any fields available in the model to accept json data. Anyone help on this and its a large report it has lot of tables , list ,fields etc
1 answer
23 views

We have a JSON dataset (attached) where one of the nodes is a list of products. We are displaying these products in a table in the detail section. This table has the corresponding ProductList Datasource and has 3 columns: "UP", "Total", "Net UP".  We obtain the "UP" and "Total" directly from the DataSource (Fields.[@UP], Fields.[@Total]). To obtain the "Net UP" we need to check all Discounts nodes in the same line that [@Type]= "Comercial" , take the [@Rate] and multiply it with the Fields.[@UP] of that line.

We are trying to do this inserting a table to which we have bound its DataSource to the Fields.Discounts.Discount field in the "Net UP" column. With this we can obtain the [@Rate] of the discount but the problem here is that we can not address the Fields.[@UP] because it is in another context.

Do you have any idea how we can achieve that?

1 answer
287 views

Introduction

Based on the below json sample, I am trying to define a Telerik report using both a main report and a sub-report, where se second is fed with a subset of the main report json data.

Basically, data flow mimics something like:

  1. Application injects base json data into main report's jsonData(string) parameter;
  2. jsonData is binded as report datasource;
  3. Json data selector is applied;
  4. Json selected data Employes node is injected into a sub-report, which will also use it as a json data source.

Troubles arose on step 4, where I am getting an [Invalid value of report parameter 'jsonData'] error when main report is rendered.

It seems Telerik Report is unable to convert a selected json node field data into a proper string.

Full context

For full context:

  • On both reports:

    • There is a jsonData report parameter of string datatype;

    • There is a JsonDataSource defined;

    • Binding between the string jsonData parameter and main JsonDataSource is based upon:

      • Property path: Datasource.Source
      • Expression: = Parameters.jsonData.Value
  • On main report:

    • JsonDatasource $.Companies data selector is being used, resulting in a list representing containing de the companies list, each instance having:
  • Name, a string representing the company name;

  • Employes, an object containing the company employes list.

    • Full sample json data is injected thru jsonData parameter;
  • On sub-report:

    • There is also a jsonData report parameter of string datatype;
    • JsonDataSource $ data selector is being used, which should result in:
      • A list of the following fields:
        • Name, a string representing the name of the employe;
        • Wage, a numeric value representing employe's wage.
  • Again on main-report, I am using the following sub-report parameters mapping:

    • Parameter Name: jsonData
    • Parameter Value: Fields.Employes
  • I am using Telerik Report Designer v15.1.21.716 (Desktop)

It seems that data selector converts json Employes node date into a System.Object[], which is giving me a nice hard time figuring out how to convert it back to a json string.

I have alread extensively searched on documentation, web, ChatGPT and alikes for a valid solution. So far, no luck.

Before you help me

Although I have the most appreciation for anyones effort trying to helping me:

  • I am pursuing a json only data source solution. I mean, I am not interested on any other alternative suported Telerik Reporting datasources;
  • Solution must work in both design-time and runtime.
{
    "Companies": [
        {
            "Name": "Company1",
            "Employes": [
                {
                    "Name": "Joe",
                    "Wage": 1000
                },
                {
                    "Name": "Jack",
                    "Wage": 2000
                }
            ]
        },
        {
            "Name": "Company2",
            "Employes": [
                {
                    "Name": "Mary",
                    "Wage": 3000
                },
                {
                    "Name": "Mike",
                    "Wage": 4000
                }
            ]
        }
    ]
}
Momchil
Telerik team
 answered on 02 Jun 2023
1 answer
228 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
252 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!

1 answer
382 views

Hi all,

I have a report using the designer.  I attached a JSON data source in the report, just for structure usage purposes:

{
	"Data": [
		{
			"OrganizationId": "",
			"OrganizationUuid": "",
			"ParentOrgId": "",
			"OrganizationName": " ",
			"TotalUserCount": 0,
			"TotalDeviceCount": 0,
			"LicensedUserCount": 0,
			"ExpirationDate": "",
			"hasChildren": true
		}
	]
}

When I try to inject the actual JSON data at runtime, the report is still generated with the sample data.  Here's the lines generating the JsonDataSource:

            var data = new ReportData { Data = result };
            var ds = new JsonDataSource
            {
                Source = JsonConvert.SerializeObject(data),
                DataSelector = "$.Data",
                Name = "jsonDataSource1"
            };

Then I assign the data source to the report:

                using (var sourceStream = System.IO.File.OpenRead(_path + "\\Reports\\" + myRpt.ReportName))
                {
                    var reportPackager = new ReportPackager();
                    report = (Report)reportPackager.UnpackageDocument(sourceStream);

                    var dtsrc = new ObjectDataSource();
                    dtsrc.DataSource = myRpt.GenerateReport(_parameters);  // this is the JsonDataSource from above
                    dtsrc.Name = "jsonDataSource1";
                    report.DataSource = dtsrc;
                }

When I render the report, the data is not injected, it just shows the single sample record from the designer.  If I inject the actual JSON in the designer and do a preview, the report looks correct, so my guess is that I'm not doing this correctly.  Any help would be greatly appreciated.

Regards

Dimitar
Telerik team
 answered on 31 Oct 2022
0 answers
76 views

Is it possible to ignore case for JSON formatted web service data source results? So = Fields.Job_Title would pick up "job_Title": "General Labour"

Neil N
Top achievements
Rank 1
Iron
Veteran
Iron
 asked on 30 Sep 2022
0 answers
216 views

Say I have a list of object and I want a field to show one specific value from those objects.


public class Data
{
  public List<Obj> Objects { get; set;}
}

public class Obj
{
  public string Name { get; set;}
  public int Id { get; set;}
}

 

Data reportData = [

     {Name: abc, Id: 4 },

     {Name: def, Id: 5 }

]

I want to show the Name (in a textbox) where Id = 5. How do I do that?

 

I tried doing it with a user function where I pass the array but it throws an error when I try to cast object back to Obj class that (webservice.jsonObject can't be cast to Obj class). If I can't cast the object to Obj class, how am I supposed to filter it?

Miftaul
Top achievements
Rank 1
 asked on 12 May 2022
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?