Click here to Skip to main content
15,903,856 members
Home / Discussions / C#
   

C#

 
AnswerRe: Code does not appear to be called when program is run Pin
Pete O'Hanlon12-Dec-12 1:06
mvePete O'Hanlon12-Dec-12 1:06 
GeneralRe: Code does not appear to be called when program is run Pin
bikerben12-Dec-12 1:23
bikerben12-Dec-12 1:23 
GeneralRe: Code does not appear to be called when program is run Pin
Pete O'Hanlon12-Dec-12 2:25
mvePete O'Hanlon12-Dec-12 2:25 
SuggestionRe: Code does not appear to be called when program is run Pin
Richard MacCutchan12-Dec-12 3:07
mveRichard MacCutchan12-Dec-12 3:07 
GeneralRe: Code does not appear to be called when program is run Pin
bikerben12-Dec-12 3:12
bikerben12-Dec-12 3:12 
GeneralRe: Code does not appear to be called when program is run Pin
Alan N12-Dec-12 3:07
Alan N12-Dec-12 3:07 
QuestionTFS and WIX Pin
Pascal Ganaye11-Dec-12 22:33
Pascal Ganaye11-Dec-12 22:33 
QuestionCanny edge detection in c# Pin
neha198711-Dec-12 22:11
neha198711-Dec-12 22:11 
AnswerRe: Canny edge detection in c# Pin
Simon_Whale11-Dec-12 22:23
Simon_Whale11-Dec-12 22:23 
AnswerRe: Canny edge detection in c# Pin
Pete O'Hanlon11-Dec-12 22:34
mvePete O'Hanlon11-Dec-12 22:34 
QuestionWCF Services in a multi threaded application results in Oracle Connection request Timed out error Pin
rajaron11-Dec-12 21:56
rajaron11-Dec-12 21:56 
AnswerRe: WCF Services in a multi threaded application results in Oracle Connection request Timed out error Pin
Eddy Vluggen12-Dec-12 3:05
professionalEddy Vluggen12-Dec-12 3:05 
GeneralRunning code as different user Pin
MacUseless11-Dec-12 21:35
MacUseless11-Dec-12 21:35 
SuggestionRe: Running code as different user Pin
Richard Deeming12-Dec-12 1:51
mveRichard Deeming12-Dec-12 1:51 
AnswerRe: Running code as different user Pin
Eddy Vluggen12-Dec-12 3:31
professionalEddy Vluggen12-Dec-12 3:31 
QuestionHTML TO XML Convertion using C# Pin
chittu dinesh11-Dec-12 20:29
chittu dinesh11-Dec-12 20:29 
AnswerRe: HTML TO XML Convertion using C# Pin
Pete O'Hanlon11-Dec-12 20:41
mvePete O'Hanlon11-Dec-12 20:41 
GeneralRe: HTML TO XML Convertion using C# Pin
chittu dinesh11-Dec-12 22:41
chittu dinesh11-Dec-12 22:41 
AnswerRe: HTML TO XML Convertion using C# Pin
BobJanova12-Dec-12 4:25
BobJanova12-Dec-12 4:25 
QuestionFor Developinf Login Application for windows Pin
Member 913168411-Dec-12 20:02
Member 913168411-Dec-12 20:02 
AnswerRe: For Developinf Login Application for windows Pin
Pete O'Hanlon11-Dec-12 20:54
mvePete O'Hanlon11-Dec-12 20:54 
AnswerRe: For Developinf Login Application for windows Pin
Richard Deeming12-Dec-12 1:48
mveRichard Deeming12-Dec-12 1:48 
Questionstoring image in isolated storage Pin
singh123456711-Dec-12 18:39
singh123456711-Dec-12 18:39 
QuestionHow to print an SSRS Report in PDF Format from my asp.net page Pin
Vinay Meka11-Dec-12 18:04
Vinay Meka11-Dec-12 18:04 
Hi guys.,
I had an grid view where i had placed an link button to print an report.In this button click event i need to call the SSRS report and need to get the output as pdf file.
I had used this below code,the code is running fine,but i'm unable to see the prompt to open/save pdf file.Plz reply ASAP.


