Hi,
I wanted to ask if it is possible to rotate the text of a cell. See the screenshot for an example.
Best regards,
Philipp

Hi,
Is it possible to configure the printing as for the library RadSpreadProcessing ?
Thank you
'Print configurationDim pageSetup As Printing.WorksheetPageSetup = excSheet.WorksheetPageSetuppageSetup.PaperType = Telerik.Windows.Documents.Model.PaperTypes.A4pageSetup.PageOrientation = Telerik.Windows.Documents.Model.PageOrientation.LandscapeDim HeadFootSettings As Printing.HeaderFooterSettings = pageSetup.HeaderFooterSettingsHeadFootSettings.Header.CenterSection.Text = excSheet.NameHeadFootSettings.Footer.CenterSection.Text = DateTime.Now.ToString
Hello,
i have an issue with WordsProcessing. After i have replaced text, borders from tables disappear.
Public Function SetVorblatt() As String Dim cmsObj As New CsCms Dim dateiName As String = Titel.Replace(":", "").Replace("/", "").Replace("\", "").Replace("""", "") Dim containsAlleMa As Boolean = False Dim flowDocument As Telerik.Windows.Documents.Flow.Model.RadFlowDocument Dim docxProvider As New Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider Dim floDocEditor As Telerik.Windows.Documents.Flow.Model.Editing.RadFlowDocumentEditor Dim formulardaten As List(Of FormularData) = GetFormData() 'Änderung vom 12.12.2016 'Umstellung vom RTF auf DOCX 'Änderung vom 02.09.2015 'Prüfung, ob bei den Adressatenkreis "alle Mitarbeiter" ausgewählt wurde. Falls nicht, soll die Checkbos "wie folgend" befüllt werden Try If IsNothing(formulardaten) = False Then Using input As New FileStream(AppSettings("serverMappath") & "\anwendungen\zav\formulare\RL-Vorlage_.docx", FileMode.Open) flowDocument = docxProvider.Import(input) End Using floDocEditor = New Telerik.Windows.Documents.Flow.Model.Editing.RadFlowDocumentEditor(flowDocument) For Each formData As FormularData In formulardaten floDocEditor.ReplaceText(formData.Text, formData.Value & " ") Logger.Trace(formData.Text & " :" & formData.Value) Next Using output As New FileStream(AppSettings("serverMappath") & "\anwendungen\sfo\vorblatt\" & dateiName & ".docx", FileMode.Create) docxProvider.Export(flowDocument, output) End Using dateiName = AppSettings("serverMappath") & "\anwendungen\sfo\vorblatt\" & dateiName & ".docx" End If Catch ex As Exception Dim var As String = "Vorblatt wurde nicht erzeugt. dateiName:" & dateiName Logger.Error(var, ex) End Try Return dateiName End Function
You can see it at the attachements. Have anyone an idea what i have made wrong?
Best regards
Jens
public static byte[] SerializeAndCompress(T obj){ var filename = DateTime.Now.ToString("ddMMYYYYhhmmss") + ".xml"; var appStore = IsolatedStorageFile.GetUserStoreForApplication(); if (appStore.Quota < TamanhoStorage) appStore.IncreaseQuotaTo(TamanhoStorage); byte[] bobj; using (var fileStream = appStore.OpenFile(filename, FileMode.Create)) { var serializer = new DataContractSerializer(typeof(T)); serializer.WriteObject(fileStream, obj); fileStream.Position = 0; bobj = new byte[fileStream.Length]; fileStream.Read(bobj, 0, (int)fileStream.Length); } using (var fileStream = appStore.OpenFile(filename, FileMode.Create)) { using (var zip = new ZipOutputStream(fileStream)) { zip.Write(bobj, 0, bobj.Length); } } byte[] cobj = null; using (var fileStream = appStore.OpenFile(filename, FileMode.Open)) { cobj = new byte[fileStream.Length]; fileStream.Read(cobj, 0, cobj.Length); } appStore.DeleteFile(filename); return cobj;}using (var fileStream = appStore.OpenFile(filename, FileMode.Open)) { using (var zip = new ZipInputStream(fileStream)) { using (var sr = new StreamReader(zip)) { var str = sr.ReadToEnd(); } } }var bobj = new byte[5000000];using (var fileStream = appStore.OpenFile(filename, FileMode.Open)){ using (var zip = new ZipInputStream(fileStream)) { zip.Read(bobj, 0, (int)fileStream.Length); }}Hi,
I have Performance Issues with the Excel spreadprocessing export. I just migrated an Excel export that used until now the libraries "Component One". The export takes now 30 seconds for 7221 rows and 88 columns, against 5 seconds before. Here is the code:
001. ... Fill the table...002. Using excBook As New Workbook003. 004. excBook.SuspendLayoutUpdate()005. Using (New UpdateScope(006. Function() (excBook.History.IsEnabled = False),007. Function() (excBook.History.IsEnabled = True)))008. 009. Dim excSheet As Worksheet 010. excSheet = excBook.Worksheets.Add()011. excSheet.Name = tbl.TableName012. fill_ExcelSheet(tbl, excSheet)013. 014. End Using015. excBook.ResumeLayoutUpdate()016. 017. 'Save the Excel-File018. Dim formatProvider As Telerik.Windows.Documents.Spreadsheet.FormatProviders.IWorkbookFormatProvider _019. = New Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider()020. 021. Using fsOutput As New FileStream(strFilename, FileMode.Create)022. formatProvider.Export(excBook, fsOutput)023. End Using024. 025. End Using026. 027.Private Shared Function fill_ExcelSheet(ByVal tblDaten As DataTable, ByVal excSheet As Worksheet) As Boolean028. Dim bolOK As Boolean = False029. Dim intCntCols As Integer, intCntRows As Integer030. Dim strColCaption As String031. 032. Try033. 034. 'Set Columns-Description035. For intCntCols = 0 To tblDaten.Columns.Count - 1036. strColCaption = get_AttributCaption(tblDaten.Prefix, tblDaten.Columns(intCntCols).ColumnName)037. excSheet.Cells.Item(0, intCntCols).SetValue(strColCaption)038. Next039. 040. 'Fill the Sheet with data041. excSheet.Cells.Item(1, 0, tblDaten.Rows.Count, tblDaten.Columns.Count).SetFormat(New CellValueFormat("@"))042. For intCntRows = 0 To tblDaten.Rows.Count - 1043. For intCntCols = 0 To tblDaten.Columns.Count - 1044. Dim colName As String = tblDaten.Columns(intCntCols).ColumnName045. If (tblDaten.Columns(colName).DataType Is GetType(Date)) Then046. If Not tblDaten.Rows(intCntRows).IsNull(colName) Then047. If CType(tblDaten.Rows(intCntRows).Item(colName), Date).TimeOfDay.Ticks > 0 Then048. excSheet.Cells.Item(intCntRows + 1, intCntCols).SetValue(CType(tblDaten.Rows(intCntRows).Item(colName), Date).ToString)049. Else050. excSheet.Cells.Item(intCntRows + 1, intCntCols).SetValue(CType(tblDaten.Rows(intCntRows).Item(colName), Date).ToShortDateString)051. End If052. End If053. ElseIf (tblDaten.Columns(colName).DataType Is GetType(System.Guid)) Then054. excSheet.Cells.Item(intCntRows + 1, intCntCols).SetValue(tblDaten.Rows(intCntRows).Item(colName).ToString)055. ElseIf (tblDaten.Columns(colName).DataType Is GetType(String)) Then056. 057. excSheet.Cells.Item(intCntRows + 1, intCntCols).SetValue(tblDaten.Rows(intCntRows).Item(colName).ToString)058. ElseIf (tblDaten.Columns(colName).DataType Is GetType(Integer)) _059. Or (tblDaten.Columns(colName).DataType Is GetType(Int16)) _060. Or (tblDaten.Columns(colName).DataType Is GetType(Single)) _061. Or (tblDaten.Columns(colName).DataType Is GetType(Decimal)) _062. Or (tblDaten.Columns(colName).DataType Is GetType(Double)) Then063. If Not tblDaten.Rows(intCntRows).IsNull(colName) Then064. excSheet.Cells.Item(intCntRows + 1, intCntCols).SetValue(CDbl(tblDaten.Rows(intCntRows).Item(colName)))065. End If066. ElseIf (tblDaten.Columns(colName).DataType Is GetType(Boolean)) Then067. If Not tblDaten.Rows(intCntRows).IsNull(colName) Then068. excSheet.Cells.Item(intCntRows + 1, intCntCols).SetValue(CBool(tblDaten.Rows(intCntRows).Item(colName)))069. End If070. Else071. If Not tblDaten.Rows(intCntRows).IsNull(colName) Then072. excSheet.Cells.Item(intCntRows + 1, intCntCols).SetValue(tblDaten.Rows(intCntRows).Item(colName))073. End If074. End If075. Next076. Application.DoEvents()077. Next078. 079. 'Print properties080. Dim pageSetup As Printing.WorksheetPageSetup = excSheet.WorksheetPageSetup081. pageSetup.PaperType = Telerik.Windows.Documents.Model.PaperTypes.A4082. pageSetup.PageOrientation = Telerik.Windows.Documents.Model.PageOrientation.Landscape083. Dim HeadFootSettings As Printing.HeaderFooterSettings = pageSetup.HeaderFooterSettings084. HeadFootSettings.Header.CenterSection.Text = excSheet.Name085. HeadFootSettings.Footer.CenterSection.Text = DateTime.Now.ToString086. 087. If excSheet.Workbook.Styles("NormalStyle") Is Nothing Then088. Dim normalStyleCells As Telerik.Windows.Documents.Spreadsheet.PropertySystem.CellStyle = excSheet.Workbook.Styles.Add("NormalStyle")089. Dim borderDotCell As New CellBorder(CellBorderStyle.Hair, New ThemableColor(ThemeColorType.Text1))090. Dim borderThinCell As New CellBorder(CellBorderStyle.Thin, New ThemableColor(ThemeColorType.Text1))091. Dim fill As IFill = PatternFill.CreateSolidFill(New ThemableColor(Windows.Media.Colors.White))092. normalStyleCells.BeginUpdate()093. normalStyleCells.TopBorder = borderDotCell094. normalStyleCells.BottomBorder = borderDotCell095. normalStyleCells.LeftBorder = borderThinCell096. normalStyleCells.RightBorder = borderThinCell097. normalStyleCells.FontFamily = New ThemableFontFamily("Arial")098. normalStyleCells.FontSize = UnitHelper.PointToDip(8)099. normalStyleCells.Fill = fill100. normalStyleCells.EndUpdate()101. 102. Dim headerStyleCells As Telerik.Windows.Documents.Spreadsheet.PropertySystem.CellStyle = excSheet.Workbook.Styles.Add("HeaderStyle")103. fill = PatternFill.CreateSolidFill(New ThemableColor(Windows.Media.Color.FromRgb(192, 192, 192)))104. headerStyleCells.CopyPropertiesFrom(normalStyleCells)105. headerStyleCells.BeginUpdate()106. headerStyleCells.IsWrapped = False107. headerStyleCells.TopBorder = borderThinCell108. headerStyleCells.BottomBorder = borderThinCell109. headerStyleCells.Fill = fill110. headerStyleCells.EndUpdate()111. 112. Dim footStyleCells As Telerik.Windows.Documents.Spreadsheet.PropertySystem.CellStyle = excSheet.Workbook.Styles.Add("FooterStyle")113. footStyleCells.CopyPropertiesFrom(normalStyleCells)114. footStyleCells.BottomBorder = borderThinCell115. 116. Dim leftAlignStyleCells As Telerik.Windows.Documents.Spreadsheet.PropertySystem.CellStyle = excSheet.Workbook.Styles.Add("LeftAlignStyle")117. leftAlignStyleCells.HorizontalAlignment = RadHorizontalAlignment.Left118. Dim rightAlignStyleCells As Telerik.Windows.Documents.Spreadsheet.PropertySystem.CellStyle = excSheet.Workbook.Styles.Add("RightAlignStyle")119. rightAlignStyleCells.HorizontalAlignment = RadHorizontalAlignment.Right120. End If121. 122. excSheet.Columns(0, tblDaten.Columns.Count - 1).AutoFitWidth()123. Dim rowHeight As New RowHeight(UnitHelper.PointToDip(11.5), True)124. excSheet.Rows(0, tblDaten.Rows.Count).SetHeight(rowHeight)125. 126. 'Format cells127. For col As Integer = 0 To tblDaten.Columns.Count - 1128. 'Links- oder Rechtsbündig setzen129. Dim strAHorz As String = "LeftAlignStyle"130. Dim typCol As Type = tblDaten.Columns(col).DataType131. If (typCol Is GetType(Integer)) Or (typCol Is GetType(Single)) Or (typCol Is GetType(Decimal)) Or (typCol Is GetType(Double)) Then132. strAHorz = "RightAlignStyle"133. End If134. 135. excSheet.Cells(0, col).SetStyleName("HeaderStyle")136. excSheet.Cells(1, col, tblDaten.Rows.Count - 1, col).SetStyleName("NormalStyle")137. excSheet.Cells(tblDaten.Rows.Count, col).SetStyleName("FooterStyle")138. 139. excSheet.Cells(0, col, tblDaten.Rows.Count, col).SetStyleName(strAHorz)140. Next141. bolOK = True142. Catch ex As Exception143. show_AppErrorMsgBox(ex)144. End Try145. Return bolOK146.End Function
The code that takes the most time is:
- Lines 42 - 77: Fill the sheet with data: 12 seconds
- Line 122: AutoFitWidth(): 6 seconds --> (It's important, cannot be removed)
- Line 22: formatProvider.Export(excBook, fsOutput): 11 seconds --> That's very long !!!
Can you check my code and tell me if there are any improvements, please? So i can unfortunately not use the libraries.
Thanks in advance

Given a set of strings, how should I compute a pattern from it? For example, (see picture), would provide me "Cadastro de Pessoas Físicas de Inscrição Nome Nasc". Of course, I could do it manually by analyzing the strings, but I need an automatic procedure for it because they would be more complex. Any ideas? I realize that this issue has do more with algorythms that Telerik products themselves.

Hallo,
when i read the result of a cell with a formular how has a function (like SUM()) or a referenz (sheetname!Range) linked to a worksheet (itself or another) in the workbook the result (.GetResultValueAsString ) ist "0" or a text (the formular itself) and not the result. Simple formulars related to cells in the worksheet are ok.
Example:
The cell formular looks like this:
1. =SUMME(L23:L30) ==> GetResultValueAsString result = "0"
2. {=WENNFEHLER(INDEX(Bestellliste!E:E;KKLEINSTE(WENN(Bestellliste!$A$1:$A$1131="x";ZEILE($1:$991));ZEILE(A3)));"")} ==> GetResultValueAsString result = "=WENNFEHLER(INDEX(Bestellliste!E:E;KKLEINSTE(WENN(Bestellliste!$A$1:$A$1131="x";ZEILE($1:$991));ZEILE(A3)));"")"
VB code:
Dim iCellValue As ICellValue
iCellValue = TryCast(workbook.ActiveWorksheet.Cells(row, col).GetValue().Value, ICellValue)
If iCellValue IsNot Nothing Then
Dim format As CellValueFormat = workbook.ActiveWorksheet.Cells(row, col).GetFormat().Value
Dim valueAsString As String = iCellValue.GetValueAsString(format)
'valueAsString
Dim resultValueAsString As String = iCellValue.GetResultValueAsString(format)
'resultAsString
Dim valueType As CellValueType = iCellValue.ValueType
'valueType = Formula ' ==> allways Text{4} with komplex formular
'resultValueType = Number
Dim resultValueType As CellValueType = iCellValue.ResultValueType
End If
DLL Version: 2015.2.728.40
What's wrong? Are their any restriction to resolve formulars?
Regards
Harald

I'm trying to zip a PDF file, it creates zip file correctly, but if I try to open compressed PDF file, it show me error message "Corrupted file" (I'm trying to open by my PDF reader), where I wrong?
using (Stream stream = File.Open(fileFullName, FileMode.Create)) { using (ZipArchive archive = new ZipArchive(stream, ZipArchiveMode.Create, false, null)) { using (ZipArchiveEntry entry = archive.CreateEntry(fi.Name)) { var writer = new StreamWriter(entry.Open()); using (Stream streamFileToZip = File.Open(fi.FullName, FileMode.Open)) { var buffer = new byte[4096]; int sourceBytes = 0; do { sourceBytes = streamFileToZip.Read(buffer, 0, buffer.Length); writer.Write(buffer); } while (sourceBytes > 0); } writer.Flush(); } } }Hi !
I searching another way to generate my PDF document by WordsProcessing.
Compositing it and convert to PDF
After install by Configure project (CfgProject.png) the Document.Flow (RadWordsProcessing) when i want convert it like this sample :
the namespace "Telerik.Windows.Documents.Flow.FormatProviders.Pdf" is not found
The dll wasn't copied by Configure project ?! (FormatProvidersPdf.png)
it's a bug ? why ?
Thanks.

Hello,
Iam creating a pdf document wherein iam trying to set the size of the RadFixedPage object but the size property is showing as
page.Size=new System.Windows.Size()
instead of page.Size = new Size();
What am i missing ? Any reference?
I have already included the below references on my aspx page
using System.Windows;
using Telerik.Windows.Documents.Fixed.FormatProviders.Pdf;
using Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Export;
using Telerik.Windows.Documents.Fixed.Model;
using Telerik.Windows.Documents.Fixed.Model.ColorSpaces;
using Telerik.Windows.Documents.Fixed.Model.Editing;
using Telerik.Windows.Documents.Fixed.Model.Editing.Flow;
using Telerik.Windows.Documents.Fixed.Model.Fonts;
using Telerik.Windows.Documents.Fixed.Model.Graphics;
Thanks in Advance
Sushanth.B
