Click here to Skip to main content
15,915,163 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionPop up or model dialgue for aspx page Pin
indian14322-Jan-10 8:13
indian14322-Jan-10 8:13 
AnswerRe: Pop up or model dialgue for aspx page Pin
Not Active22-Jan-10 11:09
mentorNot Active22-Jan-10 11:09 
QuestionHTML table in Ajax tab control Pin
Rock Star.22-Jan-10 4:24
Rock Star.22-Jan-10 4:24 
QuestionCrystal Report Direct Print Pin
Girish_Sharma22-Jan-10 1:29
Girish_Sharma22-Jan-10 1:29 
AnswerRe: Crystal Report Direct Print Pin
thatraja22-Jan-10 2:12
professionalthatraja22-Jan-10 2:12 
GeneralRe: Crystal Report Direct Print Pin
Girish_Sharma22-Jan-10 2:27
Girish_Sharma22-Jan-10 2:27 
GeneralRe: Crystal Report Direct Print Pin
thatraja22-Jan-10 2:39
professionalthatraja22-Jan-10 2:39 
GeneralRe: Crystal Report Direct Print Pin
Girish_Sharma23-Jan-10 1:06
Girish_Sharma23-Jan-10 1:06 
Thanks again for your reply. I am using below code with one crystalreportviewer and one button control on web page.
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim ocn As New System.Data.OracleClient.OracleConnection
    Dim oda As New System.Data.OracleClient.OracleDataAdapter("select empno,ename from emp", ocn)
    Dim ods As New System.Data.DataSet()
    ocn.ConnectionString = "Data Source=orcl;User ID=scott;Password=pw;Unicode=True"
    oda.Fill(ods)
    Dim rptprint As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
    rptprint.Load(Server.MapPath("Reports").ToString() + "\\CrystalReport.rpt")
    rptprint.SetDataSource(ods)
    CrystalReportViewer1.ReportSource = rptprint
    CrystalReportViewer1.DataBind()
    ''rptprint.PrintOptions.PrinterName = DefaultPrinterName()
    ''rptprint.PrintToPrinter(1, False, 0, 0)
    TextBox1.Text = DefaultPrinterName()
    rptprint.Close()
    rptprint.Dispose()
    ocn.Close()
    ocn.Dispose()
    ods.Dispose()
    oda.Dispose()
End Sub
Public Shared Function DefaultPrinterName() As String
    Dim oPS As New System.Drawing.Printing.PrinterSettings
    Try
        DefaultPrinterName = oPS.PrinterName
    Catch ex As System.Exception
        DefaultPrinterName = ""
    Finally
        oPS = Nothing
    End Try
End Function


But i am getting error "Object reference not set to an instance of an object." at line CrystalReportViewer1.ReportSource = rptprint. And one more thing it is not returning me the correct default printer name as i have shown in textbox1 control.

Kindly help me to get the direct print using crystal report on clicking of a button on client's line matrix / dot matrix printer. I have set "Generic / Text Only" as their default printers.

Regards
Girish Sharma
GeneralRe: Crystal Report Direct Print Pin
thatraja23-Jan-10 6:43
professionalthatraja23-Jan-10 6:43 
GeneralRe: Crystal Report Direct Print Pin
Girish_Sharma24-Jan-10 17:13
Girish_Sharma24-Jan-10 17:13 
GeneralRe: Crystal Report Direct Print Pin
thatraja24-Jan-10 21:25
professionalthatraja24-Jan-10 21:25 
GeneralRe: Crystal Report Direct Print Pin
Girish_Sharma24-Jan-10 22:08
Girish_Sharma24-Jan-10 22:08 
GeneralRe: Crystal Report Direct Print Pin
thatraja25-Jan-10 8:46
professionalthatraja25-Jan-10 8:46 
GeneralRe: Crystal Report Direct Print Pin
Girish_Sharma26-Jan-10 18:50
Girish_Sharma26-Jan-10 18:50 
GeneralRe: Crystal Report Direct Print Pin
thatraja1-Feb-10 21:40
professionalthatraja1-Feb-10 21:40 
GeneralRe: Crystal Report Direct Print Pin
shrikant.kudlur6-Apr-11 19:27
shrikant.kudlur6-Apr-11 19:27 
AnswerRe: Crystal Report Direct Print Pin
thatraja6-Apr-11 22:49
professionalthatraja6-Apr-11 22:49 
GeneralRe: Crystal Report Direct Print Pin
shrikant.kudlur10-Apr-11 20:18
shrikant.kudlur10-Apr-11 20:18 
AnswerRe: Crystal Report Direct Print Pin
thatraja11-Apr-11 5:17
professionalthatraja11-Apr-11 5:17 
GeneralRe: Crystal Report Direct Print Pin
shrikant.kudlur18-Apr-11 18:57
shrikant.kudlur18-Apr-11 18:57 
GeneralRe: Crystal Report Direct Print Pin
thatraja18-Apr-11 21:39
professionalthatraja18-Apr-11 21:39 
Questionauto complete feature Pin
chakran22-Jan-10 0:36
chakran22-Jan-10 0:36 
Questionlogin Pin
arkiboys22-Jan-10 0:30
arkiboys22-Jan-10 0:30 
AnswerRe: login Pin
Prosanta Kundu online22-Jan-10 0:41
Prosanta Kundu online22-Jan-10 0:41 
Questionhow to access textboxid dynamically Pin
vbmadhavi21-Jan-10 23:14
vbmadhavi21-Jan-10 23:14 

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.