|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Export Report Problem
<i><b>Originally posted by : Dev (devaforwards@yahoo.com)</b></i><br />Hi<br /><br />i have a problem in exporting report programmatically. MSDN gives the following code example <br /><br /><br />Dim exportOpts As New ExportOptions()<br /> Dim diskOpts As New DiskFileDestinationOptions()<br /> Dim excelFormatOpts As New ExcelFormatOptions()<br /><br /> exportOpts = Report.ExportOption<br /><br /><br /> ' Set the excel format options.<br /> excelFormatOpts.ExcelTabHasColumnHeadings = True<br /><br /> exportOpts.ExportFormatType = ExportFormatType.Excel<br /> exportOpts.FormatOptions = excelFormatOpts<br /><br /> ' Set the export format.<br /> exportOpts.ExportFormatType = ExportFormatType.Excel<br /><br /> exportOpts.ExportDestinationType = ExportDestinationType.DiskFile<br /><br /> ' Set the disk file options.<br /> diskOpts.DiskFileName = "d:inetpubwwwrootMyFirstAppMyFirstReport.xls"<br /> exportOpts.DestinationOptions = diskOpts<br /><br /> Report.Export()<br /><br /><br />but the code give error at the following line<br />exportOpts = Report.ExportOption<br /><br />because it does not have the "Report" object. <br /><br />MSDN doesnt give any information about this "Report" object<br /><br /><br />has anybody tried this?<br />
|
|
#2
|
|||
|
|||
|
<i><b>Originally posted by : Ycel (ycel0425@hotmail.com)</b></i><br />The 'Report' word pertains to the name or id of your ReportDocument object. What you can do is to instantiate this object first and then reference it. Say if your report file is named 'CrystalReport1.rpt', u shld have this line first:<br /><br />Dim Report As CrystalReport1 = New CrystalReport1()<br /><br />by then u may set the properties and methods of your 'Report' object.<br /><br />Hope this helps.<br /><br /><br /><br /><br /><br />------------<br />Dev at 6/5/2002 2:05:37 PM<br /><br />Hi<br /><br />i have a problem in exporting report programmatically. MSDN gives the following code example <br /><br /><br />Dim exportOpts As New ExportOptions()<br /> Dim diskOpts As New DiskFileDestinationOptions()<br /> Dim excelFormatOpts As New ExcelFormatOptions()<br /><br /> exportOpts = Report.ExportOption<br /><br /><br /> ' Set the excel format options.<br /> excelFormatOpts.ExcelTabHasColumnHeadings = True<br /><br /> exportOpts.ExportFormatType = ExportFormatType.Excel<br /> exportOpts.FormatOptions = excelFormatOpts<br /><br /> ' Set the export format.<br /> exportOpts.ExportFormatType = ExportFormatType.Excel<br /><br /> exportOpts.ExportDestinationType = ExportDestinationType.DiskFile<br /><br /> ' Set the disk file options.<br /> diskOpts.DiskFileName = "d:inetpubwwwrootMyFirstAppMyFirstReport.xls"<br /> exportOpts.DestinationOptions = diskOpts<br /><br /> Report.Export()<br /><br /><br />but the code give error at the following line<br />exportOpts = Report.ExportOption<br /><br />because it does not have the "Report" object. <br /><br />MSDN doesnt give any information about this "Report" object<br /><br /><br />has anybody tried this?<br />
|
|
#3
|
|||
|
|||
|
<i><b>Originally posted by : Dev (devaforwards@yahoo.com)</b></i><br />Hi <br /><br />Thanks for the soln it worked. i have 2 more queries. <br /><br />1) if i try to export report thru webform it gives<br /> me following error<br />"Access to report file denied. Another program may be using it."<br /><br />2) Also i want to try and avoid hardcoding of the name of the report i.e. i dont want to do the following<br />Dim Report As CrystalReport2 = New CrystalReport2()<br /><br />the export option shud automatically export whichever report is displayed in the crystal viewer to the desired location without displaying the save dialog box. is it possible?<br /><br />Regards,<br />Dev<br /><br />
|
![]() |
| Viewing: ASP Free Forums > Programming > .NET Development > Export Report Problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|