I have a license for UI for WPF 2020 R3 SP1 and I can see a dll called Telerik.Windows.Documents.Spreadsheet
I just can not find any way of utilizing this? Wonder if there is no control associated or why it is there?
I just need to be able to display the content of an Excel xlsx file. No edit, no nothing...
2 Answers, 1 is accepted
Hello Hans-Henrik,
The Telerik.Windows.Documents.Spreadsheet assembly contains the document model used by RadSpreadsheet control. To display .xlsx files, you can use the RadSpreadsheet. For more information, check the help documentation.
Regards,
Martin Ivanov
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
So I am trying to make this work, but running in to other issues
My XAML
<telerik:RadSpreadsheet Grid.Row="1" x:Name="xlslViever">
<telerik:RadSpreadsheet.FormatProviders>
<xlsx:XlsxFormatProvider/>
</telerik:RadSpreadsheet.FormatProviders>
</telerik:RadSpreadsheet>
Reading my document from a memeorystream
XlsxFormatProvider formatProvider = new XlsxFormatProvider();
DocSource = formatProvider.Import(_stream);
xlslViever.Workbook = _vm.DocSource as Workbook;
_vm.Viewer = xlslViever;
but triggering this exception
I am positive that the dll's referenced are from the same package.
But obviously referencing something wrong.. just not clear to me what is wrong.. trying to just get a minimum example working.
full XAML
<UserControl x:Class="TMWpfClient.UserControls.Application.ReportView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:xlsx="clr-namespace:Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx;assembly=Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<telerik:RadToolBar>
<telerik:RadPathButton ToolTip="Print the report" Command="{Binding PrintCommand}" HorizontalAlignment="Left" VerticalAlignment="Stretch" Margin="2" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" IsBackgroundVisible="False" PathGeometry="M6.7000122,14.300007L25.400024,14.300007 25.400024,26.4 6.7000122,26.4z M0,3.5000009L4.6000366,3.5000009 4.6000366,6.6999988 27.5,6.6999988 27.5,3.5000009 32,3.5000009 32,17.800007 27.5,17.800007 27.5,12.000003 4.6000366,12.000003 4.6000366,17.800007 0,17.800007z M6.6000366,0L25.299988,0 25.299988,4.6999983 6.6000366,4.6999983z"/>
<telerik:RadPathButton ToolTip="Save the report" Command="{Binding SaveCommand}" HorizontalAlignment="Left" VerticalAlignment="Stretch" Margin="2" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" IsBackgroundVisible="False" PathGeometry="{StaticResource SaveIcon}"/>
</telerik:RadToolBar>
<telerik:RadPdfViewer Grid.Row="1" x:Name="pdfViewer"/>
<telerik:RadSpreadsheet Grid.Row="2" x:Name="xlslViever">
<telerik:RadSpreadsheet.FormatProviders>
<xlsx:XlsxFormatProvider/>
</telerik:RadSpreadsheet.FormatProviders>
</telerik:RadSpreadsheet>
</Grid>
</UserControl>
And doing it this way, I see the excption in the UI preview...