Hi.
After set the next page settings in my report: the margins i left 5,right 5, top 5 and bottom 5, format A4 small. Print preview is correct. But after page print right margin over then left.
I thing the problem in ReportViewerModel.Print.cs of you source code Telerik.ReportViewer.Silverlight
There are the next method:
static void SetPageVisual(PageInfo pageInfo, PrintPageEventArgs e, Action<Exception> onError)
{
try
{
var printPage = GetUIElement(pageInfo.Buffer);
var visualRoot = new StackPanel();
visualRoot.Children.Add(printPage);
visualRoot.HorizontalAlignment = HorizontalAlignment.Left;
e.PageVisual = visualRoot;
var printTransform = new CompositeTransform();
printPage.RenderTransform = printTransform;
printTransform.TranslateX = -e.PageMargins.Left;
printTransform.TranslateY = -e.PageMargins.Top;
var printWidth = e.PrintableArea.Width + e.PageMargins.Left + e.PageMargins.Right;
var printHeight = e.PrintableArea.Height + e.PageMargins.Top + e.PageMargins.Bottom;
if (printWidth < printPage.RenderSize.Width || printHeight < printPage.RenderSize.Height)
{
var scaleFactor = Math.Min(printWidth / printPage.RenderSize.Width,
printHeight / printPage.RenderSize.Height);
printTransform.ScaleX = scaleFactor;
printTransform.ScaleY = scaleFactor;
}
visualRoot.UpdateLayout();
e.HasMorePages = true;
}
catch (Exception ex)
{
onError(ex);
}
}
}
Why is you set the visualRoot.HorizontalAlignment = HorizontalAlignment.Left?
After set the next page settings in my report: the margins i left 5,right 5, top 5 and bottom 5, format A4 small. Print preview is correct. But after page print right margin over then left.
I thing the problem in ReportViewerModel.Print.cs of you source code Telerik.ReportViewer.Silverlight
There are the next method:
static void SetPageVisual(PageInfo pageInfo, PrintPageEventArgs e, Action<Exception> onError)
{
try
{
var printPage = GetUIElement(pageInfo.Buffer);
var visualRoot = new StackPanel();
visualRoot.Children.Add(printPage);
visualRoot.HorizontalAlignment = HorizontalAlignment.Left;
e.PageVisual = visualRoot;
var printTransform = new CompositeTransform();
printPage.RenderTransform = printTransform;
printTransform.TranslateX = -e.PageMargins.Left;
printTransform.TranslateY = -e.PageMargins.Top;
var printWidth = e.PrintableArea.Width + e.PageMargins.Left + e.PageMargins.Right;
var printHeight = e.PrintableArea.Height + e.PageMargins.Top + e.PageMargins.Bottom;
if (printWidth < printPage.RenderSize.Width || printHeight < printPage.RenderSize.Height)
{
var scaleFactor = Math.Min(printWidth / printPage.RenderSize.Width,
printHeight / printPage.RenderSize.Height);
printTransform.ScaleX = scaleFactor;
printTransform.ScaleY = scaleFactor;
}
visualRoot.UpdateLayout();
e.HasMorePages = true;
}
catch (Exception ex)
{
onError(ex);
}
}
}
Why is you set the visualRoot.HorizontalAlignment = HorizontalAlignment.Left?