Telerik Forums
Telerik Document Processing Forum
1 answer
419 views
Excel has the scaling option "Fit All Columns on One Page". Is there an equivalent setting in the Telerik printing options? I haven't been able to find any examples in the documentation or forums. Thanks for any help you can offer.
Tanya
Telerik team
 answered on 06 Jun 2016
6 answers
184 views

Hi,

I have stripped our use down to be a very simple data-dump.

Row 1 = column headers
Rows 2 to N = data

I am using the auto filtering feature  

sheet.Filter.FilterRange = sheet.UsedCellRange;

once all the data has been written

File is being saved

IWorkbookFormatProvider XSLXwriter = new XlsxFormatProvider();

using (FileStream filestream = new FileStream(filename, FileMode.Create))
    XSLXwriter.Export(output, filestream);

Output is a Workbook and filename is a unique string.

I am simulating a user experience of wanting to us the sorting options provided within Excel however this causes a crash and the file to be recovered. Saving and re-opening fixes this problem. Comparing workbook.xml from the before(which crashes) and after(save as copy) it looks like this is missing.

<definedNames>
    <definedName name="_xlnm._FilterDatabase" localSheetId="0" hidden="1">Sheet1!$A$1:$GJ$531</definedName>
  </definedNames>
  <calcPr calcId="0"/>

If you could advise on solving this issue it would be great.

Many Thanks

Nikolay Demirev
Telerik team
 answered on 31 May 2016
1 answer
219 views

Is it possible to format some parts of the text inside a cell? Something like the formatting shown in the attached image.

Tanya
Telerik team
 answered on 13 May 2016
1 answer
413 views

I'm new to creating with PDFs and this control.  I'm trying to create a PDF that could be used to print an employee ID badge.  It looks like the whole card will need to be about 250 x 360 pixels, based on a template someone sent me that can be used to print now.

How does image quality work with this control?  Can images be added with a higher resolution than the pixels used when placing it in the PDF?

Deyan
Telerik team
 answered on 13 May 2016
1 answer
610 views

Hello,

I have a situation where a user can create some text using Kendo UI Editor that later gets inserted into a document. All goes well except if the HTML contains a list (bullet or numbered) where one or more of the list item has some kind of character formatting (bold, italic, font color,...). In the resulting document, the formatted text is placed in a new paragraph, inside the list.

The code I use to insert the HTML text into the document is:

var paragraph = section.Blocks.AddParagraph();
editor.MoveToParagraphStart(paragraph);
HtmlFormatProvider htmlProvider = new HtmlFormatProvider();
RadFlowDocument htmlDocument = htmlProvider.Import(htmlText);
 
var insertOptions = new InsertDocumentOptions
{
    ConflictingStylesResolutionMode = ConflictingStylesResolutionMode.UseTargetStyle
};
editor.InsertDocument(htmlDocument, insertOptions);

The HTML used is:

<p>Lorem ipsum dolor sit amet, <strong>consectetur</strong> adipiscing elit. Aenean viverra augue nec consectetur porta.</p>
<ul>
    <li>Sed aliquet <strong>nibh</strong> vitae ligula vestibulum.</li>
    <li>Iid ullamcorper dolor sollicitudin.</li>
</ul>
<p>Nunc volutpat dui dui, <em>eget laoreet est sollicitudin at</em>. Curabitur mi ipsum, feugiat nec tortor a, tristique elementum purus.</p>
<ol>
    <li>Duis <em>nec</em> dignissim nunc.</li>
    <li>Aenean dui arcu.</li>
    <li>Vulputate eget leo ac.</li>
</ol>
<p>Volutpat volutpat lorem. Vivamus luctus lorem et iaculis porttitor.</p>

The attached images show the text being edited and the result after being exported into a document.

 

Mihail
Telerik team
 answered on 25 Apr 2016
2 answers
380 views

Hi to all,

I'm tring to creare an utility that receive a RadGridView and show me a preview of it.

I created 2 static methods CreateOpenXMLDocument that creates a Workbook starting by RadGridView control.

Second one is PreviewList that save the workbook in PDF File, and then I use PDFViewer.

PDFViewer show me an error that I've attached here.

