Telerik Forums
Telerik Document Processing Forum
1 answer
228 views

Hi,

is it possible to specify a row in worksheet, which will be printed on each page as header? In Excel Page setup this is called "Rows to repeat at top".

 

Thanks

Alex

 

Tanya
Telerik team
 answered on 14 Feb 2018
1 answer
626 views

I'm using a template to generate a document with a table in it. I'm adding the table, from scratch, to the document dynamically. This all exists in an ASP.Net MVC application. The table is being built ok. The only thing is I can't get it to take on the inbuilt Word table style I want. It doesn't matter what style i stry, it's not working.

See code example.

01.private static void BuildScheduleItemsTable(RadFlowDocument document,
02.            RadFlowDocumentEditor editor,
03.            ScheduleOfWork scheduleOfWork,
04.            ScheduleStage scheduleStage = ScheduleStage.Preliminary,
05.            ScheduleRecipient scheduleRecipient = ScheduleRecipient.Customer)
06.        {
07.            List<ScheduleOfWorkItem> scheduleOfWorkItems =
08.                GetScheduleOfWorkItemsFor(scheduleOfWork.ScheduleOfWorkID, scheduleStage);
09.             
10.             
11.            Table table = editor.InsertTable(scheduleOfWorkItems.Count + 1, 5);
12.            table.StyleId = "MediumGrid3-Accent4";
13.            table.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Auto);
14.            table.LayoutType = TableLayoutType.AutoFit;
15. 
16.            // create header row
17.            TableRow headerRow = table.Rows[0];
18.            headerRow.RepeatOnEveryPage = true;           
19.            //headerRow.CanSplit = false;
20.            //headerRow.RepeatOnEveryPage = true; // header row repeats when new page
21.            headerRow.AddHeaderCellAndText("Description", 0);
22.            headerRow.AddHeaderCellAndText("Quantity", 1);
23.            headerRow.AddHeaderCellAndText("Cost", 2);
24.            headerRow.AddHeaderCellAndText("VAT Amount", 3);
25.            headerRow.AddHeaderCellAndText("Total Cost Inc VAT", 4);
26. 
27.            int rowIter = 1;
28.            foreach (ScheduleOfWorkItem scheduleOfWorkItem in scheduleOfWorkItems)
29.            {
30.                TableRow itemRow = table.Rows[rowIter];
31.                //itemRow.CanSplit = false;
32.                itemRow.UpdateDescriptionCell(scheduleOfWorkItem, scheduleRecipient);
33.                itemRow.UpdateQuantityCell(scheduleOfWorkItem);
34.                itemRow.UpdateCostCell(scheduleOfWorkItem);
35.                itemRow.UpdateVatAmountCell(scheduleOfWorkItem);
36.                itemRow.UpdateTotalCostIncVatCell(scheduleOfWorkItem);
37.                rowIter++;
38.            }
39.        }

 

The Update...Cell and AddHeaderCellAndText methods are just methods that create paragraphs and runs inside the cells that were created when the table was created. No matter what I set in table.StyleId it doesn't seem to take effect

Tanya
Telerik team
 answered on 14 Feb 2018
0 answers
134 views
Is there a way to insert row with specified index? e.g. I have table with 10 rows and I want to insert new row between row 5 and 6, is it possible?
RJ
Top achievements
Rank 1
 asked on 05 Feb 2018
1 answer
162 views

Is there a way to reference table from existing docx template? My template is already formatted and I just need to populate items from that table.

fileFormatProvider = New DocxFormatProvider()
Dim fileName As String = "D:\myTemplate.docx"
fileExtension = ".docx"
Using input As New FileStream(fileName, FileMode.Open)
     document = fileFormatProvider.Import(input)
End Using

Dim editor As New RadFlowDocumentEditor(document)

dim myTemplateTable as Table = editor.findTable?? (Cant find any sample or documentation to reference the table)

'Now I need to insert row after 4th row (Note that I have existing rows on 5th which is the subtotal, 6th credits, 7th expenses, 8th Grand Total)

'This new row/rows are dynamic and based on how many items

Dim myNewRow5 as TableRow = myTemplateTable.Rows(3).AddTableRow/InsertTableRow?? (cant find any sample either)

'Once I got the reference of the row I can now populate cells with my data...

 

Hoping for any information for this scenario.

Thanks in advance,

RJ

RJ
Top achievements
Rank 1
 answered on 05 Feb 2018
2 answers
326 views

Greetings.

Imported the following HTML into the DPL.

    <style type="text/css">
        p {
            font-family: Calibri;
            font-size: 14.6666666666667px;
            margin-top: 0px;
            margin-bottom: 0px;
            line-height: 115%;
        }
 
        .TelerikNormal {
            font-family: Calibri;
            font-size: 14.6666666666667px;
            margin-top: 0px;
            margin-bottom: 0px;
        }
 
        .TelerikHeading1 {
            font-family: Cambria;
            font-size: 28px;
            font-weight: bold;
            color: #4F81BD;
            margin-top: 18.6666666666667px;
            margin-bottom: 18.6666666666667px;
        }
 
        .TelerikHeading2 {
            font-family: Cambria;
            font-size: 20px;
            font-weight: bold;
            color: #4F81BD;
            margin-top: 18.6666666666667px;
            margin-bottom: 5px;
        }
 
    </style>
