Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
|
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 8th, 2005, 04:39 AM
Registered User
 
Join Date: Apr 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi ashu this is the answer to export file from crystal report to text file
 Dim crpt As New query1
        Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
        Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo
        ' Dim crExportOptions As ExportOptions
        Dim crDiskFileDestinationOptions As DiskFileDestinationOptions
        ' Dim crDiskFileDestinationOptions As DiskFileDestinationOptions
        Dim fname As String
        Dim crExportOptions As ExportOptions
        CrystalReportViewer1.Visible = True
        '
        For Each myTable In crpt.Database.Tables
            myLogin = myTable.LogOnInfo
            myLogin.ConnectionInfo.Password = "sa"
            myLogin.ConnectionInfo.UserID = "sa"
            myTable.ApplyLogOnInfo(myLogin)
        Next
        Dim YEARID = 9

        '**********************
        '
        Dim Parameters As New ParameterFields
        Dim ParamValue As New ParameterDiscreteValue
        '
        Dim Parameter As New ParameterField
        Parameter.ParameterFieldName = "YEARID"
        ParamValue.Value = YEARID
        Parameter.CurrentValues.Add(ParamValue)
        Parameters.Add(Parameter)
        Parameters.Add(Parameter)
        CrystalReportViewer1.ParameterFieldInfo = Parameters
        CrystalReportViewer1.ReportSource = crpt
        CrystalReportViewer1.DataBind()
        CrystalReportViewer1.RefreshReport()
        '
        ' CrystalReportViewer1.ParameterFieldInfo = Parameters
        ' CrystalReportViewer1.ReportSource = crpt
        ' crpt.PrintOptions.PrinterName = "Epson LQ-400"
        'CrystalReportViewer1.DataBind()
        'crpt.PrintToPrinter(1, False, 0, 0)
        ' CrystalReportViewer1.RefreshReport()



        '**********************
        'Dim Parameters As New ParameterFields
        Dim ParamValue3 As New CrystalDecisions.Shared.ParameterValues
        Dim ParamValue4 As New ParameterDiscreteValue
        ' Dim Parameter As New ParameterField
        ' Parameter.ParameterFieldName = "@YEARID"
        'ParamValue1.Value = YEAR_ID
        'Parameter.CurrentValues.Add(ParamValue)
        ' Parameters.Add(Parameter)
        ' Dim field As New CrystalDecisions.Shared.ParameterValues
        'Dim value As New CrystalDecisions.Shared.ParameterDiscreteValue
        ' ParamValue1.Value = YEAR_ID
        ' value.Value = 1
        ' field.Add(value)
        'ParamValue.Add(ParamValue1)
        ' Parameter.CurrentValues.Add(ParamValue1)
        ' Parameters.Add(Parameter)

        crpt.DataDefinition.ParameterFields(0).ApplyCurren tValues(ParamValue3)



        '*******************************************
        ' Dim Parameters As New ParameterFields
        Dim ParamValue1 As New CrystalDecisions.Shared.ParameterValues
        Parameter.ParameterFieldName = "YEARID"
        ParamValue4.Value = YEARID
        'Parameter.CurrentValues.Add(ParamValue)
        ' Parameters.Add(Parameter)
        ' Dim field As New CrystalDecisions.Shared.ParameterValues
        'Dim value As New CrystalDecisions.Shared.ParameterDiscreteValue
        ParamValue4.Value = YEARID
        ' value.Value = 1
        ' field.Add(value)
        ParamValue3.Add(ParamValue4)
        Parameter.CurrentValues.Add(ParamValue4)

        crpt.DataDefinition.ParameterFields(0).ApplyCurren tValues(ParamValue3)
        crpt.PrintOptions.PrinterName = "Epson LQ-400"
        crpt.PrintToPrinter(1, False, 0, 0)
        'crpt.DataDefinition.ParameterFields(0).ApplyCurre ntValues(ParamValue3)
        'Export the file instead.
        'fname = "c:\export\" & Session.SessionID.ToString & "sai.txt"
        'crDiskFileDestinationOptions = New DiskFileDestinationOptions
        'crDiskFileDestinationOptions.DiskFileName = fname
        'crExportOptions = crpt.ExportOptions
        'With crExportOptions
        ' .DestinationOptions = crDiskFileDestinationOptions
        ' .ExportDestinationType = ExportDestinationType.DiskFile
        ' .ExportFormatType = ExportFormatType.PortableDocFormat
        'End With
        'crpt.Export()
        'Response.ClearContent()
        'Response.ClearHeaders()
        'Response.ContentType = "application/pdf"
        'Response.WriteFile(fname)
        'Response.Flush()
        'Response.Close()

        '


        ' crpt.PrintOptions.PrinterName = "Epson LQ-400"
        ' Print the report. Set the startPageN and endPageN
        'parameters to 0 to print all pages.
        ' crpt.PrintToPrinter(1, False, 0, 0)
    End Sub

 
