This is a migrated thread and some comments may be shown as answers.

RadLinearSparkline inside of Cell for Pdf Document

1 Answer 28 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Andrey
Top achievements
Rank 1
Andrey asked on 17 Sep 2012, 12:35 PM
Hi all.

I'd like to render the RadLinearSparkline control inside of the Table Cell, and then export document to PDF.
here is the code:
private static void AddTrendCell(IBlockContainer cell, IEnumerable<double> value)
{
    var trendLine = new RadLinearSparkline();
    trendLine.ItemsSource = value;
    trendLine.LineStroke = new SolidColorBrush(Colors.Red);
    trendLine.Background = new SolidColorBrush(Colors.Green);
 
    var paragraph = new Paragraph();
    paragraph.Inlines.Add(new InlineUIContainer(trendLine, new Size(180, 30)));
    cell.Blocks.Add(paragraph);
}

but there is no any content inside of Cell in the PDF document.
please help.

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 18 Sep 2012, 12:22 PM
Hello Andrey,

Your code seems to be fine. However, you should explicitly set width and height of the control contained by the container:

trendLine.Width = 180;
trendLine.Height = 30;

If your problem persists, have in mind that if the item is not displayed properly in a RichTextBox when the document is previewed in one, it will also not be exported to PDF since the export consists of making a "screenshot" of the visible content.

Don't hesitate to contact us if you have other questions.

Kind regards,
Martin
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

Tags
RichTextBox
Asked by
Andrey
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or