Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #11 (permalink)  
Old April 8th, 2005, 04:39 AM
Registered User
 
Join Date: Apr 2005
Location: chennai, TAMILNADU, India.
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

Reply With Quote
  #12 (permalink)  
Old April 8th, 2005, 12:02 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: India.
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

Reply With Quote
  #13 (permalink)  
Old April 12th, 2005, 04:48 AM
Registered User
 
Join Date: Apr 2005
Location: chennai, TAMILNADU, India.
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


Reply With Quote
  #14 (permalink)  
Old April 12th, 2005, 04:49 AM
Registered User
 
Join Date: Apr 2005
Location: chennai, TAMILNADU, India.
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

Reply With Quote
  #15 (permalink)  
Old April 12th, 2005, 04:50 AM
Registered User
 
Join Date: Apr 2005
Location: chennai, TAMILNADU, India.
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


Reply With Quote
  #16 (permalink)  
Old April 18th, 2005, 01:27 AM
Registered User
 
Join Date: Apr 2005
Location: chennai, TAMILNADU, India.
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

Reply With Quote
  #17 (permalink)  
Old July 10th, 2006, 05:49 AM
Registered User
 
Join Date: Jul 2006
Location: Trichy, tmilnadu, India.
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
Reply With Quote
  #18 (permalink)  
Old January 20th, 2007, 05:50 AM
Registered User
 
Join Date: Jan 2007
Location: , , .
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.


Reply With Quote
  #19 (permalink)  
Old January 20th, 2007, 06:03 AM
Registered User
 
Join Date: Jan 2007
Location: , , .
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

Reply With Quote
  #20 (permalink)  
Old February 14th, 2007, 01:28 AM
Registered User
 
Join Date: Feb 2007
Location: Chennai, Tamil Nadu, India.
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


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 03: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 sukhsinghin@yahoo.com Crystal Reports 0 February 21st, 2006 10:29 AM



All times are GMT -4. The time now is 11:24 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.