Telerik Forums
Telerik Document Processing Forum
2 answers
152 views

When I am trying to merge cells in a spreadsheet I get the error "The given key was not present in the dictionary.", I am able to merge cells accross columns on the same row using MergeAccross but I am unable to merge cells in the same column over multiple rows. I am not sure if this is a bug or if it just something I am doing. Any help would be appreciated.

For d As Integer = 0 To arrDate.GetUpperBound(0)
                               fromCellIndex = New CellIndex(5, d + 1)
                               toCellIndex = New CellIndex(10, d + 1)
                               xlWorkSheet.Cells(fromCellIndex, toCellIndex).Clear(ClearType.All)
                               nCellSelection = xlWorkSheet.Cells(fromCellIndex, toCellIndex)
                               nCellSelection.Merge()  <-- Line the error gets thrown.

next d

 

Tanya
Telerik team
 answered on 30 Mar 2017
2 answers
332 views

Hi,
I'm trying to insert a bullet list in a RadFixedPage using the FixedContentEditor object.

I understood how to do using the RadFixecDocumentEditor object. Please find a very small example here below:
List list = editor.Lists.AddList(ListTemplateType.BulletDefault);
editor.ParagraphProperties.ListId = list.Id;
editor.ParagraphProperties.ListLevel = 0;
editor.InsertParagraph();
editor.InsertLine("Item 1");
editor.InsertParagraph();
editor.InsertLine("Item 2");
editor.InsertParagraph();
...

But I tried in all ways that I could but I didn't understand in the documentation how to do the same using the FixedContentEditor class.

Could you please give me a short example that shows how to insert a List in a RadFixedPage using the FixedContentEditor class?

Thanks in advance

Giorgio

Giorgio
Top achievements
Rank 1
 answered on 24 Mar 2017
1 answer
265 views

Hi, I wonder if you can help with my issue

I have a problem when I try to convert a docx to pdf. The error I get is the following: The type initializer for 'Telerik.Windows.Documents.Fixed.Model.FixedDocumentDefaults' threw an exception

I use the following code:

byte[] renderedBytes2 = null;
                Telerik.Windows.Documents.Common.FormatProviders.IFormatProvider<RadFlowDocument> formatProvider2 = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();
                using (MemoryStream memoria2 = new MemoryStream())
                {
                    formatProvider2.Export(document, memoria2);
                    renderedBytes2 = memoria2.ToArray();
                    //string nombre = "EstudioBNF.pdf";
                    GuardarHistoria(nombrepdf, memoria2);
                }

The things to note are:

* No exception is thrown when the project is run from Visual Studio..

*The exception is thrown at runtime

Tanya
Telerik team
 answered on 22 Mar 2017
5 answers
892 views

I am trying to export a number of images (up to several hundreds) into a PDF file (client-side in Silverlight). Here is a sample code that simulates this task:

// controlToExport is a control on the screen
RadBitmap bitmap = new RadBitmap(controlToExport);
for (int i = 0; i < 50; i++)
{
    var page = this.document.Pages.AddPage();
    page.Content.AddImage(new Telerik.Windows.Documents.Fixed.Model.Resources.ImageSource(bitmap.Bitmap));
}
// stream is User's file
var exportProvider = new Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider();
exportProvider.Export(this.document, stream);

 

This works but the export consumes ~500MB of memory while busy, which causes out-of-memory exceptions on lower end machines. How can I minimize the memory consumption.

In the real scenario, the loop will create many different images and will add them to the document instead of adding same image many times.

Deyan
Telerik team
 answered on 20 Mar 2017
3 answers
406 views

Hi,

I want to enumerate and modify mergefields manually in a table, because Telerik is currently not supported nested mail merge (ref: https://feedback.telerik.com/Project/184/Feedback/Details/190035-wordsprocessing-nested-mail-merge)

 

I found some code snippets similar to code below, but i can't find the FieldRangeStart type in the Word Processing Libraries for ASP.NET Ajax, seems it's works only WPF libraries? Isn't it?

 

foreach (FieldRangeStart fieldStart in document.EnumerateChildrenOfType<FieldRangeStart>())
{
    if (fieldStart.Field is MergeField)
    {
        mergeFields.Add(fieldStart);
    }
}

 

What do you suggest for enumerate and modify merge fields manually?

 

Tanya
Telerik team
 answered on 02 Mar 2017
1 answer
200 views

I am attempting to format the text, according to the attached example, and place keylines of different sizes.  Any help would be appreciated.

 

 

Dim document As New RadFlowDocument()
Dim editor As New RadFlowDocumentEditor(document)
 
'insert logo
editor.InsertBreak(BreakType.LineBreak)
Using fs As New FileStream(System.Web.HttpContext.Current.Server.MapPath("~/Assets/logo.png"), FileMode.Open, FileAccess.Read)
    editor.InsertImageInline(fs, "png")
End Using
editor.InsertBreak(BreakType.LineBreak)
editor.InsertBreak(BreakType.LineBreak)
editor.InsertBreak(BreakType.LineBreak)
 
 
editor.InsertLine("Application Name")
editor.InsertLine("Application ID")
editor.InsertLine("Status")
editor.InsertLine("Deadline Date")
Dinko | Tech Support Engineer
Telerik team
 answered on 28 Feb 2017
1 answer
268 views

Hello,

Is there a way to read/update document custom properties?

Say I have a document that has fields inserted into the text (with DOCPROPERTY) that are pointing to a custom document property. I would like to open the document, update the custom document properties and then do an update of all fields (I found I can trigger the update thru UpdateFields method or when Exporting by setting the appropriate flag).

I have not found any mention in the documentation about how I would be able to update an existing document custom property. Could someone point me in the right direction?

Thank you

Tanya
Telerik team
 answered on 24 Feb 2017
6 answers
146 views

Hello,

i have trouble reading small numbers from xlsx-files by using the spread processing components. in the attached file you can see an example. column A contains the values i want to read  which are computed from row 2 to row 8. the used formula can be seen in column B. column C contains the values that the spread processing is able to read using

 

workbook.Worksheets[0].Cells[4,0].GetValue().Value.GetResultValueAsString(CellValueFormat.GeneralFormat)

 

i'm able to read small numbers that aren't computed by using 

 

workbook.Worksheets[0].Cells[4,0].GetValue().Value.RawValue

 

what is the proper way to read the computed result values?

Dinko | Tech Support Engineer
Telerik team
 answered on 17 Feb 2017
1 answer
175 views

I'm having a problem reading values from a cell when a certain user is pasting into the spreadsheet and keeping the existing formatting.  When I target the cell and use the GetValue() method I get no result.  When I tore apart the spreadsheet I see that the expected value "Blah Blah Blah" is wrapped in a RichTextRun.  Is there another way that I can drill into the details of this cell to get this value?

<si>
        <r>
            <rPr>
                <sz val="8"/>
                <rFont val="Arial"/>
                <family val="34"/>
            </rPr><t>Blah Blah Blah</t>
        </r>
    </si>

Deyan
Telerik team
 answered on 14 Feb 2017
1 answer
390 views
I need to document generation insert special characters (CHECKBOX True / False), please could someone direct me to the correct procedure?

well thank you
Tanya
Telerik team
 answered on 10 Feb 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?