Click here to Skip to main content
15,911,035 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralASP.Net with Apache Pin
kavithakcross19-Nov-08 18:32
kavithakcross19-Nov-08 18:32 
GeneralRe: ASP.Net with Apache Pin
Parwej Ahamad19-Nov-08 19:11
professionalParwej Ahamad19-Nov-08 19:11 
GeneralRe: ASP.Net with Apache Pin
kavithakcross19-Nov-08 20:12
kavithakcross19-Nov-08 20:12 
GeneralRe: ASP.Net with Apache Pin
Parwej Ahamad19-Nov-08 21:53
professionalParwej Ahamad19-Nov-08 21:53 
GeneralRe: ASP.Net with Apache Pin
kavithakcross19-Nov-08 22:43
kavithakcross19-Nov-08 22:43 
QuestionNeed help with IIS authentication Pin
Rajeevg19-Nov-08 18:29
Rajeevg19-Nov-08 18:29 
QuestionReport Viewer Pin
kenexcelon19-Nov-08 14:19
kenexcelon19-Nov-08 14:19 
AnswerRe: Report Viewer Pin
Samer Aburabie19-Nov-08 14:44
Samer Aburabie19-Nov-08 14:44 
I can answer you regardin the render method ... you probably meant the ReportViewer.LocalReport.Render method ... well its the main method in the ReportViewer Control ... this method uses the report definition (which is an xml format stored in rdlc file referring to the report) to render the report defintion with its data to the ASP.NET page ... the LocalReport will have the definition and its integrated with the stored procedure or the datasource ... then using some parameters to the render method you get an array of bytes which is the output you want ...

Take a look at the code below:

///Render the report as an attachement
string format="PDF";//Excel, Html ... etc

Warning[] warnings;
string[] streamIDs;
string mimeType;
string encoding;
string extension;
string deviceInfo = "<deviceinfo><simplepageheaders></simplepageheaders></deviceinfo>";

byte[] buffer = viewer.LocalReport.Render(format, deviceInfo, out mimeType, out encoding, out extension, out streamIDs, out warnings);

this.Response.Clear();
this.Response.AddHeader("Content-Type", mimeType);
this.Response.AddHeader("Content-Disposition", "attachment; filename=" + reportName + "." + extension);
this.Response.BinaryWrite(buffer);
this.Response.End();



The above code will render the specified local report as PDF and return the result as an array of bytes ... then you write this array of bytes to back to the response as a dialog of Open or Save ...

I needed this trick in a project and it worked fine with me ... I could render the report to PDF Excel or whatever I can to be as the user can just download easly.

Hope this could help ...

Sincerely Samer Abu Rabie

Note: Please remember to rate this post to help others whom reading it.


GeneralRe: Report Viewer Pin
kenexcelon20-Nov-08 14:52
kenexcelon20-Nov-08 14:52 
Questionexport to excel from asp.net Pin
Member 141625419-Nov-08 13:16
Member 141625419-Nov-08 13:16 
AnswerRe: export to excel from asp.net Pin
Samer Aburabie20-Nov-08 15:25
Samer Aburabie20-Nov-08 15:25 
GeneralRe: export to excel from asp.net Pin
Member 141625420-Nov-08 17:58
Member 141625420-Nov-08 17:58 
Questionhow to display confirmation data in formview prior to insert Pin
stanley.mark@usa.net19-Nov-08 11:53
stanley.mark@usa.net19-Nov-08 11:53 
QuestionWatermarking images in DB with a specific text Pin
reogeo200819-Nov-08 8:07
reogeo200819-Nov-08 8:07 
AnswerRe: Watermarking images in DB with a specific text Pin
Christian Graus19-Nov-08 8:17
protectorChristian Graus19-Nov-08 8:17 
Questioni got following error while using com lib to read word document uploaded by client through asp.net Pin
vikashjain02@gmail.com19-Nov-08 6:22
vikashjain02@gmail.com19-Nov-08 6:22 
AnswerRe: i got following error while using com lib to read word document uploaded by client through asp.net Pin
Christian Graus19-Nov-08 8:20
protectorChristian Graus19-Nov-08 8:20 
QuestionWhile i try to upload doc file in a folder throug ASP .net i got following error please help in solving it Pin
vikashjain02@gmail.com19-Nov-08 6:12
vikashjain02@gmail.com19-Nov-08 6:12 
AnswerRe: While i try to upload doc file in a folder throug ASP .net i got following error please help in solving it Pin
Christian Graus19-Nov-08 8:21
protectorChristian Graus19-Nov-08 8:21 
Questioncustom control set foucs problem Pin
lav naphade19-Nov-08 3:23
lav naphade19-Nov-08 3:23 
AnswerRe: custom control set foucs problem Pin
Christian Graus19-Nov-08 8:35
protectorChristian Graus19-Nov-08 8:35 
GeneralRe: custom control set foucs problem Pin
lav naphade19-Nov-08 18:18
lav naphade19-Nov-08 18:18 
QuestionList Box problem Pin
enthusiastic47719-Nov-08 2:18
enthusiastic47719-Nov-08 2:18 
AnswerRe: List Box problem Pin
Nishant Singh19-Nov-08 2:53
Nishant Singh19-Nov-08 2:53 
AnswerRe: List Box problem Pin
Christian Graus19-Nov-08 8:35
protectorChristian Graus19-Nov-08 8:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.