Telerik Forums
Telerik Document Processing Forum
0 answers
51 views

Hi,

empty asp net core project

when trying to export a empty file (code from examples) and always get the error:

"Index and count must refer to a location within the string (Parameter 'count')" (see on screenshot)

 

(the export logic is bound to the "Privacy" route in the "Home" controller)

windows 7, visual studio 2022, telerik asp net core 2021.3.1109

project attachet

 

alex
Top achievements
Rank 2
Iron
 updated question on 28 Jan 2022
1 answer
91 views

Hi,

I'm using the Telerik spreadsheet component to open an excel file embedded in a Winforms page.

I notice that dependent dropdowns do not work anymore, they show as empty.

What's the best way to have a dependent dropdown shown with Telerik?

I've tried multiple methods like https://www.contextures.com/xldataval02.html or with Index/Match combination in the Data Validation, all work directly in Excel .. but once opened in the embedded page with Telerik these dependent dropdowns  don't work anymore and show as empty.

I notice the named ranges dissappear once opened with the component.

Any advice / suggestions on this?

Thx in advance!

Svilen
Telerik team
 answered on 26 Jan 2022
1 answer
272 views

Hi,

I have a simple Excel file with just one sheet and one image in .xls and in .xlsx (attached in the zip file).

When reading the files using the XlsFormatProvider or XlsxFormatProvider, I get a workbook. When iterating the shapes on every sheet, I have a different result. I can retrieve the image using the XlsxFormatProvider in the xlsx file, but I'm not getting any shapes in the .xls file using the XlsFormatProvider.

Some code below:

var provider = new XlsxFormatProvider();
using (var fs = File.OpenRead("image.xlsx"))
{
    var workbook = provider.Import(fs);
    Assert.AreEqual(workbook.ActiveWorksheet.Shapes.Images.Count(), 1);
}

Should I be doing this differently? Or is this a known limitation?

I'm using version 2021.3.909.40.

Edit: just noticed that the same goes for charts.

Tanya
Telerik team
 answered on 08 Nov 2021
8 answers
190 views
Hi!

I adapted the example "CreateModifyExport" in xaml-sdk to create a workbook then export it via XlsxFormatProvider. This works fine except that when I open the exported file in Excel 2013 (64 bit) there are no gridlines visible. Maybe I missed something but there is no code where gridlines are enabled/disabled.
Second issue is that AutoFitWidth is not working correctly, the column width does not fit the text.

Regards
Neils 
Edward
Top achievements
Rank 1
Veteran
Iron
Iron
 answered on 05 Nov 2021
2 answers
269 views

Hi

Recently I upgraded our c# project making use of the  Telerik.Documents.Spreadsheet.FormatProviders.OpenXml component from 2021.1.322 to  2021.2.50 (actually to the latest 2021.3.909 but in this case that doesn't matter.

I want to make use of the CONCAT function which is supported in this version.

After upgrading the unittests stopped working on the fact that the worksheet functions (after setting some values in the worksheet) are not completely executed/updated. After rolling back the version to 2021.1.322 it worked again (but the concat function is not supported).

Regards,

Bart Huls

 

Nikolay Demirev
Telerik team
 answered on 06 Oct 2021
1 answer
257 views

I'm trying to convert a DataTable to a spreadsheet.

According to the documentation:

To use the DataTableFormatProvider you need to reference the Telerik.Windows.Documents.Spreadsheet assembly.

After adding a reference to this assembly, Visual Studio still does not recognize it. Where can I find the DataTableFormatProvider?

Thanks,

Tim

Tanya
Telerik team
 answered on 31 Aug 2021
4 answers
398 views

Hi

Using Telerik.Windows.Documents.Spreadsheet.Model.Workbook class, it seems there is no VLOOKUP function, although there is a LOOKUP function which works almost the same way. The lack of VLOOKUP specifically impacts my ability to load existing Excel documents. Is there a way to add a VLOOKUP function to the SpreadProcessing engine?

Thanks,

Guy

Duncan
Top achievements
Rank 1
Iron
 answered on 08 Aug 2021
0 answers
114 views

We are migrating to telerik but our main issue is that XlsFormatProvider keep gaving OutOfMemoryException when importing files  either on stream or bytes, and this where easily imported on same machines using ASPOSE dlls

 

