Trying to open a spreadsheet

1 Answer 61 Views
SpreadProcessing
Chris
Top achievements
Rank 2
Iron
Iron
Iron
Chris asked on 13 Nov 2023, 01:46 PM | edited on 13 Nov 2023, 05:26 PM

I need to open a spreadsheet from a template in my project.  I'm referencing this article: https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/working-with-workbooks/create-open-and-save-workbooks#open-a-workbook

The immediate issue I have is I don't think I have the right libraries.  I'm starting just trying to open the file.  I get an namespace error.


public async Task PopulateReport()
{
    string filePath = "~/misc/report_template.xlsx";

    Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook;
    // the XLSX format provider is used for demo purposes and can be replaced with any format provider implementing the IWorkbookFormatProvider interface
            IWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider();

    using (Stream input = new FileStream(filePath, FileMode.Open))
    {
        workbook = formatProvider.Import(input);
    }
}

 

I have the Telerik.UI.for.Blazor package installed.  My understanding was that document processing was included.  What am I missing?  I guess its worth mentioning I don't have a login to Telerik Nuget.  I think it has to do with my company's licensing, I downloaded the package from an internal website.

1 Answer, 1 is accepted

Sort by
0
Chris
Top achievements
Rank 2
Iron
Iron
Iron
answered on 13 Nov 2023, 05:34 PM
As soon as I typed the update, it hit me.  I was looking at the wrong source for more packages to install.  I had to tell VS about the local Telerik packages.  I'm so embarrassed.  LOL
Yoan
Telerik team
commented on 14 Nov 2023, 09:41 AM

Hi Chris,

I am glad to hear you were able to resolve this on your own. Just in case I am leaving here a few related articles about setting up the DPL references that I believe might prove useful:

Regards,

Yoan

Tags
SpreadProcessing
Asked by
Chris
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Chris
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or