Some problems with ToolBar

As i was testing the Datagrid component i found some bugs with it. 

1. If you use the default toolbar with the default print function as this:
<SfGrid @ref="DefaultGrid" TValue="Client" AllowPaging="true" AllowGrouping="true" AllowFiltering="true" AllowPdfExport="true" AllowExcelExport="true" Toolbar="@Tool">
    <GridEvents OnToolbarClick="@ToolbarClick" TValue="Tangra.Shared.Models.Client"></GridEvents>

var Tool = (new List<string>() { "Search", "Print" });

on Mac, if the browser is in full screen, clicking on print opens new tab, witch is blank. Then if you return to the app, the print triggers, and you have to go back to the new tab. If the browser isn't in full screen you don't have that problem. Browser - Chrome.

This is also true for the demo - https://blazor.syncfusion.com/demos/datagrid/print?theme=bootstrap4, but there on fullscreen it opens the new tab and load the print data. Maybe the OdataV4 adaptor is the problem?

2. In the documentation here https://blazor.syncfusion.com/documentation/datagrid/tool-bar/ it's says that there is WordExport. No such thing when you try it. But there is CSV, witch is not mentioned.

3. In the same demo - 
https://blazor.syncfusion.com/demos/datagrid/exporting?theme=bootstrap4 it is said that the id for the default exports are as such:
args.Item.Id == "Grid_pdfexport"
But there are not. You can bypass this as this:
private List<Object> Toolbaritems = new List<Object>() { "Add", "Print", "Search", new ItemModel() { Text = "PDF Export", TooltipText = "PDF", Id = "PDF" }
and then
if (args.Item.Id == "PDF"), but i don't think this is the expected.

4. If you put the default "ExcelExport", "CsvExport", "PdfExport" in the toolbar, without other configuration with Adaptors.ODataV4Adaptor they don't trigger, and you have to implement them with args.Item.Id

5in

6 Replies 1 reply marked as answer

ST Stefan July 10, 2020 06:24 PM UTC

Can i get update on this?



VN Vignesh Natarajan Syncfusion Team July 13, 2020 03:27 PM UTC

Hi Stefan,  
 
Thanks for contacting Syncfusion support.  
 
Query: “ This is also true for the demo - https://blazor.syncfusion.com/demos/datagrid/print?theme=bootstrap4, but there on fullscreen it opens the new tab and load the print data. Maybe the OdataV4 adaptor is the problem? 
 
We have validated the reported issue at our end and we are not able to reproduce the reported issue in our online demo sample. Print page gets rendered properly without any error. But in some devices (IPad, IPhone,MAC) we face the popup blocker issue by browser while printing. Once we enable the popups, Print window is displayed in it. So kindly ensure the reported issue by enabling the browser popup. (safari) or PopUp blocker (Chrome) 
 
After ensuring the above solution, if you are still facing the issue. Kindly get back to us with following details.   
 
  1. Share the mac device details along with OS version.
  2. Share the screenshot of the issue you are facing.
  3. Are your facing empty Grid (without records) on print preview window?
  4. Share your Syncfusion Nuget package version.  
 
Above requested details will be helpful for us to validate the reported issue at our end and provide solution as soon as possible. 
 
Query: “it's says that there is WordExport. No such thing when you try it. But there is CSV, witch is not mentioned. 
 
Sorry for the inconvenience caused. We have logged an improvement task to update our UG documentation and it will be refreshed as soon as possible. 
 
Query: “it is said that the id for the default exports are as such: args.Item.Id == "Grid_pdfexport" But there are not. You can bypass this as this:” 
 
Yes. Exporting in DataGrid is carried out by calling the respective Export methods(ExcelExport(), PdfExport(), CSVExport()). These methods can be triggered from different source like External Button, Default ToolarItem, CustomToolbar Item.  
 
In the demo sample, we have defined the DataGrid with Static ID property and used built Toolbar items (render with export icons). Hence we have used “Grid(Grid ID)” + “_pdfexport” to differentiate  the toolbar items and export the Grid data to respective formats. It can be modified as per the toolbar item clicked handler.  
 
Query: “If you put the default ExcelExport”, “CsvExport”, “PdfExport” in the toolbar, without other configuration with Adaptors.ODataV4Adaptor they don’t trigger, and you have to implement them with args.Item.Id 
 
Yes, Default toolbar Items (ExcelExport, CsvExport, PdfExport) are used to render the toolbar items with their corresponding export icons. Even though we have defined the built in exporting toolbar buttons, it is necessary to handle the actions in OnToolbarClick event of Grid. 
 
Refer the below  code example.  
 
@{ 
    var Tool = (new List<string>() { "ExcelExport""CsvExport","PdfExport""Print" }); 
} 
  
<SfGrid ID="Grid" @ref="DefaultGrid" TValue="Order" Toolbar="@Tool" AllowPdfExport="true" AllowExcelExport="true" AllowPaging="true"> 
    <GridEvents TValue="Order" OnToolbarClick="ToolbarClickHandler"></GridEvents> 
. . . . .  . .  
</SfGrid> 
  
@code{ 
    SfGrid<Order> DefaultGrid { getset; } 
    public async Task ToolbarClickHandler(Syncfusion.Blazor.Navigations.ClickEventArgs args) 
    { 
        if (args.Item.Id == "Grid_excelexport"// GridID + "_excelexport" to identify excelexport toolbar click 
        { 
            await DefaultGrid.ExcelExport(); 
        } 
        if (args.Item.Id == "Grid_pdfexport"// GridID + "_pdfexport" to identify pdfexport toolbar click 
        { 
            await DefaultGrid.PdfExport(); 
        } 
        if (args.Item.Id == "Grid_csvexport"// GridID + "_csvexport" to identify csvexport toolbar click 
        { 
            await DefaultGrid.CsvExport(); 
        } 
    } 
 
 
For your convenience we have prepared a sample with ODataV4Adaptor and Exporting with default toolbar items.  
 
 
Kindly get back to us if you have further queries.   
 
Regards, 
Vignesh Natarajan  


Marked as answer

ST Stefan July 15, 2020 06:50 AM UTC

Query: “ This is also true for the demo - https://blazor.syncfusion.com/demos/datagrid/print?theme=bootstrap4, but there on fullscreen it opens the new tab and load the print data. Maybe the OdataV4 adaptor is the problem?”

1. IMac Retina 4k, 2017. MacOS Catalina version 10.15.5
2. I attached rar file with videos of the problem
3. Are your facing empty Grid (without records) on print preview window? Only with the new 18.2.0.44, as you can see on the videos
4. Teste 18.2.0.44 and 18.1.0.59 You can see in the rar.

When i use 18.2. there is no data shown, also now excel export doesnt work. When i use 18.01. the bug that print doesnt trigger as expected is precent. 

The code is in the rar.

Attachment: Archive_2_dc7320f9.zip


VN Vignesh Natarajan Syncfusion Team July 16, 2020 03:44 PM UTC

Hi Stefan,  
 
Thanks for the video demo 
 
Query: “When i use 18.2. there is no data shown, 
 
We have validated the reported at our end and we are able to reproduce the reported issue at our end while printing with ODataV4 Adaptor. We have confirmed it is a bug and logged defect report “Printing is not working with Remote Data in Grid" for the same. Thank you for taking the time to report this issue and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle ) and including the defect fix in our weekly patch release which is expected to be rolled out on or before 29th July 2020  
 
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link. 
 
 
Till then we appreciate your patience.  
 
Query: “When i use 18.01. the bug that print doesnt trigger as expected is precent.  
 
Since we are facing issue with RemoteData in our latest version 18.2.0.44. Kindly ensure the reported issue (printing from fullscreen mode) by upgrading to our latest version 18.2.0.44 with local data and get back to us.  
 
Query: “also now excel export doesnt work

 
From your query we understand that you are facing issue while exporting the Grid to excel format after upgrading to our 18.2.0.44 version. Kindly share the following details to validate the reported issue at our end.   
 
  1. Are you facing any exception or script error in browser console. If yes, share the screenshot of the issue.
  2. Are you facing the issue only in MAC machine alone?
  3. If possible share the issue reproducible sample
 
Regards, 
Vignesh Natarajan 
 



ST Stefan July 16, 2020 03:48 PM UTC

Query: “also now excel export doesnt work


It's just OdataV4 the problem. It causes all the problems - printing, excel and csv exports. Waiting for resolve next week few weeks.


VN Vignesh Natarajan Syncfusion Team July 17, 2020 11:03 AM UTC

Hi Stefan,  

Thanks for the update.  

We will get back to you once the weekly patch release gets successfully rolled along with fixes for reported issues. 

Regards, 
Vignesh Natarajan 


Loader.
Up arrow icon