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

[Solved] Printing Page Breaks in IE9

2 Answers 34 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rick Glos
Top achievements
Rank 1
Rick Glos asked on 10 Apr 2012, 09:00 PM
I have an issue where the chart gets a page break in the middle of it in IE9, whereas this does not occur in Chrome or Firefox.  Is there anything I can do about that?

For example, throw this chart on a page and repeat it 6 times then try printing in IE9, note that if a chart doesn't fit on the page, it gets cut in half with part of it on one page and part if it on another.

<div style=" width: 640px; height: 480px;">
@(Html.Telerik().Chart()
        .Name("chart")
        .Title("Test 1")
        .Series(series => {
            series.Bar(new int[] { 2015, 6003, 6881 }).Name("Representative Sales");
            series.Bar(new int[] { 15458, 26598, 27623 }).Name("Total Sales");
        })
            .CategoryAxis(axis => axis.Categories(new string[] { "Aug 2010", "Sept 2010", "Oct 2010" }))
        )
</div>

2 Answers, 1 is accepted

Sort by
0
Accepted
Iliana Dyankova
Telerik team
answered on 12 Apr 2012, 02:09 PM
Hello Rick,

In order to avoid such behavior when you print ASP.NET MVC Chart in IE 9, you could set to the chart the CSS page-break-inside property to avoid. For example:
<style>
  #chart
  {
   page-break-inside: avoid
  }
</style>

More detailed information about this property could be find here.

 

All the best,
Iliana Nikolova
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
0
Rick Glos
Top achievements
Rank 1
answered on 12 Apr 2012, 03:31 PM
Thank you.  I found that documentation just yesterday and implemented the same property.  In addition to make it work on the clients network I had to add the meta tag for document compatibility.

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

Read more on that at Defining Document Compatibility.
Tags
Chart
Asked by
Rick Glos
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Rick Glos
Top achievements
Rank 1
Share this question
or