.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old June 5th, 2002, 05:05 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 23
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 />

Reply With Quote
  #2  
Old June 6th, 2002, 04:18 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 23
<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 />

Reply With Quote
  #3  
Old June 8th, 2002, 10:30 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 23
<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 />

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > Export Report Problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT