Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example illustrates how to print a sheet using various options. The C++ example displays the common print dialog.

C++

VARIANT printFlag;
printFlag.intVal = PrintFlagsShowCommonDialog;
printFlag.vt = VT_I4;

// Set printing options for sheet
m_Spread1.SetPrintAbortMsg("Printing - Click Cancel toquit");
m_Spread1.SetPrintJobName("XYZ Software");
m_Spread1.SetPrintHeader("/cPrint Header/rPage #/p/n2nd Line");
m_Spread1.SetPrintFooter("/cPrint Footer/rPage #/p/n2nd Line");
m_Spread1.SetPrintBorder(TRUE);
m_Spread1.SetPrintColHeaders(FALSE);
m_Spread1.SetPrintColor(TRUE);
m_Spread1.SetPrintGrid(FALSE);
m_Spread1.SetPrintMarginTop(1440);
m_Spread1.SetPrintMarginBottom(1440);
m_Spread1.SetPrintMarginLeft(720);
m_Spread1.SetPrintMarginRight(720);
m_Spread1.SetPrintType(SPRD_PRINT_ALL);
m_Spread1.SetPrintRowHeaders(FALSE);
m_Spread1.SetPrintShadows(FALSE);
m_Spread1.SetPrintUseDataMax(TRUE);
// Perform the printing action
m_Spread1.PrintSheet(&printFlag);

Visual Basic

' Set printing options for sheet
fpSpread1.PrintAbortMsg = "Printing - Click Cancel to quit"
fpSpread1.PrintJobName = "XYZ Software"
fpSpread1.PrintHeader = "/cPrint Header/rPage #/p/n2nd Line"
fpSpread1.PrintFooter = "/cPrint Footer/rPage #/p/n2nd Line"
fpSpread1.PrintBorder = True
fpSpread1.PrintColHeaders = False
fpSpread1.PrintColor = True
fpSpread1.PrintGrid = False
fpSpread1.PrintMarginTop = 1440
fpSpread1.PrintMarginBottom = 1440
fpSpread1.PrintMarginLeft = 720
fpSpread1.PrintMarginRight = 720
fpSpread1.PrintType = SPRD_PRINT_ALL
fpSpread1.PrintRowHeaders = False
fpSpread1.PrintShadows = False
fpSpread1.PrintUseDataMax = True
' Perform the printing action
fpSpread1.PrintSheet

Copyright © GrapeCity, inc. All rights reserved.