I have a Crystal Report 10 report which i need to use in my app. I use Managed solution for this. There are no compiler or linker problems. I am not able to display this report on the screen but am able to print the report. I tried all member methods - Visible, Show, BringToFront, set_Size etc. Am i missing something.?
Here is the code snippet for your ref:
crReportDocument = new ReportDocument();
// MessageBox("Report Document Instance Created", "New Reports");
crReportDocument->Load("BATCHSQL.RPT");
// MessageBox("File Loaded to Report Document Instance ", "New Reports");
//Setup the connection information structure to be used
//to log onto the datasource for the report.
crConnectionInfo = new ConnectionInfo();
// MessageBox("Connection Info set", "New Reports");
//Get the table information from the report
crDatabase = crReportDocument->Database;
crTables = crDatabase->Tables;
// MessageBox("Start Looping through all tables in the REPORT", "New Reports");
//Loop through all tables in the report and apply the connection information for each table.
// MessageBox("Show the Report", "New Reports");
//Set the viewer to the report object to be previewed.
crViewer = new CrystalReportViewer();
crViewer->ReportSource = crReportDocument;
// MessageBox("View the Report", "New Reports");
crViewer->Location = System::Drawing::Point(60, 60);
crViewer->Size = System::Drawing::Size(750, 750);
crViewer->Show();
crViewer->BringToFront();
crViewer->Visible = TRUE ;
crViewer->RefreshReport();
crViewer->Zoom(200);
crViewer->DisplayToolbar = TRUE ;
crViewer->DisplayBackgroundEdge = TRUE;
// crViewer->PrintReport(); ---- This works
MessageBox("Refreshing of the Report Complete", "New Reports");
Any suggestions?
Thanks,
Madhu
From http://www.developmentnow.com/g/34_2...et-general.htm
Posted via DevelopmentNow.com Groups
http://www.developmentnow.com