Display Header Text Event

Hi. I'm trying to change the name shown in the columns fields(into PivotGrid visualization, not pivotSetting.PivotRows) but I can not find a server side event to use. I can not use client-side events. How can I do? Thank you.

11 Replies

SA Scintilla Arul Jothi Raj Syncfusion Team March 8, 2018 12:56 PM UTC

Hi Simone, 

Currently we don’t have any event to change the header text. Meanwhile you can change the header caption while initializing PivotGrid. Please find the document and sample below for more details. 


 
Please let us know if you have any queries. 

Regards, 
Tamilarasu M


MA marco March 8, 2018 01:50 PM UTC

As Simone was saying,

Our requirement is to change the display-name only of any column (even nested). Looking at the provided solution, we are going to change the field Value, which would means to loose any correlation with underlying data.
We are approching relational data with custom dictionary on column values means that a column may indeed have value: 1, and displayed as "Foo", while its value is unchaged. When you filter, you will see "Foo" but the value sent will be 1.

That way we consider our requirement accomplished.

When we'll go to OLAP we'll get still the same requirements: we need the engine, filters, ordering (etc) work with real values, while letting user to "Decode" its own fashion any categorical Data the engine provide to the page.

If this is not possibile, will be possible in version 2? Is there another way to accomplish our requirement (a doubled dialect on categorical data)? We know of joining table, but we can't afford to go that way, nor to operate client-side. We need to do this server-side and stay inobtrusive to the pivot engine.

Thanks for clarification,

Marco Ganio Vecchiolino


SA Scintilla Arul Jothi Raj Syncfusion Team March 9, 2018 12:36 PM UTC

Hi Marco,  

Please find the response below 

Query 
Response 
Our requirement is to change the display-name only of any column (even nested). Looking at the provided solution, we are going to change the field Value, which would means to loose any correlation with underlying data. 
We are approching relational data with custom dictionary on column values means that a column may indeed have value: 1, and displayed as "Foo", while its value is unchaged. When you filter, you will see "Foo" but the value sent will be 1. 
 
That way we consider our requirement accomplished. 
With the provided information, we understand that your requirement is to change member caption displayed in PivotGrid column header. Please find the code snippet below  
 