If a try to open the PDF file, my PDF reader inform me that it's corrupted.

Where I wrong?

01.private static Workbook CreateOpenXMLDocument(RadGridView gridView)
02.{
03.    gridView.ElementExportingToDocument += P_GridView_ElementExportingToDocument;
04.    var workbook = gridView.ExportToWorkbook();
05.    var worksheet = workbook.Worksheets[0];
06.    int columns = gridView.Columns.Count;
07. 
08.    ColumnSelection columnSelection = worksheet.Columns[0, columns - 1];
09.    columnSelection.AutoFitWidth();
10. 
11.    return workbook;
12.}
13.         
14.public static void PreviewList(RadGridView gridView)
15.{
16.    var workbook = CreateOpenXMLDocument(gridView);
17.    PdfFormatProvider provider = new PdfFormatProvider();
18. 
19.    string tempPath = System.IO.Path.GetTempPath();
20.    string tempGiud = Guid.NewGuid().ToString().Replace("{}-", "");
21. 
22.    string fileToPreview = string.Format(@"{0}{1}.pdf", tempPath, tempGiud);
23. 
24.    using (Stream output = System.IO.File.OpenWrite(fileToPreview))
25.    {
26.        var exportSettings = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.Pdf.Export.PdfExportSettings(Telerik.Windows.Documents.Spreadsheet.FormatProviders.ExportWhat.ActiveSheet, true);
27.        var pdfFileSettings = new Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Export.PdfExportSettings();
28. 
29.        pdfFileSettings.ComplianceLevel = Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Export.PdfComplianceLevel.None;
30.        pdfFileSettings.ImageQuality = Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Export.ImageQuality.High;
31. 
32.        exportSettings.PdfFileSettings = pdfFileSettings;
33.        provider.ExportSettings = exportSettings;
34. 
35.        provider.Export(workbook);
36.    }
37. 
38.    PDFPreviewDialog win = new PDFPreviewDialog();
39.    win.Tag = fileToPreview;
40.    win.Center2_3();
41.    win.ShowDialog();
42. 
43.    System.IO.File.Delete(fileToPreview);
44.}

Dario Concilio
Top achievements
Rank 2
 answered on 21 Apr 2016
7 answers
511 views

Dear Sir,

I tried to put a text with bullet in the RadEditor  of a web application and save into database (see attached WebInput.png).

when read the RTF from another windows application and put it into the RichtextBox control of the visual studio i get another character. (see attached WindowsApp.png).

When trying to read the rtf again from the web application i get it with intent negative (see attached Web.png).

Is there any suggestions? Why the RadEditor is not consistent?

 

example: 

