Telerik Forums
Telerik Document Processing Forum
1 answer
52 views

I have data like this in CLOB field in the database. When a user downloads the data, it's converted to an Excel file using OpenXML.

Customer name¤Active¤customer id¤agreement name¤agreement id¤fund isin¤fund id¤rate active¤agreement active¤agreement vp key type¤agreement vp number¤rate type¤rate commision

I am converting the site so it can run in Kubernetes using the Blazor UI components. Today it's an old MVC site.

So how can I convert all the lines of code to an Excel sheet without using too much memory?

Each CLOB is around 32mb.

Yoan
Telerik team
 answered on 02 Nov 2023
1 answer
30 views

I'm trying to use the "ExportToHTML" object but it won't let me. I already implemented the two necessary libraries but it still won't let me use the object.

using Telerik.WinControls.Export;
using Telerik.WinControls.UI.Export;

 

Any solution? 

Dinko | Tech Support Engineer
Telerik team
 answered on 30 Oct 2023
2 answers
403 views

Greetings All,

Is there any way that the text that i am entrering into Block can be formated for Underline and Strikethrough .

 

I was able to achieve other properties like Bold , Italix with statements like 

block testblock =testCell.Blocks.AddBlock();

testblock. TextProperties.Font = FontsRepository.TimesItalic;

 

 

Luk
Top achievements
Rank 1
Iron
 updated answer on 06 Oct 2023
1 answer
53 views

Hi,

I get HTML in my code and I have the image byte in another file. I want to combine it to export my HTML to PDF with images. This is what I do, and it only works with a single image, on the second iteration I got an error in importSettings.LoadImageFromUri (Method = <Internal Error evaluating expression>). What can I do to add multiple images in the importSettings? I don't see an example in the documentation.


foreach (var img in imageList)
{               
  EventHandler<LoadImageFromUriEventArgs> loadImageFromUri = (s, e) =>
  {
    
    byte[] data = img.ContentBytes;
    e.SetImageInfo(data, "jpg");
  };

  importSettings.LoadImageFromUri += loadImageFromUri;                          
}

Thanks

Martin
Telerik team
 answered on 03 Oct 2023
1 answer
110 views

We store some texts in rtf-format in our database. Now I have to convert them to html.

This is an expample of the rtf-text:

