473,544 Members | 1,802 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using RS.EXE to export a report from Command Line (URGENT)

25 New Member
' File: Test.rss
Dim format as string = "Excel"
Dim fileName as String = "C:\Export2.xls "
Dim reportPath as String = "/TimeByEmployee"

Public Sub Main()

' Prepare Render arguments
Dim historyID as string = Nothing
Dim deviceInfo as string = Nothing
Dim showHide as string = Nothing
Dim results() as Byte
Dim encoding as string
Dim mimeType as string = "ms-excel"
Dim warnings() AS Warning = Nothing
Dim reportHistoryPa rameters() As ParameterValue = Nothing
Dim streamIDs() as string = Nothing
rs.Credentials = System.Net.Cred entialCache.Def aultCredentials

Dim parameters(3) As ParameterValue
parameters(0) = New ParameterValue( )
parameters(0).N ame = "Employee"
parameters(0).V alue = " "
parameters(1) = New ParameterValue( )
parameters(1).N ame = "Department s"
parameters(1).V alue = " "
parameters(2) = New ParameterValue( )
parameters(2).N ame = "Week Number"
parameters(2).V alue = WeekNumber
results = rs.Render(repor tPath, format, _
Nothing, Nothing, parameters, _
Nothing, Nothing, encoding, mimeType, _
reportHistoryPa rameters, warnings, streamIDs)

' Open a file stream and write out the report
Dim stream As FileStream = File.OpenWrite( fileName)
stream.Write(re sults, 0, results.Length)
stream.Close()

End Sub

'End of script



here is how i run it



rs -i RunReport.rss -s http://localhost/reportserver -v WeekNumber=90 -e mgmt2000



this is the error i get:

The value of parameter 'Parameters' is not valid. also how can i cgange this line to pdf

Dim mimeType as string = "ms-excel" i tried this but it did not

work

Dim mimeType as string = "ms-pdf"


Thanks
Oct 26 '07 #1
1 5680
sfrobinson
1 New Member
Don't know about the Parameters error, but if the first two parameter values are defaulted within the report, you may not want to specify them in script at all.

As far as switching from Excel to PDF, replace your corresponding statements with the following:

Expand|Select|Wrap|Line Numbers
  1. Dim format as string = "PDF"
  2. Dim mimeType as string = "application/pdf"
  3.  
Hope this helps.
Feb 12 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
9223
by: sridevi | last post by:
Hello How to export data from ms-access database to excel worksheet using ASP. mainly i need to export data to multiple worksheets. it is very urgent to us. i have a sample code which works only exporting to single worksheet. but i need to export data to multiple worksheets. it is very urgent to us. so please help me in code.
3
2748
by: Thierry Schmitt | last post by:
Hello all, I m quite sure that s a common problem and even that the answer to it has been given somewhere, forgive my lack of perspicacity but here is my problem: In the vba code of a button on a form, leading to the preview of a report, I ve got a variable (string) which has been filled with some information from a SQL querry. I want to...
0
1834
by: suicidaltendencies | last post by:
I'm able to view the report, but when I click the button on the webpage that shows the report to export into a different format it gives me an error on Export. Any help would be great I keep getting the following error Logon failed. Description: An unhandled exception occurred during the execution of the current web request. Please review...
10
3574
by: Simon | last post by:
Hi, I need to export a 200MB database from one domain to another. phpMyAdmin timeout after a while and is not ideal. I don't mind spending money if I have to but this is rather urgent. I only work on win32 machines but the servers are Unix machines. I don't have command line access to the servers.
0
1514
by: sundowner225 | last post by:
Could someone help me with an output problem? I have an access database that I need to create some xls output from. Basically, I have three tables: Faculty_Table: Fields=ID,Name, Type, Degree, Additional Comments Courses_Table: Fields=ID, CourseName, CourseTitle, Section GradCourse_Table: Fields=ID, CourseName, CourseTitle, Institution
1
22760
by: ellenh | last post by:
I have read postings on the similar subject including the posting from 2003 shown below. This process works fine to display a single page snapshot report in PowerPoint. I need to display subsequent pages from the same snapshot file in subsequent slides in PowerPoint. I realize that it is possible to add VB code to the Snapshot Viewer...
6
8713
by: no_spam_for_gman | last post by:
Hi, I have been using the db2 export function for quite sometimes. Everytime I want to use it I have to remove every carriage return from my SQL statement and have it all on one line as shown in the following simplistic example: db2 export to myfile.txt of del select a,b,c from staff This can be time consuming when you have big SQL...
4
4267
by: Mythran | last post by:
Reposted, originally posted in microsoft.public.vb.crystal which is not an MSDN managed newsgroup.... POST BELOW --------------------- We develop our applications and reports using Visual Studio 2008 with Crystal Reports Basic for Visual Studio 2008. The same issue that's been around for years, where you export a report to PDF and...
5
7243
by: simbhasin | last post by:
Hi Champs - I need little help from you all. I am new to ASP and need to generate a code having functionality to export the query results to Excel. Right now, the user is getting the report on the page itself and now i need to provide him fuctionality to export the same results in excel. I need to provide a button on the top and with the...
0
7434
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7371
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7388
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7716
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5305
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4925
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3420
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
993
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
676
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.