Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
|
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 17th, 2006, 01:41 PM
Registered User
 
Join Date: Apr 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need Export Dialog to come up

Hi all, I am using VS 2003 and Crystal Reports XI. I'm having a problem getting the export dialog box to come up. What I need is when the user clicks the "Export" button, they get the prompts that you would normally get when you export from the Report Viewer. But I don't want to use the report viewer. The following code exports the report but I need to have the dialog boxes that prompt the user for the file type and location. Any help is greatly appreciated.



private void btnExport_Click(object sender, System.EventArgs e)

{

string exportFileName="exportedReport.pdf";

string exportPath="\\Crystal" + "\\" + exportFileName;


string fileName=("rptBankTotals.rpt");

string filePath=String.Concat(@\\Server\Folder + "\\" + fileName);

System.Data.SqlClient.SqlParameter[] par = new System.Data.SqlClient.SqlParameter[2];

int size = 0;

par[size] = new System.Data.SqlClient.SqlParameter("EndingDate", SqlDbType.DateTime);

par[size].Value = this.udtDate.Value;

size++;

par[size] = new System.Data.SqlClient.SqlParameter("FinancialAccou ntId", SqlDbType.Int);

par[size].Value =Convert.ToInt32(ucbSelectBank.Value);

size++;

DataSet ds = objReports.RunReport("usp_rptBankTotals", par);

ReportDocument crReportDocument=new ReportDocument();


crReportDocument.Load (filePath);

crReportDocument.SetDataSource(ds);

 crReportDocument.ExportToDisk(ExportFormatType.Por tableDocFormat,exportPath);

Thank you!!






Similar Threads
Thread Thread Starter Forum Replies Last Post
replace Word dialog with my designing dialog doublelucky Visual C++ 0 March 19th, 2007 02:27 AM
Dialog Help Ids sumeetpm Visual C++ 0 October 31st, 2006 03:19 PM
OPEN DIALOG.... NOW !!!!!!!!!!!! ALEX_GRIM Beginning VB 6 1 December 8th, 2004 10:26 AM
insert dialog box in a dialog box BurhanKhan Visual C++ 7 June 1st, 2004 07:53 PM
no dialog boxes will appear amber Crystal Reports 1 May 18th, 2004 11:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.