Telerik Forums
Telerik Document Processing Forum
1 answer
2 views

I'm able to export data to an .xlsx file.  That file is exported to E:/SaoApps/Sims/wwwroot/exports and the user has full control over that folder.  The file successfully is created at that location.  But the file doesn't open or offer download to the user and the error message is:

In the attached code snippet, the passed exportsFolder = "E:/SaoApps/Sims/wwwroot/exports/" and passed lanId = "DSS"

"An error occurred trying to start process 'E:/SaoApps/Sims/wwwroot/exports/ContactsSearchResults_DSS.xlsx' with working directory 'E:\\Workspace\\Intranet\\Sims\\Sims'. The process cannot access the file because it is being used by another process."

 

System.ComponentModel.Win32Exception (32): An error occurred trying to start process 'E:/SaoApps/Sims/wwwroot/exports/ContactsSearchResults_DSS.xlsx' with working directory 'E:\Workspace\Intranet\Sims\Sims'. The process cannot access the file because it is being used by another process.
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at Sims.Agency.Data.Services.AgencyExportService.ExportContactSearchResults(String criteria, List`1 searchResults) in E:\Workspace\Intranet\Sims\Sims.Agency.Data\Services\AgencyExportService.cs:line 424
   at Sims.Contacts.Pages.ContactSearchBase.ExportToExcel() in E:\Workspace\Intranet\Sims\Sims.Contacts\Pages\ContactSearchBase.cs:line 327
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
Yoan
Telerik team
 answered on 12 Apr 2024
1 answer
33 views

Hello,

I am trying to upload the stream object received from the 'ToXlsxStream' method of Telerik SpreadSheet processing library to Azure blob container. Unfortunately, it is saving as a blank excel file. I have data in the List object which is getting converted to xlsx stream. Not sure why the excel file is blank. Tried to save the stream to my local file explorer as well. Still, the issue persists. 

Below is the code:

 

  try
   {
Stream exportStream = exportFormat == SpreadDocumentFormat.Xlsx ? workOrderList.ToXlsxStream(columnsData, (string)options.title.ToString(), cellStyleAction: cellStyle) : workOrderList.ToCsvStream(columnsData);

Task.Factory.StartNew(() => AzureHelper.UploadReportOnCloud(exportStream,fileName, ConfigurationManager.AppSettings[Constant.REPORTATTACHMENTCONTAINER]));

}

            catch(Exception ex)
            {

            }

 

Please help me to resolve this issue.  

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 18 Dec 2023
1 answer
57 views

Hello,

I have a corrupted XLSX file from CSV dataSource

With other CSV dataSource all is ok

In example in file-attach, I added CSV dataSource with corruption

There are 2 bad lines in generated XLSX file and CSV file have a good format !!!

It's not an issue with codepage or separator !

It's a projet DotNet Core 6 with last version 2023.2.713.20 of API

Do you have encountered this error already ?

Best regards

Cyril REILER

 

 

 

Cyril
Top achievements
Rank 1
Iron
 updated answer on 26 Sep 2023
1 answer
217 views


Hi all, 

I got some problems when I try to read my Excel file as below:

1. It skipped the null cells, it only read data at the cells having value. For example in my case, after reading cell 2 at row 2, it jumped to cell 14. 

2. It showed the error message "The given key '3' was not present in the dictionary." at cell 15

You can see my code, the Excel file I used, and the result in below

My code

@page "/testpage"
@using Telerik.Documents.SpreadsheetStreaming;
<div>
    @((MarkupString)(str.ToString()))
</div>


@code {
    private StringBuilder str = new StringBuilder();
    protected override void OnInitialized()
    {
        str = ReadData();
    }
    private StringBuilder ReadData()
    {

        try
        {
            string filename = ".\\Template.xlsx";
            using (FileStream fs = new FileStream(filename, FileMode.Open))
            {
                using (IWorkbookImporter workBookImporter = SpreadImporter.CreateWorkbookImporter(SpreadDocumentFormat.Xlsx, fs))
                {
                    foreach (IWorksheetImporter worksheetImporter in workBookImporter.WorksheetImporters)
                    {
                        foreach (IRowImporter rowImporter in worksheetImporter.Rows)
                        {
                            foreach (ICellImporter cell in rowImporter.Cells)
                            {
                                if(cell.Value!= null)
                                {
                                    str.Append(cell.Value.ToString());

                                }
                                else
                                {
                                    str.Append("NULL");
                                }
                                str.Append(",");
                            }
                            str.Append("<br/>");
                        }

                    }
                }
            }
            return str;
        }
        catch(Exception ex)
        {
            str.Append("<br/>");
            str.Append(ex.Message);
            return str;
        }

    }
}
 My Excel file as a picture below, I also attached my Excel in the question (Template.rar)

  The result when I run 

  Everyone who know how to fix it, please help me.

Thank you

Yoan
Telerik team
 answered on 04 Jul 2023
1 answer
75 views

I need to rotate the text vertically.

It seems the TextRotation is unavailable when using Telerik.Documents.SpreadsheetStreaming.SpreadCellStyle.

How do I apply text rotation to a style using SpreadsheetStreaming?

 

Thanks,

 

Jim

Anna
Telerik team
 answered on 28 Apr 2023
1 answer
54 views

Hello All, 
I am using Telerik.Documents.SpreadsheetStreaming assembly with Version 2020.3.1019.20. I just need how to assign text having hyperlink to ICellExporter object here. Please suggest me if there is any wrong here.

string policy = "<a href=\"https://www.termsfeed.com/blog/sample-terms-and-conditions-template/\">Policy Terms</a>";
string showText = "For necessary info, Please refer " + policy;
//rowExporter -> IRowExporter object here
using var cellExporter = rowExporter.CreateCellExporter();
cellExporter.SetValue(showText);

Thanks

Sam

Dimitar
Telerik team
 answered on 10 Mar 2023
1 answer
78 views

Hi,

I'm using IWorksheetExporter (Telerik.Documents.SpreadsheetStreaming library)  to create big Excel files, ~400 mb xlsx.

I need to add notes to header cells like what is available here https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/features/notes but it doesn't look to be available in the Streaming library.

I see two possible workarounds.

  1. Create my header row with RadSpreadProcessing and reopen the same file for the batch processing with the streaming dll. But I can't find how to append to a worksheet, the only thing that looks like appendable to an existing file is new worksheet.
  2. Create the big file with the streaming library and reopen it with RadSpreadProcessing to add the notes. What will be the performance hit to do that? Does opening an excel file load everything in memory? So saving it back will also recreate the whole file?
  3. Do you have another solution

NB. Trying to completely create this file via the RadSpreadProcessing library throw a "Stream was too long" from within the library while saving it.

NB. I'm using the latest version from the nuget stream.

Thanks

Nikolay Demirev
Telerik team
 answered on 13 Feb 2023
1 answer
82 views

Hello All,

I am using the RadSpreadStreamProcessing to export data to an Excel spreadsheet and I would like to know how to declare the column headers in the exported spreadsheet as Sortable/Filterable?  Is there an example that I can be pointed to?

Thanks for any help you can provide.

W

Tanya
Telerik team
 answered on 01 Nov 2022
3 answers
57 views

Hi all I have a problem during the import of an existing excel file with formula inside

(e.c.  IF(H1<>"";IF(J1="";"";INDEX(INDIRECT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE("Var_"&C1&"_"&G1&"_"&H1;" ";"hex20");"-";"hex2d");"(";"hex28");")";"hex29");"/";"hex2f");"+";"hex2b");"&";"hex26");".";"hex2e")&"_Daily");MATCH(J1;INDIRECT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE("Var_"&C1&"_"&G1&"_"&H1;" ";"hex20");"-";"hex2d");"(";"hex28");")";"hex29");"/";"hex2f");"+";"hex2b");"&";"hex26");".";"hex2e")&"_Levels");0)));""

or

==EOMONTH(startdate;-1)

These formula are used in different cells in different sheets and when I try to bind the generated json to a spreadsheet component I received this error: 

  • {message: 'Expected op «,» but found sym «Var_» (input: _matr…"hex2b");"&";"hex26");".";"hex2e")&"_Service")"))', pos: 139}
    1. message: "Expected op «,» but found sym «Var_» (input: _matrix(\"INDIRECT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(\"Var_\"&C1;\" \";\"hex20\");\"-\";\"hex2d\");\"(\";\"hex28\");\")\";\"hex29\");\"/\";\"hex2f\");\"+\";\"hex2b\");\"&\";\"hex26\");\".\";\"hex2e\")&\"_Service\")\"))"
    2. pos: 139
    3. [[Prototype]]: H

     

    As posted in some forum  It seems due  to the culture used during excel generation (I tried different approach: attached a different culture to the current thread server side, force kendo core library to use a specific culture client side, force spreadsheet to use a specific culture server side).

    How can I resolved this issue?

    I did not found any working solution on line.

    Thank you in advanced

    Eleonora

Eleonora
Top achievements
Rank 1
Iron
 answered on 27 Oct 2022
1 answer
58 views

Used with Blazor, anyway we can get rid of this warning?

Telerik.Documents.SpreadsheetStreaming 2022.2.613 requires Telerik.Zip (= 2022.2.613) but version Telerik.Zip 2022.3.906 was resolved

Dimitar
Telerik team
 answered on 04 Oct 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?