Wrox Programmer Forums
|
BOOK: Professional SQL Server 2005 Reporting Services ISBN: 0-7645-8497-9
This is the forum to discuss the Wrox book Professional SQL Server 2005 Reporting Services by Paul Turley, Todd Bryant, James Counihan, Dave DuVarney; ISBN: 9780764584978
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional SQL Server 2005 Reporting Services ISBN: 0-7645-8497-9 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 September 25th, 2007, 07:53 AM
Registered User
 
Join Date: Sep 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default File name with timestamp


hi fiends,

Can any one help me on this issue please. I am new to this SQL Reporting service.

Using SQL Sever 2005 , windows 2000 professional
Not able to rename the file , when i export the data into excel/pdf format. I tried with Subscription properties. It's giving the RDL name only.
My requirement is need to display filename appending with timestamp.

Steps:
1. I created RDL
2. Opening the RDL data into my GWT application with new IE window
3. Exporting the data into excel/pdf.
4. Able to popup Download file Dialog.
5. Asking the File to save. ( Here by defualt it's giving the RDL File name only. I want to display with RDL file name with timestamp)

Can you please help me.






regards
bhushanam

 
Old September 28th, 2007, 04:39 AM
Registered User
 
Join Date: Sep 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default



 Hello Bhushanam,

 Even i have got the same problem. I solved the problem by overriding render method with the following code.

put below code in button click event

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

{

ReportingService rs = new ReportingService();

string reportPath=/SampleDetail/TestingDetail;

// TestingDetail report must uploded in SampleDetail folder in ReportManager


TestingDetailReport testingDetailParams =this.reportParams as TestingDetailReport;

ParameterValue[] parameters = new ParameterValue[1];


parameters[0] = new ParameterValue();

parameters[0].Name="parameterName";

parameters[0].Value=parameterValue;

Byte[] result = this.LoadReport(reportPath,parameters);


string fname = "TestingDetail" + " - " +DateTime.Today.ToString("MMMM-dd-yyyy");


Response.ClearContent();


Response.AddHeader("Content-Disposition","attachment; filename=" + fname);

Response.AddHeader("Content-Length", result.LongLength.ToString());

Response.ContentType="Application/pdf";

Response.BinaryWrite(result);

Response.Flush();

Response.Close();

}



private Byte[] LoadReport(string reportPath,ParameterValue[] parameter )

{

ReportingService rs = new ReportingService();

rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

string[] streamIDs;

string optionalString = null;

ParameterValue[]optionalparams =null;

Warning[] warning = null;


Byte[] output= rs.Render(reportPath,"PDF",null,null,parameter,nul l,null,out optionalString,out optionalString,out optionalparams,out warning,out streamIDs);

return output;

}








Similar Threads
Thread Thread Starter Forum Replies Last Post
TimeStamp nay_ctg BOOK: Beginning Cryptography with Java 1 August 7th, 2008 07:37 PM
saving file name with timestamp pavankumar_tatiraju SQL Server 2005 0 September 24th, 2007 07:06 AM
timestamp isheikh BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 November 18th, 2004 06:23 PM
UNIX Timestamp apek PHP How-To 4 January 20th, 2004 02:05 PM
Timestamp and sql nevada city J2EE 3 June 24th, 2003 11:20 PM





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