hi please guide me.............

Last post 05-13-2008 5:11 AM by mahesh.rastogi. 5 replies.

Sort Posts:

  • hi please guide me.............

    05-08-2008, 7:42 AM

    hi friends

    i am developing new webbased application. in that one i want to detect printer and i want to take print out. iam storing tha value in the

    datatable. from there i want to send to printer. can anybody guide me..............it should detect printer.this is my codings.

    Dim df As New DataTable

    df = ds.Tables("DataTable1")

    CrystalReportViewer1.Visible = True

    CrystalReportSource1.ReportDocument.Database.Tables("DataTable1").SetDataSource(ds)

    'CrystalReportSource1.ReportDocument.Database.Tables("DataTable1").SetDataSource(cl.ImageTable("\quality\ALL IMAGES\"))

    CrystalReportViewer1.ReportSource = CrystalReportSource1

    CrystalReportViewer1.DataBind()

  • Re: hi please guide me.............

    05-09-2008, 2:42 AM

    Follow my Instruction

    1 imports Two Name Space

    Imports System.IO

    Imports CrystalDecisions.CrystalReports.Engine

    2 I Suppose that you are showing Report on Page Load. so write the bellow code

     Dim dt As New System.Data.DataTable()

    da.Fill(dt)

    Dim rptDoc As New ReportDocument()rptDoc.Load(Server.MapPath("CrystalReport.rpt").ToString())

    rptDoc.SetDataSource(dt)

    Session(
    "dd") = dt

    CrystalReportViewer1.ReportSource = rptDoc

    3 I suppose that you want to Print The Report on Button Click. First Export it into PDF and Then Print. see the below Code

    Dim dt As Data.DataTable

    dt = CType(Session("dd"), Data.DataTable)

    Dim mstmAgentBrochureSummary As MemoryStream

    Dim rptDoc As New ReportDocument()

    rptDoc.Load(Server.MapPath("CrystalReport.rpt").ToString())

    rptDoc.SetDataSource(dt)

    mstmAgentBrochureSummary =
    CType(rptDoc.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat), MemoryStream)

    Response.Clear()

    Response.Buffer = True

    Response.ContentType = "application/pdf"

    Response.BinaryWrite(mstmAgentBrochureSummary.ToArray())

    Response.End()

    Hope this Help you

  • Re: hi please guide me.............

    05-09-2008, 5:03 AM

    but in my case i am exporting barcode to pdf at that time font size is decreasing. can u help me...........

  • Re: hi please guide me.............

    05-09-2008, 11:30 PM

    same problem i am also facing if u got any solution Please Help me...........

    rajeshacse@live.com

  • Re: hi please guide me.............

    05-13-2008, 1:01 AM
    • Loading...
    • joseabie
    • Joined on 04-07-2008, 4:56 AM
    • Abu Dhabi
    • Posts 82

    did u try to print directly??? please try,, i am not sure,, just try...

    dim rpt as new ReportDocument 

    Rpt.PrintOptions.PaperOrientation = PaperOrientation.Landscape

    Rpt.PrintOptions.PaperSize = PaperSize.PaperA4

    Rpt.PrintToPrinter(1, False, 0, 0) ' it will print all pages

  • Re: hi please guide me.............

    05-13-2008, 5:11 AM

            Dim rptDoc As New ReportDocument
            rptDoc.Load(Server.MapPath("CrystalReport.rpt"))
            CrystalReportViewer1.ReportSource = rptDoc
            rptDoc.PrintOptions.PrinterName = "Samsung ML-7300 PCL 6"
            rptDoc.PrintToPrinter(1, False, 1, 1)

Page 1 of 1 (6 items)