
| Visual Basic (Declaration) | |
|---|---|
Public NotInheritable Class PrintingManager | |
| C# | |
|---|---|
public sealed class PrintingManager | |
PrintingManager provides various methods and properties for the document preparation and printing purposes.
The following code demonstrates how to initialize the layout and its further printing.
| C# | Copy Code |
|---|---|
using System; using System.IO; using GrapeCity.ActiveAnalysis.DataSources; using GrapeCity.ActiveAnalysis.Export; using GrapeCity.ActiveAnalysis.Layout; using GrapeCity.ActiveAnalysis.Windows.Forms; static class App { static void Main() { // Create data source that based on the local cube. LocalCubeDataSource dataSource = new LocalCubeDataSource(); dataSource.LocalCubeFile = Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), @"GrapeCity\ActiveAnalysis\DataSources\NWind\nwindlocalcube.ddacube"); dataSource.Connect(); // Create and initialize pivot view. PivotView pivotView = new PivotView(); pivotView.DataSource = dataSource; // Initialize layout. using (ILayoutActions la = pivotView.BeginLayoutUpdate("Prepare layout...")) { la.SetMarkingType(MarkingType.Shape); la.AppendField("[Suppliers].[Supplier Country]", ShelfKind.ColumnShelf); la.AppendField("[Measures].[Average Unit Price]", ShelfKind.ColumnShelf); la.AppendField("[Measures].[Order count]", ShelfKind.RowShelf); la.AppendField("[Products].[Product Categories]", ShelfKind.ShapeShelf); la.AppendField("[Order Date].[Order Date]", ShelfKind.ColorShelf); la.Commit(); } // Create printing manager based on pivot view. PrintingManager printingManager = new PrintingManager(pivotView); // Configure legends position. printingManager.LayoutSettings.LegendPosition = Alignment.Right; printingManager.LayoutSettings.LegendsLayout = ItemsLayout.TopDown; // Configure visible elements. printingManager.LayoutSettings.DisplayDescription = true; printingManager.LayoutSettings.DisplayGrid = true; printingManager.LayoutSettings.DisplayLegends = true; printingManager.LayoutSettings.DisplayTitle = true; // Print without confirmation on the default printer. printingManager.Print(false); } } | |
System.Object
GrapeCity.ActiveAnalysis.Windows.Forms.PrintingManager
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
Reference
PrintingManager MembersGrapeCity.ActiveAnalysis.Windows.Forms Namespace
System.Drawing.Printing