Print Search Rate
    
   08-26-2005, 3:33 PM
HowTo: Preview SharpGrid in the ARViewer

Users often want to preview and print their data from SharpGrid. To do this we use the ARViewer. The code below demonstrates how to set up SharpGrid to use the ARViewer.

Note: SharpGrid must first be linked to the Viewer control before you can call the grid's PrintGrid() method to generate a pages collection that will be rendered to the Viewer control.

  
Private Sub Command1_Click()
'Use the PrintSettings Viewer property to link the grid with a Viewer control
Set SGGrid1.PrintSettings.Viewer = ARViewer1
If Command1.Caption = "Preview" Then
'Generates a pages collection and render it to the linked Viewer control.
SGGrid1.PrintSettings.PrintGrid
'Show the ARViewer
ARViewer1.Visible = True
'Change the button caption
Command1.Caption = "Grid"
'Hide the ARViewer
ARViewer1.Visible = False
'Change the button caption
Command1.Caption = "Preview"
End If
End Sub

The attached sample uses the code above to generate a preview of SharpGrid for printing.

The links below contain additional information about the Viewer property and the PrintGrid method.

Viewer Property

PrintGrid Method

If you have further questions please feel free to submit a support request.



Applies To:
SharpGrid 2.0
GrapeCity » Knowledge Base » KnowledgeBase f... » HowTo: Preview SharpGrid in the ARViewer
Privacy Policy | Copyright © 1997-2012 — GrapeCity, inc.
All trademarks mentioned are the property of their respective owners.