C#
protected void btnAuthenticateAndPrint_Click(object sender, EventArgs args)
    {
        try
        {
            
            //Getting Values from grid
            LinkButton lb = (LinkButton)sender;
            GridViewRow row = (GridViewRow)lb.NamingContainer;
            Label lbOrderID = row.FindControl("lbOrderID") as Label;
            int OrderId = Convert.ToInt32(lbOrderID.Text);
            da = new SqlDataAdapter("Get_PODetails", con);
            da.SelectCommand.CommandType = CommandType.StoredProcedure;
            da.SelectCommand.Parameters.AddWithValue("@MPDI_ID", OrderId);
            ds = new DataSet();
            da.Fill(ds, "PO");
            if (ds.Tables["PO"].Rows.Count > 0)
            {
                lblPOId.Text=ds.Tables["PO"].Rows[0]["MPDI_ID"].ToString();
                lblVendid.Text = ds.Tables["PO"].Rows[0]["MVDI_ID"].ToString();
                lblBranch.Text = ds.Tables["PO"].Rows[0]["MBRI_ID"].ToString();
                lblDate.Text = Convert.ToDateTime(ds.Tables["PO"].Rows[0]["MPDI_Date"]).ToString("dd-MM-yyyy");
            }
 
            //SSRS Report Print
            rs = new RSWebService.ReportingService2005();
            rsExec = new REWebService.ReportExecutionService();
            rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
            rsExec.Credentials = System.Net.CredentialCache.DefaultCredentials;
            rs.Url = "http://localhost/ReportServer/ReportService2005.asmx";
            rsExec.Url = "http://localhost/ReportServer/ReportExecution2005.asmx";
            byte[] Sendresults = null;
            byte[] bytes = null;
            string historyID = null;
            string deviceInfo = @"<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";
            string format = "PDF";
            string encoding = null;
            string mimeType = null;
            string extension = null;
            REWebService.Warning[] warnings = null;
            string[] streamIDs = null;
            string _reportName = @"/FIMO GOF Assets Reports/PURCHASE ORDER";
            REWebService.ExecutionInfo ei = rsExec.LoadReport(_reportName, historyID);
            REWebService.ParameterValue[] parameters = new REWebService.ParameterValue[4];
            parameters[0] = new REWebService.ParameterValue();
            parameters[0].Name = "MVDI_ID";
            parameters[0].Value = lblVendid.Text;
            parameters[1] = new REWebService.ParameterValue();
            parameters[1].Name = "MBRI_ID";
            parameters[1].Value = lblBranch.Text;
            parameters[2] = new REWebService.ParameterValue();
            parameters[2].Name = "MPDI_Date";
            parameters[2].Value = lblDate.Text;
            parameters[3] = new REWebService.ParameterValue();
            parameters[3].Name = "ReportParameter1";
            parameters[3].Value = lblPOId.Text;
            rsExec.SetExecutionParameters(parameters, "en-us");
            Sendresults = rsExec.Render(format, deviceInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs);
            MemoryStream ms = new MemoryStream(Sendresults);
 

            //To create a PDF
if (format == "PDF")
            {
                Response.ContentType = "application/pdf";
                Response.AddHeader("Content-disposition", "inline;filename=output.pdf");
                Response.AddHeader("Content-Length", Sendresults.Length.ToString());
            }
            Response.OutputStream.Write(Sendresults, 0, Sendresults.Length);
            Response.OutputStream.Flush();
            Response.OutputStream.Close();
 
        }
        catch(Exception Ex)
        {
            throw Ex;
        }
    }

AnswerRe: How to print an SSRS Report in PDF Format from my asp.net page Pin
Richard Deeming12-Dec-12 1:42
mveRichard Deeming12-Dec-12 1:42 

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.