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

RadLinearSparkline inside of Cell for Pdf Document

1 Answer 16 Views
This is a migrated thread and some comments may be shown as answers.
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)));

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

1 Answer, 1 is accepted

Sort by
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,
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.

Asked by
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question