Click here to Skip to main content
15,910,210 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: dropdown list Validator Pin
Sonia Gupta3-Jan-08 23:06
Sonia Gupta3-Jan-08 23:06 
GeneralRe: dropdown list Validator Pin
Michael Sync4-Jan-08 4:23
Michael Sync4-Jan-08 4:23 
GeneralPreventing multiple clicks on a button. Pin
Janu_M3-Jan-08 20:12
Janu_M3-Jan-08 20:12 
GeneralRe: Preventing multiple clicks on a button. Pin
samerh3-Jan-08 20:28
samerh3-Jan-08 20:28 
GeneralRe: Preventing multiple clicks on a button. Pin
Janu_M3-Jan-08 21:27
Janu_M3-Jan-08 21:27 
GeneralRe: Preventing multiple clicks on a button. Pin
Michael Sync3-Jan-08 21:30
Michael Sync3-Jan-08 21:30 
GeneralRe: Preventing multiple clicks on a button. Pin
Declan Bright4-Jan-08 1:47
Declan Bright4-Jan-08 1:47 
Generalwant to fransfer datas from sql server to excel Pin
Deepthy.P.M3-Jan-08 20:08
Deepthy.P.M3-Jan-08 20:08 
I am using asp.net+vb.net
I want to export datas from sqlserver to excel.I wrote code for that.My it display in the internet explorer same page. I want to display in another page and want to set only print button for that page.
The code i wrote is given below.
*****************
Private Sub BindReport()
If Session("Rep") Is Nothing Then
Dim ConnInfo As New ConnectionInfo
With ConnInfo
.ServerName = "User1"
.DatabaseName = "IMS"
.UserID = "sa"
.Password = ""
End With
Dim rep As New ReportDocument
rep.Load(Server.MapPath("Crystalreport2.rpt"))
Me.CrystalReportViewer1.ReportSource = rep
Dim RepTbls As Tables = rep.Database.Tables
For Each RepTbl As Table In RepTbls
Dim RepTblLogonInfo As TableLogOnInfo = RepTbl.LogOnInfo
RepTblLogonInfo.ConnectionInfo = ConnInfo
RepTbl.ApplyLogOnInfo(RepTblLogonInfo)
Next
Session("Rep") = rep
End If
Me.CrystalReportViewer1.ReportSource = Session("Rep")
Me.CrystalReportViewer1.DataBind()

End Sub
**************************
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then


BindReport()
Me.CrystalReportViewer1.ShowFirstPage()

End If
end sub
******************************

Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click


crReportDocument = New ReportDocument()
crReportDocument.Load(Server.MapPath("crystalreport2.rpt"))
Fname = "C:\exports\" & Session.SessionID.ToString & ".xls"
crDiskFileDestinationOptions = New DiskFileDestinationOptions()
crDiskFileDestinationOptions.DiskFileName = Fname
crExportOptions = crReportDocument.ExportOptions
With crExportOptions
.DestinationOptions = crDiskFileDestinationOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
End With
crReportDocument.Export()
Dim oStream As New MemoryStream
oStream = crReportDocument.ExportToStream(ExportFormatType.Excel)
oStream = crReportDocument.ExportToStream(ExportFormatType.Excel)

report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.ExcelRecord)

Response.Clear()

Response.Buffer = True

Response.ContentType = "application/vnd.ms-excel"



Response.BinaryWrite(oStream.ToArray())

Response.End()

end sub

and also i want to display it in word how can i do the pls give code also.
GeneralRe: want to fransfer datas from sql server to excel Pin
kumareshTMC3-Jan-08 22:27
kumareshTMC3-Jan-08 22:27 
GeneralRe: want to fransfer datas from sql server to excel Pin
Deepthy.P.M4-Jan-08 1:42
Deepthy.P.M4-Jan-08 1:42 
GeneralDatabase Exception Pin
SreejithAchutan3-Jan-08 20:02
SreejithAchutan3-Jan-08 20:02 
GeneralRe: Database Exception Pin
Michael Sync3-Jan-08 20:08
Michael Sync3-Jan-08 20:08 
GeneralRe: Database Exception Pin
SreejithAchutan3-Jan-08 20:10
SreejithAchutan3-Jan-08 20:10 
GeneralRe: Database Exception Pin
Michael Sync3-Jan-08 20:50
Michael Sync3-Jan-08 20:50 
GeneralRe: Database Exception Pin
SreejithAchutan3-Jan-08 21:39
SreejithAchutan3-Jan-08 21:39 
GeneralRe: Database Exception Pin
Michael Sync3-Jan-08 21:54
Michael Sync3-Jan-08 21:54 
GeneralRe: Database Exception Pin
Paul Conrad4-Jan-08 6:52
professionalPaul Conrad4-Jan-08 6:52 
GeneralRe: Database Exception Pin
SreejithAchutan3-Jan-08 21:49
SreejithAchutan3-Jan-08 21:49 
GeneralRe: Database Exception Pin
SreejithAchutan3-Jan-08 22:28
SreejithAchutan3-Jan-08 22:28 
Questionupdate button in grid view Pin
Sonia Gupta3-Jan-08 19:53
Sonia Gupta3-Jan-08 19:53 
GeneralRe: update button in grid view Pin
Michael Sync3-Jan-08 19:57
Michael Sync3-Jan-08 19:57 
GeneralRe: update button in grid view Pin
Sonia Gupta3-Jan-08 20:10
Sonia Gupta3-Jan-08 20:10 
GeneralRe: update button in grid view [modified] Pin
Michael Sync3-Jan-08 20:20
Michael Sync3-Jan-08 20:20 
GeneralRe: update button in grid view Pin
Sonia Gupta3-Jan-08 20:24
Sonia Gupta3-Jan-08 20:24 
GeneralRe: update button in grid view Pin
Michael Sync3-Jan-08 20:48
Michael Sync3-Jan-08 20:48 

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.