<h1 class="TelerikHeading1">
    <span>Study Results</span>
</h1>
<h2 class="TelerikHeading2">Issue 1</h2>
<p>This is the issue</p>

Then we export using the following settings in order to include the HTML in an email:

HtmlExportSettings exportSettings = new HtmlExportSettings()
{
    DocumentExportLevel = DocumentExportLevel.Fragment,
    ImagesExportMode = ImagesExportMode.External,
    ImagesFolderPath = @"C:\Temp\TestImages",
    ImagesSourceBasePath = "cid:",
    StylesExportMode = StylesExportMode.Inline
};
htmlFormatProvider.ExportSettings = exportSettings;
string body = htmlFormatProvider.Export(outputDocument);

The resulting HTML replaces the <h1> and <h2> tags as expected, but it looks like only the color from the assigned classes is being used. The rest of the styles appear to come from the <p> style.

Is there a workaround for this?

Tanya
Telerik team
 answered on 05 Feb 2018
3 answers
854 views
Can we convert workbook to a stream and return the stream?
Petya
Telerik team
 answered on 01 Feb 2018
3 answers
1.3K+ views

I haven't seen anything in the sparse documentation, nor in a forum thread, on the topic of inserting text into a particular table cell.

What I want to know is how to do something that should be very straightforward: get a particular table cell reference and insert formatted text into it.

For example, with this, I create a RadFlowDocument, attach an editor to it, insert a table, then a row, then a cell into the row:

RadFlowDocument document = new RadFlowDocument();
RadFlowDocumentEditor editor = new RadFlowDocumentEditor(document);
var table = editor.InsertTable();
var firstRow = table.Rows.AddTableRow();
var firstCell = firstRow.Cells.AddTableCell();

How do I insert text now?

And actually, more importantly, how would I take a *randomly selected* TableCell from an already constructed document and insert text (and images) into that?

RJ
Top achievements
Rank 1
 answered on 01 Feb 2018
10 answers
738 views

Hi,

My apologies in advance if this cannot be done using Telerik Document Processing and I'm wasting everyone's time. I'll try and explain my situation the best I can.

We have large number of word documents related to a process which need to be converted to online forms. That's the easy part. The business wants the reporting of these forms exactly in the same format as in the original word documents. So we are hoping to use the word documents as templates (not necessarily .DOTX). 

Since the format of word documents often change The idea is to

  • Have one base document of each format kept on the server.
  • This base doc will have place-holders for the data to be filled in by asp.net (C#) for e.g. Employee Name: <<NAME>>.
  • When a report is to be generated, the relevant data is pulled from the SQL database and filled in the placeholders of the document. So in the above example <<NAME>> will be replaced by real name of the employee from database.
  • There will be some Base64 Images which will come from database and to be placed in the document e.g. signatures, profile pictures.
  • Once the document is completely filled, it is converted to PDF and downloaded to user's browser.
  • Whenever the format of a word document changes, it is replaced on the server and the asp.net fills this new format.  

Since we are in design phase of this I'm open to adapt to any suggestions. Any pointers/demo/advice on approach is welcome.

 

Thanks in Advance.

Ruben
Top achievements
Rank 1
 answered on 30 Jan 2018
14 answers
451 views
Hi,
exported pdf from Telerik.Windows.Documents.Model.RadDocument  with Telerik.Windows.Documents.FormatProviders.Pdf.PdfFormatProvider. Export(RadDocument document, Stream output) seem not be compliant with the PDF/A standard. Those exported pdfs are being konverted to PDF/A when opened with Adobe Reader X or XI which leads to a unwanted save dialog when those pdfs are closed again. When searching the forums for help I found e.g this thread (http://www.telerik.com/forums/pdf-a-iso-standard#beAEQxU83ESRLCawuwGPhQ) which confused me a bit because Steve assumes the export functionality fits the needs of PDF/A while Chavdar points out that PDF/A is currently not supported and that it is not clear when it will. I wanted to attach a example pdf so that you maybe could tell when investigating the file if something is wrong in the RadDocument from which the pdf is produced but uploading pdf is not supported. Can you help by any chance?

Thanks in advance  Jo
Polya
Telerik team
 answered on 29 Jan 2018
4 answers
134 views

Hello friends - I am using the trial of Telerik and am interested to see if it will meet my need of converting 5 radgrids stacked on top of each other into ONE pdf.

My page set-up is like this

Grid1

Grid2

Grid3

Grid4

 

And I want my pdf to be generated just like this - no added buffering or whitespace.  How can this be done'?

Marin Bratanov
Telerik team
 answered on 24 Jan 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?