I am using a Bar Chart, which displays very big amount of data, almost more than 2 pages.
I am converting this Whole Web page to PDF using another tool.
Now the problem is i need to use the page break in chart at 45 th bar,does any body has idea how do i can include page break in a chart.
Thanks in advance
using (MemoryStream imageStream = new MemoryStream()){ this.UltraChart1.SaveTo(imageStream, RenderingType.Image); using (Image chartImage = Image.FromStream(imageStream)) { Bitmap topImage = new Bitmap(chartImage.Width, chartImage.Height / 2); Bitmap bottomImage = new Bitmap(chartImage.Width, chartImage.Height / 2); Graphics topGraphics = Graphics.FromImage(topImage); Graphics bottomGraphics = Graphics.FromImage(bottomImage); int halfHeight = chartImage.Height / 2; Rectangle destRect = new Rectangle(Point.Empty, topImage.Size); topGraphics.DrawImage(chartImage, destRect, 0, 0, chartImage.Width, halfHeight, GraphicsUnit.Pixel); bottomGraphics.DrawImage(chartImage, destRect, 0, halfHeight, chartImage.Width, halfHeight, GraphicsUnit.Pixel); topImage.Save(@"C:\top.png", ImageFormat.Png); bottomImage.Save(@"C:\bottom.png", ImageFormat.Png); topGraphics.Dispose(); bottomGraphics.Dispose(); topImage.Dispose(); bottomImage.Dispose(); }}
Hi David, Thanks for the response.
Can you give an example to split the image in ASP.Net code.
maybe you could save the chart as an image, then split that up into three images? this would probably not use the regular PDF rendering code, and you couldn't tell the chart where to break based on what bar you're on, you'd have to base the image splitting off pixel coordinates.
I need to break the Bar chart in between.
For example if the bar chart has 100 bars, then i need to break the chart at 40th bar and also at 80th bar.
how about this:
this.UltraChart1.Style["page-break-before"] = "always";