is there a way to have this sorted out another library i should use or different class?

Fernando
Top achievements
Rank 1
 updated question on 03 Aug 2021
5 answers
593 views

Not sure that this actually qualifies as a bug, but it was unexpected behavior.  For unit testing I was creating an empty Workbook document and writing it to a file.  It turns out, that the file is corrupt unless it has a Worksheet added to it.  The XlsxFormatProvider does not issue any error and happily writes a 3k file, but Excel can't read it.  Excel throws a dialog "We found a problem with some content in the 'test.xlsx'.  Do you want us...".  Selecting Yes eventually comes back with a "The workbook cannot be opened or repaired by Microsoft Excel because it is corrupt." message.

Simply adding a worksheet:

workbook.Worksheets.Add()

will allow it to create a file that Excel will handle.  Again, not sure you could call this a bug, but it wasn't what I expected it to do.  It might be better if the XlsxFormatProvider threw an exception for trying to write out an empty file.  

At any rate, figured I throw this out there in case anyone else runs into this behavior.

David
Top achievements
Rank 2
 answered on 13 Apr 2021
1 answer
91 views

While evaluating Telerik.Documents.Spreadsheet.Trial (2021.1.118) I've encountered a bug with registering custom functions in .NET 5.

 

I'm using a console application, and trying to register a couple of functions right at the start of the Main() method. It works like a charm with target framework netcoreapp3.1.

But as soon as I bump the version to net5.0, registering a function throws an exception (I've copied the full stack below).

Perhaps you can guide me what happens? We're currently evaluating on upgrading our license for the latest features, but this thing could be crucial to us, since we need to use .NET 5 for a couple of reasons.

 

I'm calling them right at the start of the applicaption

public static void Main(string[] args)
{
  FunctionManager.RegisterFunction(new AAA());
  FunctionManager.RegisterFunction(new BBB());
  ...
}

 

Here's the exception stack:

Unhandled exception. System.TypeInitializationException: The type initializer for 'Telerik.Windows.Documents.Spreadsheet.Expressions.Functions.FunctionManager' threw an exception.
 ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.TypeInitializationException: The type initializer for 'Telerik.Windows.Documents.Spreadsheet.Expressions.Functions.Db' threw an exception.
 ---> System.ArgumentOutOfRangeException: Index and count must refer to a location within the string. (Parameter 'count')
   at System.String.Remove(Int32 startIndex, Int32 count)
   at Telerik.Windows.Documents.Spreadsheet.Formatting.FormatHelper.FindAllOccurrences(String value, String part)
   at Telerik.Windows.Documents.Spreadsheet.Formatting.FormatHelper.ReplaceSeparators(String formatString, Predicate`1 shouldReplaceWithGroupSeparator, Predicate`1 shouldReplaceWithDecimalSeparator, String newGroupSeparat
or, String newDecimalSeparator)
   at Telerik.Windows.Documents.Spreadsheet.Formatting.FormatHelper.ReplaceCultureSpecificSeparatorsWithDefaults(String formatString, Nullable`1 formatStringCategory)
   at Telerik.Windows.Documents.Spreadsheet.Model.CellValueFormat..ctor(String formatString, Boolean convertToInvariant, Nullable`1 formatStringCategory)
   at Telerik.Windows.Documents.Spreadsheet.Model.CellValueFormat..ctor(String formatString)
   at Telerik.Windows.Documents.Spreadsheet.Expressions.Functions.Db..cctor()
   --- End of inner exception stack trace ---
   at Telerik.Windows.Documents.Spreadsheet.Expressions.Functions.Db..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& hasNoDefaultCtor)
   at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions)
   at System.Activator.CreateInstance(Type type)
   at Telerik.Windows.Documents.Spreadsheet.Expressions.Functions.FunctionManager..cctor()
   --- End of inner exception stack trace ---
   at Telerik.Windows.Documents.Spreadsheet.Expressions.Functions.FunctionManager.RegisterFunction(FunctionBase function)
   at Iface.Oik.ScriptEngine.Program.Main(String[] args) in C:\Users\alexeid\Rider\Iface.Oik.ScriptEngine\src\Program.cs:line 20

Dimitar
Telerik team
 answered on 25 Jan 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?