This is a migrated thread and some comments may be shown as answers.

saving a file to a specific path

0 Answers 26 Views
GridView
This is a migrated thread and some comments may be shown as answers.
loraine
Top achievements
Rank 1
loraine asked on 20 May 2011, 07:41 AM
hi!
i have the code for saving a gridview as an html file using a savefiledialog. i want to save it to a specific path (without using the savefiledialog)... how can i do that?


SaveFileDialog dialog = new SaveFileDialog();
dialog.DefaultExt = "*.html";
dialog.Filter = "WORD Document (*.html)|*.html";
 
if (dialog.ShowDialog() == true)
{
	RadDocument document = CreateDocument(rgvReportData);
 
	document.LayoutMode = DocumentLayoutMode.Paged;
 
	document.Measure(RadDocument.MAX_DOCUMENT_SIZE);
	document.Arrange(new RectangleF(PointF.Empty, document.DesiredSize));
	document.SectionDefaultPageMargin = new Telerik.Windows.Documents.Layout.Padding(2, 2, 2, 2);
	document.SectionDefaultPageOrientation = PageOrientation.Landscape;
	
	HtmlFormatProvider provider = new HtmlFormatProvider();
 
	using (Stream output = dialog.OpenFile())
	{
		provider.Export(document, output);
	}
} 
 
how can i sve it without using a savefiledialog?

No answers yet. Maybe you can help?

Tags
GridView
Asked by
loraine
Top achievements
Rank 1
Share this question
or