Code Snippet: [C#] 
[System.Web.Http.ActionName("InitializeGrid")] 
[System.Web.Http.HttpPost] 
public Dictionary<string, object> InitializeGrid(Dictionary<string, object> jsonResult) 
{ 
  dynamic customData = serializer.Deserialize<dynamic>(jsonResult["customObject"].ToString()); 
   htmlHelper.PivotReport = BindDefaultData(false); 
htmlHelper.PivotEngine.PivotSchemaChanged += PivotEngine_PivotSchemaChanged; 
            dict = htmlHelper.GetJsonData(jsonResult["action"].ToString(), ProductSales.GetSalesData(), jsonResult["valueSorting"].ToString());              
            return dict; 
        } 
 
void PivotEngine_PivotSchemaChanged(object sender, PivotSchemaChangedArgs e) 
{ 
    if(htmlHelper.PivotEngine.PivotValues!=null) 
    for (int i = 0; i < this.htmlHelper.PivotReport.PivotColumns.Count; i++) 
         { 
         htmlHelper.PivotEngine.PivotValues[i].ForEach(x => 
         {                         
           if (x != null && x.FormattedText == "Canada") 
               x.FormattedText = "ME"; 
           else if (x != null && x.FormattedText == "Canada Total") 
                x.FormattedText = "ME Total"; 
               }); 
 
            } 
        } 

Note: Need to change total text while changing member text and need to trigger “PivotSchemaChanged” in all action methods

Meanwhile we have also prepared a sample based on your requirement. 
Sample: http://www.syncfusion.com/downloads/support/forum/136290/ze/PivotGrid_MemberCaption179765584 


Note: While opening filter dialog currently we don’t have any option to change member caption and we need to under some source level changes to achieve your requirement. The fix for this issue is estimated to be available in our Essential Studio 2018 Volume 1 Service Pack Release 1 which is estimated to be rolled out by end of March 2018. 
When we'll go to OLAP we'll get still the same requirements: we need the engine, filters, ordering (etc) work with real values, while letting user to "Decode" its own fashion any categorical Data the engine provide to the page. 
 
If this is not possible, will be possible in version 2? Is there another way to accomplish our requirement (a doubled dialect on categorical data)? We know of joining table, but we can't afford to go that way, nor to operate client-side. We need to do this server-side and stay inobtrusive to the pivot engine. 
You can customize the required header text that needs to display in PivotGrid with the help of member caption property available in OLAP cube and all our features will work based on member name not on member caption as per your requirement. And currently we don’t have support to change member caption for “en-US” culture (Locale identifier 1033).  Meanwhile we suggest you try with different locale identifier. Please find the localization sample in the below link 

Sample: 
 
Documentation 


Please let know if you have any concerns. 

Regards, 
Scintilla A 



SI Simone March 13, 2018 09:18 AM UTC

Thank you for your example. It works. I also started to try the PivotClient and now I have to report the changed name in the PivotGrid also in the PivotChart. Always on the server side. How can I do? I did some tests and searched for documentation but I can not.


TM Tamilarasu M Syncfusion Team March 14, 2018 11:55 AM UTC

Hi Simone 
We understand that your requirement is customize the header text displayed in the PivotGrid and PivotChart for PivotClient control. We have prepared sample based on your requirement Please find the sample and code snippet below for more details. 
Code Snippet: [C#] 
[System.Web.Http.ActionName("InitializeClient")] 
[System.Web.Http.HttpPost] 
public Dictionary<string, object> InitializeClient(Dictionary<string, object> jsonResult) 
{ 
 this.BindData(); 
 pivotClient.PivotEngine.PivotSchemaChanged += PivotEngine_PivotSchemaChanged; 
  return pivotClient.GetJsonData(jsonResult["action"].ToString(),    ProductSales.GetSalesData(), jsonResult["clientParams"].ToString()); 
} 
 
void PivotEngine_PivotSchemaChanged(object sender, PivotSchemaChangedArgs e) 
 { 
  if (pivotClient.PivotEngine.PivotValues != null) 
   for (int i = 0; i < pivotClient.PivotReport.PivotColumns.Count; i++) 
   { 
    pivotClient.PivotEngine.PivotValues[i].ForEach(x => 
    { 
     //Customizing header text 
     if (x != null && x.FormattedText == "Bike") 
     { 
        x.FormattedText = "ME"; 
        x.Value = "ME"; 
     } 
     else if (x != null && x.FormattedText == "Bike Total") 
        x.FormattedText = "ME Total"; 
   //Note: While customizing header text need to customize total values also like above in order to work drilldown related scenarios correctly. 
  }); 
  } 
 } 
 
 
If this doesn’t match your requirement, kindly provide more details about your requirement with sample/video (if possible) which would be helpful for us to proceed further. 
 
Regards, 
Tamilarasu M 



SI Simone replied to Tamilarasu M March 29, 2018 09:22 AM UTC

Hi Simone 
We understand that your requirement is customize the header text displayed in the PivotGrid and PivotChart for PivotClient control. We have prepared sample based on your requirement Please find the sample and code snippet below for more details. 
Code Snippet: [C#] 
[System.Web.Http.ActionName("InitializeClient")] 
[System.Web.Http.HttpPost] 
public Dictionary<string, object> InitializeClient(Dictionary<string, object> jsonResult) 
{ 
 this.BindData(); 
 pivotClient.PivotEngine.PivotSchemaChanged += PivotEngine_PivotSchemaChanged; 
  return pivotClient.GetJsonData(jsonResult["action"].ToString(),    ProductSales.GetSalesData(), jsonResult["clientParams"].ToString()); 
} 
 
void PivotEngine_PivotSchemaChanged(object sender, PivotSchemaChangedArgs e) 
 { 
  if (pivotClient.PivotEngine.PivotValues != null) 
   for (int i = 0; i < pivotClient.PivotReport.PivotColumns.Count; i++) 
   { 
    pivotClient.PivotEngine.PivotValues[i].ForEach(x => 
    { 
     //Customizing header text 
     if (x != null && x.FormattedText == "Bike") 
     { 
        x.FormattedText = "ME"; 
        x.Value = "ME"; 
     } 
     else if (x != null && x.FormattedText == "Bike Total") 
        x.FormattedText = "ME Total"; 
   //Note: While customizing header text need to customize total values also like above in order to work drilldown related scenarios correctly. 
  }); 
  } 
 } 
 
 
If this doesn’t match your requirement, kindly provide more details about your requirement with sample/video (if possible) which would be helpful for us to proceed further. 
 
Regards, 
Tamilarasu M 


Hi. there is a way to do the same thing of the last post with Olap Source? And other question is: can use drillThrough with custom text?(OLAP and Relational Mode). If there isn't mode send me a workaround. Thank you.


MM Manikandan Murugesan Syncfusion Team March 30, 2018 04:29 PM UTC

Hi Simone, 
 
Please find the response below. 
 
S.No 
Query 
Comments 
1. 
Hi. there is a way to do the same thing of the last post with Olap Source? 
We don’t have any separate event to change the member caption in OLAP. But, you can customize the required header text that needs to display in PivotGrid with the help of member caption property available in OLAP cube and all our features will work based on member name not on member caption as per your requirement. Kindly refer below link. 
And currently we don’t have support to change member caption for “en-US” culture (Locale identifier 1033).  Meanwhile we suggest you try with different locale identifier. Please find the localization sample in the below link. 
 
Sample:  
  
Documentation  
2. 
And other question is: can use drillThrough with custom text? 
We have faced issue while using Drillthrough after customizing header text and we have fixed this issue, which is included in our Essential Studio Volume 1, SP 1 2018 (v16.1.0.32) and is available for download under the following link. 
 
Kindly refer below documentation link to enable DrillThrough in PivotGrid. 
 
 
And, we are glad to announce that our Essential Studio Volume 1, SP 1 2018 (v16.1.0.32) is rolled out and is available for download under the following link. 
 
                              
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
 
Thanks, 
Manikandan. 



SI Simone April 6, 2018 02:13 PM UTC

Hi Manikandan,

I'm getting confused about what is possible to do and what not.. I Try to recap our requirements, please keep in mind we are striving to use Syncfusion components both in OLAP and Relational Mode.

First: We would preferer to use the PivotClient, but fall-back to Pivot Grid if any doesn't work by the end of April.
Second: If a requirement is not possible to be achieved we need to know it by now so we can elaborate further.

Kindly. follow the list of requirements as strictly as possible so I get no confused, in a single post:

1. Syncronize change of schema "live" in a PivotGrid with a PivotChart => this is naturally achieved by pivotClient (keep in mind we might fall-back to separated controls, yet)

2. Let the user define at run time its own dictionary in any column: that means we won't change the OLAP representation, but only the view one. This may sound trivial but it isn't: we don't have to affect the value, but only the displayName and only in View, per-user;

3. We need to drill-through both in relational and olap scenario, possibly keeping any custom dictionary applied. We can't afford to send the custom header provided "live" back to the underlying OLAP o persistence engine, we need the pivot-engine or a customized pivot-engine to handle this while computing the data.

4. You mentioned that the OLAP cube should "support drill-trough features": once again I get confused here: you sent me a link to a properly created cube, however which it was that did the trick? How should I build-up the cube in order to support drilling?

5. As you pointed out in the very first stage of my spiking, we need to paginate for we are going to have lot of records.

As a final fall-back solution to get something in a reasonable spiking time, we could prepare the result server-side and consume it client side, meaning that in relational mode I get millions of record, use a pivot-engine, and send thousands of record to the client. Then client-side we achieve our requirement even by customizing a little your components. This would be natural with OLAP but we cannot relay on that only.

Thanks in advance for clarifying the multiple questions in a single "point of recap".
We'll tell also about the level of assistance reveived to our decision maker, for the strongness of a solution is also the support given with it.

Simone





SA Scintilla Arul Jothi Raj Syncfusion Team April 9, 2018 03:51 PM UTC

Hi Simone, 

Please find the response below. 

Query 
Response 
1. Syncronize change of schema "live" in a PivotGrid with a PivotChart => this is naturally achieved by pivotClient (keep in mind we might fall-back to separated controls, yet) 
You can synchronize PivotSchemaDesigner for separated controls (PivotGrid and PivotChart). But While using PivotSchemaDesigner with PivotChart, you will have to face some limitations (like drilldown etc). So it is better to use PivotClient for synchronizing schema changes with PivotGrid and PivotChart controls. 
2. Let the user define at run time its own dictionary in any column: that means we won't change the OLAP representation, but only the view one. This may sound trivial but it isn't: we don't have to affect the value, but only the displayName and only in View, per-user; 
Currently we don’t have “Caption Text support for headers in OLAP datasource”. We have logged this as improvement. It be available in the upcoming Essential Studio 2018 Volume 1 SP2 release. 
3. We need to drill-through both in relational and olap scenario, possibly keeping any custom dictionary applied. We can't afford to send the custom header provided "live" back to the underlying OLAP o persistence engine, we need the pivot-engine or a customized pivot-engine to handle this while computing the data. 
For Relational: 
Currently drillThrough will not work for relational datasource. We have already logged this as an issue and the fix for the issue will be available in the upcoming Essential Studio 2018 Volume 1 SP2 release which is estimated to be available .  

For Olap:  
You can have drillThrough support for OLAP with custom captions. This problem will be solved by the response given in the second query. 
 
4. You mentioned that the OLAP cube should "support drill-trough features": once again I get confused here: you sent me a link to a properly created cube, however which it was that did the trick? How should I build-up the cube in order to support drilling? 
You can configure drillThrough in cube level(SSAS) by following the below link.  


5. As you pointed out in the very first stage of my spiking, we need to paginate for we are going to have lot of records. 
You can use paging support for Pivot Controls while binding large set of records. Please refer the code snippet below. 

Code Snippet: [cshtml] 
@Html.EJ().Pivot().PivotGrid("PivotGrid1").Url(Url.Content("../api/PivotGrid"))    
@Html.EJ().Pivot().PivotPager("Pager1").Mode(PivotPagerMode.Both).TargetControlID("PivotGrid1") 
 
Code Snippet: [C#] 
 
For Relational: 
PivotReport pivotReport = new PivotReport(); 
pivotReport.EnablePaging = true; 
pivotReport.PagerOptions.SeriesPageSize = 4; 
pivotReport.PagerOptions.CategoricalPageSize = 5; 
pivotReport.PagerOptions.SeriesCurrentPage = 1; 
pivotReport.PagerOptions.CategoricalCurrentPage = 1; 
 
For OLAP: 
OlapReport olapReport = new OlapReport(); 
olapReport.CurrentCubeName = "Adventure Works"; 
olapReport.EnablePaging = true; 
olapReport.PagerOptions.SeriesPageSize = 4; 
olapReport.PagerOptions.CategoricalPageSize = 5; 
olapReport.PagerOptions.CategoricalCurrentPage = 1; 
olapReport.PagerOptions.SeriesCurrentPage = 1; 
 
Please find the below documentation link for more details. 

Regards, 
Scintilla A 



MA marco replied to Scintilla Arul Jothi Raj April 16, 2018 03:33 PM UTC

Hi Simone, 

Please find the response below. 

Query 
Response 
1. Syncronize change of schema "live" in a PivotGrid with a PivotChart => this is naturally achieved by pivotClient (keep in mind we might fall-back to separated controls, yet) 
You can synchronize PivotSchemaDesigner for separated controls (PivotGrid and PivotChart). But While using PivotSchemaDesigner with PivotChart, you will have to face some limitations (like drilldown etc). So it is better to use PivotClient for synchronizing schema changes with PivotGrid and PivotChart controls. 
2. Let the user define at run time its own dictionary in any column: that means we won't change the OLAP representation, but only the view one. This may sound trivial but it isn't: we don't have to affect the value, but only the displayName and only in View, per-user; 
Currently we don’t have “Caption Text support for headers in OLAP datasource”. We have logged this as improvement. It be available in the upcoming Essential Studio 2018 Volume 1 SP2 release. 
3. We need to drill-through both in relational and olap scenario, possibly keeping any custom dictionary applied. We can't afford to send the custom header provided "live" back to the underlying OLAP o persistence engine, we need the pivot-engine or a customized pivot-engine to handle this while computing the data. 
For Relational: 
Currently drillThrough will not work for relational datasource. We have already logged this as an issue and the fix for the issue will be available in the upcoming Essential Studio 2018 Volume 1 SP2 release which is estimated to be available .  

For Olap:  
You can have drillThrough support for OLAP with custom captions. This problem will be solved by the response given in the second query. 
 
4. You mentioned that the OLAP cube should "support drill-trough features": once again I get confused here: you sent me a link to a properly created cube, however which it was that did the trick? How should I build-up the cube in order to support drilling? 
You can configure drillThrough in cube level(SSAS) by following the below link.  


5. As you pointed out in the very first stage of my spiking, we need to paginate for we are going to have lot of records. 
You can use paging support for Pivot Controls while binding large set of records. Please refer the code snippet below. 

Code Snippet: [cshtml] 
@Html.EJ().Pivot().PivotGrid("PivotGrid1").Url(Url.Content("../api/PivotGrid"))    
@Html.EJ().Pivot().PivotPager("Pager1").Mode(PivotPagerMode.Both).TargetControlID("PivotGrid1") 
 
Code Snippet: [C#] 
 
For Relational: 
PivotReport pivotReport = new PivotReport(); 
pivotReport.EnablePaging = true; 
pivotReport.PagerOptions.SeriesPageSize = 4; 
pivotReport.PagerOptions.CategoricalPageSize = 5; 
pivotReport.PagerOptions.SeriesCurrentPage = 1; 
pivotReport.PagerOptions.CategoricalCurrentPage = 1; 
 
For OLAP: 
OlapReport olapReport = new OlapReport(); 
olapReport.CurrentCubeName = "Adventure Works"; 
olapReport.EnablePaging = true; 
olapReport.PagerOptions.SeriesPageSize = 4; 
olapReport.PagerOptions.CategoricalPageSize = 5; 
olapReport.PagerOptions.CategoricalCurrentPage = 1; 
olapReport.PagerOptions.SeriesCurrentPage = 1; 
 
Please find the below documentation link for more details. 

Regards, 
Scintilla A 


Hi Scintilla,

We are getting in hurry to POC a porting of other vendor's (old) library on Syncfusion, mainly because of the partnership with Microsoft which in turn is basically our base-line technology.
As we get near to the Deadline, we get more anxious for we understand from your accurate report that we can't even try to port currently requested functionalities on Syncfusion components, until the SP2 of the libraries has been released (Did you give it for released?).
Please let us know if any other approach in Syncfusion may help to speed-up.

Thanks in advance,
Marco



SA Scintilla Arul Jothi Raj Syncfusion Team April 17, 2018 12:15 PM UTC

  
Hi Marco,    
  
Considering your urgency and to provide patch for “Caption text support for headers in OLAP datasource” a support incident has been created under your account.   
  
Please log on to our support website to check for further updates.   
  
Regards,   
Scintilla A   


Loader.
Up arrow icon