RTF= {\rtf\ansi\ansicpg1252\uc1\deff0\deflang1033{\fonttbl{\f0 Times New Roman;}{\f1 Verdana;}{\f2 Symbol;}}{\colortbl\red0\green0\blue0 ;\red255\green0\blue0 ;}{\*\defchp\ltrch\fs22\i0\b0\strike0\ulnone}{\*\defpap\sl240\slmult1}{\stylesheet{\s0\sqformat\spriority0\ltrch\fs24\i0\b0\strike0\ulnone\sl240\slmult1 Normal;}{\*\ts1\tsrowd\spriority59\tscbandsh0\tscbandsv0\trgaph0\trpaddfl3\trpaddl108\trpaddfr3\trpaddr108\trpaddft3\trpaddt0\trpaddfb3\trpaddb0\tsvertalt\clpadft3\clpadt115\clpadfr3\clpadr115\clpadfl3\clpadl0\clpadfb3\clpadb0\ltrch\fs22\i0\b0\strike0\ulnone\sl240\slmult1 Table Normal;}{\s2\sbasedon0\spriority99\ltrch\fs24\i0\b0\strike0\ulnone\sl240\slmult1\sb100\sbauto1\sa100\saauto1 Normal (Web);}}{\*\listtable{\list\listtemplateid-1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0{\leveltext\'01\u-3913?;}{\levelnumbers;}\ltrch\f2\fs24\i0\b0\strike0\ulnone\levelfollow0\levelstartat1\sl240\slmult1\fi-360\li720\lin720}{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0{\leveltext\'02\'01.;}{\levelnumbers\'01;}\ltrch\fs24\i0\b0\strike0\ulnone\levelfollow0\levelstartat1\sl240\slmult1\fi-360\li1080\lin1080}{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\ltrch\fs24\i0\b0\strike0\ulnone\levelfollow0\levelstartat1\sl240\slmult1\fi-360\li1440\lin1440}{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\ltrch\fs24\i0\b0\strike0\ulnone\levelfollow0\levelstartat1\sl240\slmult1\fi-360\li1800\lin1800}{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\ltrch\fs24\i0\b0\strike0\ulnone\levelfollow0\levelstartat1\sl240\slmult1\fi-360\li2160\lin2160}{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0{\leveltext\'02\'05.;}{\levelnumbers\'01;}\ltrch\fs24\i0\b0\strike0\ulnone\levelfollow0\levelstartat1\sl240\slmult1\fi-360\li2520\lin2520}{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\ltrch\fs24\i0\b0\strike0\ulnone\levelfollow0\levelstartat1\sl240\slmult1\fi-360\li2880\lin2880}{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\ltrch\fs24\i0\b0\strike0\ulnone\levelfollow0\levelstartat1\sl240\slmult1\fi-360\li3240\lin3240}{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\ltrch\fs24\i0\b0\strike0\ulnone\levelfollow0\levelstartat1\sl240\slmult1\fi-360\li3600\lin3600}{\listname ;}\listid0}}{\*\listoverridetable{\listoverride\listid0\listoverridecount0\ls0}}\nouicompat\viewkind1\deftab720\sectd\pgwsxn12240\pghsxn15840\marglsxn1440\margrsxn1440\margtsxn1440\margbsxn1440\vertalt\headery720\footery720\pard\ltrpar\sl240\slmult1{\ltrch\fs24\i0\b0\strike0\cf1\ulnone This document was generated by a trial version of Telerik RadWordsProcessing.}{\ltrch\f1\fs20\i0\b0\strike0\ulnone\par}\pard\s2\ltrpar\ls0\ilvl0{\listtext \u-3913?}\fi-360\li720\lin720\sl240\slmult1\sb100\sbauto1\sa100\saauto1\ilvl0{\ltrch\fs24\i0\b0\strike0\ulnone Hello Telerik}{\ltrch\f1\fs20\i0\b0\strike0\ulnone\par}}

Petya
Telerik team
 answered on 18 Apr 2016
4 answers
1.1K+ views

I'm creating a document that consists of several tables with a simple title paragraph that is supposed to be "Heading2".

My code is something like this:

 

RadFlowDocumentEditor editor = new RadFlowDocumentEditor(document);
var paragraph = section.Blocks.AddParagraph();
paragraph.StyleId = BuiltInStyleNames.GetHeadingStyleIdByIndex(2);
editor.MoveToParagraphStart();
editor.InsertText("Title");
var table = section.Blocks.AddTable();
FillTable(editor, table);

 

 

 

The table is filled in much the same way: paragraphs are added to the cells, and text is added to these paragraphs.

This block is inside a for loop and is executed as many times as needed. Everything is as it should be except for the styles of the title paragraphs: the first one is ok, but all the other ones have the same style as the last cell of the previous table. If I open the resulting document using Word, I see that the style is indeed applied to the paragraphs but the character formatting is not what it should be.

I think I could go around by specifying all character formatting manually for each of the title paragraphs, but that is what the styles are for.

Am I doing anything wrong?

Tanya
Telerik team
 answered on 13 Apr 2016
3 answers
996 views
Is there any way to reprint the table's first row (header row) after each page break?  Currently we are using .InsertTable to handle tables that may span multiple pages.
Deyan
Telerik team
 answered on 23 Mar 2016
3 answers
854 views

It isn't clear whether or not this is supported by looking at the documentation or searching the forums.

 

 

Is it possible to export a PDF, with drawDom, that will have Chinese characters in it?

 

If so, how do you do it? Again, the documentation is spotty and at this point tells you different things at different locations as far as what font will be used by different parts of Kendo.

Daniel
Telerik team
 answered on 11 Mar 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?