{\rtf1\ansi\ansicpg1252\deff0\deflang2055{\fonttbl{\f0\fnil\fcharset0 Arial;}{\f1\fnil\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\fs20 Dampf- und Gassperre aus Fl\'fcssigkunststoff f\'fcr D\'e4mmung von K\'e4lteleitungen. Flexible, schwerentflammbare und dampfbremsende Beschichtung auf Wasserbasis. Auch geeignet zum Schutz von l\'f6sungsmittelempfindlichen Isolierstoffenbei K\'e4lte-Isolierungen im Innen- und Aussenbereich.\f1\fs17\par
}

To convert it to html I use the following code:

Telerik.Windows.Documents.Flow.FormatProviders.Rtf.RtfFormatProvider rtfProv = new();
      Telerik.Windows.Documents.Flow.Model.RadFlowDocument rtfDoc = rtfProv.Import(rtfInput);
      
      Telerik.Windows.Documents.Flow.FormatProviders.Html.HtmlExportSettings expSettings = new()
      {
        DocumentExportLevel = Telerik.Windows.Documents.Flow.FormatProviders.Html.DocumentExportLevel.Fragment,
        StylesExportMode = Telerik.Windows.Documents.Flow.FormatProviders.Html.StylesExportMode.None,
      };
      Telerik.Windows.Documents.Flow.FormatProviders.Html.HtmlFormatProvider htmlProv = new() 
      { 
        ExportSettings = expSettings 
      };
      string ret = htmlProv.Export(rtfDoc);
      return new HtmlString(ret);
This code works . The output looks like this:
<body><p style="margin-bottom: 0px;"><span style="font-size: 13.333333333333334px;">Dampf- und Gassperre aus Fl&uuml;ssigkunststoff f&uuml;r D&auml;mmung von K&auml;lteleitungen. Flexible, schwerentflammbare und dampfbremsende Beschichtung auf Wasserbasis. Auch geeignet zum Schutz von l&ouml;sungsmittelempfindlichen Isolierstoffenbei K&auml;lte-Isolierungen im Innen- und Aussenbereich.</span></p></body>
How can I remove or replace the style-attribute with the font-size in the span?
Anna
Telerik team
 answered on 29 Sep 2023
1 answer
60 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
140 views

Hi all,

This is a fragment from my code where I use tables in a RadFlowDocument to list some values. This all works fine for me, except one thing: between the text in a cell en the bottom border of that cell is some white space I can't get rid of. I want the bottom border of the cell to have the same distance to the text in the cell as between the text and the top border (border color set to blue for debugging..)

Tried playing with the row Height, cell padding, etc., but that doesn't change anything.

What am I missing?

  

var doc = new RadFlowDocument(); var tableStyle = new Style("TableStyle", StyleType.Table); tableStyle.TableProperties.Borders.LocalValue = new TableBorders(new Border(1, BorderStyle.Single, new ThemableColor(Colors.Blue))); tableStyle.TableProperties.Alignment.LocalValue = Alignment.Left; tableStyle.TableCellProperties.VerticalAlignment.LocalValue = VerticalAlignment.Top; tableStyle.TableCellProperties.Padding.LocalValue = new Padding(0, 0, 0, 0); tableStyle.TableRowProperties.TableCellSpacing.LocalValue = 0; tableStyle.CharacterProperties.FontSize.LocalValue = 12; doc.StyleRepository.Add(tableStyle); var section = new Section(doc) { PageMargins = new Padding(50, 50, 50, 50), PageNumberingSettings = { StartingPageNumber = 1, } }; doc.Sections.Add(section); var paragraph = new Paragraph(doc); section.Blocks.Add(paragraph); Table table = new Table(doc, 0, 2)// 0 rows, 2 columns. { LayoutType = TableLayoutType.FixedWidth, PreferredWidth = new TableWidthUnit(700), StyleId = "TableStyle" };
// add 2 rows with 2 cells TableRow row = table.Rows.AddTableRow(); TableCell cell = row.Cells.AddTableCell(); cell.PreferredWidth = new TableWidthUnit(100); paragraph = cell.Blocks.AddParagraph(); paragraph.Inlines.AddRun($"Cell R1C1"); cell = row.Cells.AddTableCell(); cell.PreferredWidth = new TableWidthUnit(600); paragraph = cell.Blocks.AddParagraph(); paragraph.Inlines.AddRun("Cell R1C2"); cell = row.Cells.AddTableCell(); cell.PreferredWidth = new TableWidthUnit(100); paragraph = cell.Blocks.AddParagraph(); paragraph.Inlines.AddRun($"Cell R2C1"); cell = row.Cells.AddTableCell(); cell.PreferredWidth = new TableWidthUnit(600); paragraph = cell.Blocks.AddParagraph(); paragraph.Inlines.AddRun("Cell R2C2");


Kind regards,

Kees Alderliesten

Vladislav
Telerik team
 answered on 13 Sep 2023
0 answers
132 views
0 answers
232 views
     public void UnzipTSWFiles(string sourceDirectory, string destinationDirectory, string password)
        {
            DefaultEncryptionSettings protectionSettings = new DefaultEncryptionSettings() { Password = password };

                 using (ZipArchive zipArchive = new ZipArchive(output, ZipArchiveMode.Read, true, null, null, protectionSettings))
                        {
                            foreach (ZipArchiveEntry entry in zipArchive.Entries)
                            {
                                using (Stream entryStream = entry.Open())
                                using (FileStream fileStream = File.OpenWrite(string.Format("{0}/{1}", targetDirectory, entry.FullName)))
                                {
                                    entryStream.CopyTo(fileStream);
                                }
                            }
                        }
                    
         

        }
purushotham
Top achievements
Rank 1
 asked on 09 Aug 2023
1 answer
134 views

I've searched and searched and I cannot find any information around using Telerik.Documents.Fixed with PDF's that have XFA forms.   Is this possible?   And if so is there any sample code showing how to do it?

Thanks.

 

Yoan
Telerik team
 answered on 21 Jul 2023
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?