Hi,
I create a scatter chart and modify the x axis label to Century Gothic Size 8, Angle 330. The chart looks fine (check chart before pdf.bmp on the zip attached). However, when i use the code below, the pdf shows that the x axis is cut (check chart after pdf.pdf in the zip file attached). Can you tell me what is wrong? Thanks. Bobby Pohan.
Private
Export2PDF()
Try
Infragistics.Documents.Report.Report()
Infragistics.Documents.Report.Section.ISection = report.AddSection
'centering the chart on pdf doc
section1.PageOrientation = Infragistics.Documents.Report.PageOrientation.Landscape
section1.PagePaddings.Top = 60
Infragistics.Documents.Report.Band.IBand = section1.AddBand
'moves the resource to left and top
band1.Paddings =
Infragistics.Documents.Report.Paddings(13)
Infragistics.Documents.Report.ICanvas = band1.AddCanvas
System.Drawing.Graphics = canvas.CreateGraphics()
' define a string that contains the path to
= m_FolderName
"\"
'convert the chart resource to PDF graphics
m_NLDChart.RenderPdfFriendlyGraphics(g)
'(g, m_NLDChart.Width, m_NLDChart.Height)
'publishes the report
report.Publish(folderPath & m_FileName &
, Infragistics.Documents.Report.FileFormat.PDF)
ErrorTrapping.ExportSuccessfulMessage(m_FileName &
)
Exception
ex
That's something that was recently fixed, though it'll only be available in the next service release. Unfortunately, I can't think of a workaround, other than orienting the labels vertically.
Thanks Max!. It worked. However, I have another question. I am creating a primitive text since I have to manually populate the X axis. These primitive texts are fine on the view, but when i exported to pdf, they are cut. Any suggestions? Image is attached. Thanks. Bobby Pohan.
I think this happens because the x axis labels have an automatic layout set and the document engine can't quite handle it. A quick way to fix that would be to turn off the auto layout, like this:
ultraChart1.Axis.X.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.None;
or if you can create a behavior collection, which should give you a nicer more padded look:ultraChart1.Axis.X.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.UseCollection;RotateAxisLabelLayoutBehavior behavior = new RotateAxisLabelLayoutBehavior();behavior.Enabled = true;behavior.EnableRollback = false;behavior.RotationAngle = 330;behavior.UseOnlyToPreventCollisions = false;ultraChart1.Axis.X.Labels.Layout.BehaviorCollection.Add(behavior);