Old April 8th, 2005, 12:02 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 224
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to ashu_from_india Send a message via Yahoo to ashu_from_india
Default

hi srisainath

thnx for tht code, i will test it and let u know

thnx again

Ashu

 
Old April 12th, 2005, 04:48 AM
Registered User
 
Join Date: Apr 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi ashu,
have u got the result for the above coding,
i need help from u,i want coding for dotmatrix printer driver.
if u r having send me the coding,this is manual coding written for the driver of dot matrix printer.
urgent

Regards
srisainath


 
Old April 12th, 2005, 04:49 AM
Registered User
 
Join Date: Apr 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi Andrew Hargreaves,
have u got the result for the above coding,
i need help from u,i want coding for dotmatrix printer driver.
if u r having send me the coding,this is manual coding written for the driver of dot matrix printer.
urgent

Regards
srisainath

 
Old April 12th, 2005, 04:50 AM
Registered User
 
Join Date: Apr 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi friends,
have u got the result for the above coding,
i need help from u,i want coding for dotmatrix printer driver.
if u r having send me the coding,this is manual coding written for the driver of dot matrix printer.
urgent

Regards
srisainath


 
Old April 18th, 2005, 01:27 AM
Registered User
 
Join Date: Apr 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi guys ,
i have a doubt in validation,
how to validate checkboxlist in asp.net
if any one knows the answer for this reply me
it is urgent.
help me guys

 
Old July 10th, 2006, 05:49 AM
Registered User
 
Join Date: Jul 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to apkmca
Default

Hai prasadgvl ,I am Ashok From India,
I got the code for printing the file through the dot matrix printer, but i is there any popssible way to print the contents of a flex grid directly to a dotmatrix printer which is connected in the LPT1 port, Please sent replay to me ...


apkk
 
Old January 20th, 2007, 06:50 AM
Registered User
 
Join Date: Jan 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I want to export crystal report in txt format.And print it dot matrix.

i implement:
    private void ConfigureExportToTxt()
    {

        exportOptions.ExportFormatType = ExportFormatType.Text
        diskFileDestinationOptions.DiskFileName = exportPath + @"\" + "TextFormat.txt";
        exportOptions.DestinationOptions = diskFileDestinationOptions;
    }


 ExportSetup();
        ExportSelection();
        ExportCompletion();

I implement this.And Some text is missing.
 how solve this and implement print method.


 
Old January 20th, 2007, 07:03 AM
Registered User
 
Join Date: Jan 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sir,
  I want to Print and view Crystal report at Text format at dot matrix for bank purpuse.
I implement Export to txt method.output txt file some data is missing.
how solve this and how to implement print method.
Please help me
 biplob

 
Old February 14th, 2007, 02:28 AM
Registered User
 
Join Date: Feb 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi ashu,
  i am also having the same problem in my VB project.. the paper was ejected after printing, but i have to print 2 bill in the single a4 sheet..

plz help me to solve this problem..

if u have any code for this solution plz sent it to me..

Regards
Raja prabu







Similar Threads
Thread Thread Starter Forum Replies Last Post
Bill printing problem in Dot Matrix Printer bhowmikp BOOK: Access 2003 VBA Programmer's Reference 2 April 17th, 2008 06:46 AM
printing on dot matrix printer Y.kamal Crystal Reports 1 March 5th, 2007 04:19 AM
Printing on dot matrix printer using C# fgoldenstein C# 2005 2 September 14th, 2006 01:26 AM
Printing On Dot Matrix Printer With Crystal Report rupesh_india Beginning VB 6 1 September 1st, 2006 08:30 PM
Printing problem dot matrix printer using VB.Net [email protected] Crystal Reports 0 February 21st, 2006 11:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.