Dear Sir Please Help Me for Solve This Issue
How To Display Image Path Stored From SQL Server To RDLC Report Using Stored Procedure
-- Print_Application_form 21002,'G1920-32002'
CREATE PROCEDURE [dbo].[Print_Application_form]
@Form_no as bigint, @Regi_no as varchar(20)
AS
BEGIN
select Form_no, Convert(varchar(10),Regi_dt,103) as Reg_Dt,Surname, CandidateName, FatherName, MotherName, BirthPlace,
Image, Religion, Category, Disability, Nationality, PermanentAddress, State, District, SubDist, VillageCity,
Pincode, Country, Phone, Mobile, Email, Convert(varchar(10),DOB,103) As DOB,
Case When Gender = 'M' Then 'Male' Else 'Female' End as Gender,
Education, Passingyear, TechnicalEdu,
CASE WHEN Working_not = 'Y' Then 'Yes' ELSE 'NO' END as Working_Not,
Comp_nm,Expierance, CourceCode+' - '+CourceName As Course, CourceDuration, CenterLocation, Pay_rcpt_no,
Stud_Regi_No,Total_fees, FeesPaid, Aboutusinfo, Mobility, Remarks, Imagedata
from Admission_master
Where Form_no = @Form_no and Stud_Regi_No = @Regi_no
END
Imports System.Data
Imports System.Configuration
Imports System.Data.SqlClient
Imports Microsoft.Reporting.WebForms
Public Class PrintApplication
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
ReportViewer1.ProcessingMode = ProcessingMode.Local
ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/Application_Form.rdlc")
Dim dsCustomers As Application_Form = GetData()
Dim datasource As New ReportDataSource("Application_Form", dsCustomers.Tables(0))
ReportViewer1.LocalReport.DataSources.Clear()
ReportViewer1.LocalReport.DataSources.Add(datasource)
HttpContext.Current.Response.Buffer = True
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.ContentType = "application/pdf"
HttpContext.Current.Response.AddHeader("Content-Disposition", "inline; filename=Report.pdf")
HttpContext.Current.Response.BinaryWrite(ReportViewer1.LocalReport.Render("pdf"))
HttpContext.Current.Response.Flush()
HttpContext.Current.Response.End()
End If
End Sub
Private Function GetData() As Application_Form
Dim Form_No As Int64
Form_No = Convert.ToInt64(Session("Apln_Form_no"))
Session("Apln_Form_no") = Nothing
Dim Stud_Regi_No As String
Stud_Regi_No = Session("Apln_Stud_Regi_no").ToString()
Session("Apln_Stud_Regi_no") = Nothing
Dim conString As String = ConfigurationManager.ConnectionStrings("ITCGANConnectionString").ConnectionString
Dim cmd As New SqlCommand("Print_Application_form")
Using con As New SqlConnection(conString)
Using sda As New SqlDataAdapter()
cmd.Connection = con
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.AddWithValue("@Form_no", Form_No)
cmd.Parameters.AddWithValue("@Regi_no", Stud_Regi_No)
sda.SelectCommand = cmd
Using dsCustomers As New Application_Form()
sda.Fill(dsCustomers, "Print_Application_form")
Return dsCustomers
End Using
End Using
End Using
End Function
End Class
If e.CommandName = "Print" Then
Session("Apln_Form_no") = e.Item.Cells(2).Text
Session("Apln_Stud_Regi_no") = e.Item.Cells(0).Text
Response.Redirect("PrintApplication.aspx")
End If