I am working currently on a WPF project and need to print a selected worksheet out of my workbook, if i press print, it will print all sheets in the workbook. Would be nice, if you could help me out :) Also i can`t change the sheet alignment between Horizontal/Vertical.
- Code: Select all
Workbook workbook = new Workbook();
workbook.LoadFromFile(filename);
PrintDialog dialog = new PrintDialog();
dialog.UserPageRangeEnabled = true;
PageRange rang = new PageRange(sheetnumber);
dialog.PageRange = rang;
PageRangeSelection selection = PageRangeSelection.SelectedPages;
dialog.PageRangeSelection = selection;
PrintDocument pd = workbook.PrintDocument;
if (dialog.ShowDialog() == true)
{
pd.Print();
}
Your sincerly
Monika