Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Crystal Report To Default Printer


Dear all,

We are using VB60 and Crystal Report Control 4.6
How do we get de report "d: estq.rpt" to our default printer? A lot of people can reach the report and have there own default printer.

Nice regards,
Michelle.


CrystalReport1.ReportFileName = "d: estq.rpt"
CrystalReport1.PrinterName = "????"
CrystalReport1.Destination = crptToPrinter
CrystalReport1.MarginLeft = 1
CrystalReport1.Action = 1




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Vb/crystal:how To Replace Crviewer Default Printer With Windows Common Dialog Printer
hi all,
I'm trying to create a crystal report through vb.
does anyone know how to replace the default printer ( that comes with crviewer control) with a windows common dialog printer. I mean, with the options to select differnt printers etc.

How To Automatically Use The Default Printer In Crystal Reports 10
Hi to all,

In retrieving the printers configured in my system and in getting the default printer, all I need to do is use the Printer object in VB?

Does that work? Why is it that some site gave examples in getting the default printer using API calls?

I am also having problems in setting the printer dynamically at runtime using crystal reports.

Thanks and god bless.

Data Report - Default Printer
I have a problem. To print a cash memo, I have to select the page length of a dot matrix printer as half of an A4 Size paper. By setting this printer as default printer of the system, the data report is working fine. But, this cannot be set as the default printer as they use the full size page printing most of the time. So, how can I print with a particular Data Report (only for that report) certain setting of printer - OR - How can I set the default printer inside the program.

Thanks

Crystal Reports Won't Accept Change To Default Printer
(VB6, Crystal 9)

I've added all the printers on the computer to a combobox, so the user can select a printer to print from.

I'm using a method i found on this forum, to change the default printer - it stores the default printer, sets the newly selected printer as the default, then re-instates the old default printer. ( I could paste this code, but its a bit lengthy - its the class thats a modification of MSDN's article Q167735).

So i have a custom print dialog, and under the print button i have (where setprinter is the lengthy class):

Dim SetPrinter As New clsSetDefaultPrinter
Dim DeviceName As String
Dim smsg As String

DeviceName = cboPrinter.Text
If SetPrinter.SetPrinterAsDefault(DeviceName) Then
smsg = DeviceName & " -set"
Else
smsg = DeviceName & " -not set "
End If

MsgBox smsg, vbDefaultButton1, ""

MsgBox Printer.DeviceName & vbCrLf & Printer.DriverName & vbCrLf & _
Printer.Port, vbDefaultButton1, ""

MyReport.PrintOut False, 1, False

'destroy instance of printer class to restore printer to default
Set SetPrinter = Nothing

MsgBox Printer.DeviceName & vbCrLf & Printer.DriverName & vbCrLf & _
Printer.Port, vbDefaultButton1, ""
End Sub


See the messageboxes - they show that the default printer is indeed being changed, then restored. Yet the report is still being printed from the "default" printer - that is, its prints like the change never took place, from the original printer, not the newly selected printer.

Now whats most frustrating about this is if i run the above code in a seperate .exe, (a simple combo box which lists printers, and does the above swapping of printers), leave it open after i've changed it to the printer i want, then open the app with the above code in it, it WILL print to the printer that i want to change it to.

I've tried adding the MyReport.PrintOut :

MyReport.SelectPrinter Printer.DriverName, Printer.DeviceName, Printer.Port

But this crashes the app and shuts down vb.

Can anyone help me, i'm getting a bald patch where i'm scratching my head so much.

Crystal Report Default
I usually use standart report expert step by step setting from data to style. until style section it will promp for 2 radio button
asking for yes no answer."use report file as starup bla bla bla..." but now the dialog box with 2 radio button never come out anymore.
Now how to set it so the dialog box to be appear againt? any one know the setting of this default properties?

all response welcome

Default Paper Size When Printing Crystal Report From VB6
Problem:
When printing a crystal report from VB6, the default paper size sets to 'Letter'. I would like to change this to 'A4'. I have set the paper size of the crystal report to A4 and the default paper size of the printer to A4. When I print the report from crystal it prints fine but when I print the report from VB6, the paper size defaults to letter. This can be changed to A4 using the Advanced layout options but I want A4 to be the default.

Any ideas?

This is the bit of code that sets up the printer and prints the report.

CrRep.Destination = crptToPrinter
CrRep.PrinterSelect
CrRep.PrintReport

Thanks,

Sean

Crystal Report On Dot Matirx Printer
Does anyone know of any reason why a crystal report would not display correctly (some lines showing very large and others show as just dots and dashes) on a dot matrix printer?

Printer Selection In Crystal Report 7
Dear Members
i am using crystal report 7
the problem is this that i have to select the printer From the user,kindly send me any solution.
Thanks

How To Specify Printer In Crystal Report 9.2 At Run Time
I am using CR 9.2 with VB 6

How do I specify printer in crystal report at run time. Addition My printers are local printer and share printer.

Printing A Crystal Report To Printer
So far I've just been printing my reports to a window, but now want to print to the printer.

I set my reportfilename and printfilename and set it to print to printer, but each time I want to print it, it asks me for an output filename. I enter it, but nothing gets printed - a file with the name I specified when asked is just created.

Any suggestions??

Andy

How To Select A Printer In VB Crystal Report.
Hi

How to select a printer in vb.

I have VB5, VB6 & Crystal Report.

My crystal reporter PRINT button Active only WINDOWS DEFAULT PRINTER.

Every time we are go to Control Panel - Printer Settings - select a printer & set as Default Printer.

I want choose the printer name in RUN Time.

I tried to Common Dialog aslo.

Is it possible ?

How to write the coding / settings.

By
IRAM

Crystal Report 9 Printer Queue Doc. Name
simply.... HELP!!!

I have been trying for weeks and months to figure out how to cutomize the printer queue document name when crystal report is printing out a report.

The default queue name is something like "Crystal Report ActiveX.." or similar.

Is there a way to fix/rename the Printer Queue document's name?

I'm totally lost on this. Any suggestions, pointers or hints are much appreciated. Thanx.

Selecting Printer Using Crystal Report In VB6
Hello,

I would be grateful if someone could help me to be able to select a printer whilst using crystal report 8 with Visual Basic 6.

Thanks

Changing Printer In A Crystal Report
I have designed serveral reports using Crystal Reports for my VB 6.0 application. When I run them within my application, when the report previews on the screen, I can click on the 'printer' button. The box which comes up then, does not give the user a chance to change the printer(all of our users have 3 printers to choose from). Is there a way for a user to select the printer without Crystal Reports overriding it? Thanks.

Crystal Report Printer Does Not Respond
Hi
I have a Crystal Report printing problem on the Network printer.
I am using CR 7.0

I have the following code Snippet:

CrystalReport1.ReportFileName = gReportsPath + "" + "Report1.RPT"
CrystalReport1.ReportFileName = gReportsPath + "" + "Report1.RPT"
......... bla bla bla
CrystalReport1.Destination = 1
CrystalReport1.Formulas(0) = " "
CrystalReport1.Formulas(0) = "Status = " + "'" + gsStatus1 + "'"
DoEvents


......... bla bla bla


The problem is

-- -- the report does not print or display from the VB code
-- -- it prints very well from the Crystal Report menu.
-- -- I even put the printer's IP address and name on the property of the CR Control in my VB code.

I appreciate any help or suggestion what might be wrong in my code or the report reference

Thank you very much.

abanik

Crystal Report Printer Setup
Hi
I have placed a Crystal Report Designer in my VB project and I have a crystal Report Viewer on one of my forms that shows the report. My question is how can I get the Printer Setup button to appear on the Crystal report viewer so the user can choose where to print their crystal report? Is this possible?
Thanks in advance

Print Crystal Report On Dot Matrix Printer
Greetings,
I use VB6, Crystal Reports 8.5 and I have to send
a crystal printout on a Dot Matrix printer.
Using the normal way I managed to print my data,
however the printer "identifies" these data as Image
and prints accordingly and slow.
What I would like to do is print raw data (text and numbers)
as their type and not as image.
something like the Printer.Print does....
any ideas?

thanxs in advance

How To Enable Printer Icon In The Crystal Report
Hi all

I developed an vb appl with the crystal report.My system is not connected to the printer.So while working on the report it shows that no default printer is connected and printer is disabled.

But on my client side they connected to the printer. But the printer icon is disabled.

How is enable the printer icon in the report in my client side.

Please help me out.

Regards

Sasikumar

PROBLEM IN PRINTING A CRYSTAL REPORT TO PRINTER
MY REPORT PRINTS TO THE SCREEN BUT WHEN I PRESS THE PRINT BUTTON THE REPORT DOES NOT GO TO THE PRINTER . KINDLY HELP

Printer Icon In Crystal Report 10 (Crviewer)
i need help regarding CR10. how can i set the printer icon in CR10(CRviewer) where i can choose the type of printer and how to set the paper if it is landscape or portrait? kindly help...



Edited by - edd_hills on 4/29/2006 5:56:14 AM

Where Is Printer Setup In Crystal Report Viewer?
Dear all,

I was using Crystal Report Control in my VB Project to show my .rpt report files.
For some reasons, I'm using Crystal Report Viewer now.
But I can't find Print Setup button in it's properties, not like CR Control, I can enable it by setting WindowShowPrintSetupBtn properties value to True.
Is there any way to show Printer Setup Dialog in CR Viewer like in the CR Control? so I can choose which printer i'm going to use.

please share.

Crystal Report Printing Directly To Printer
hii iam trying to print report directly to printer iam using Crystalreport 8.5 and vb6
so can any one help me how to print directly iam using this code it executes but it wont print.

Me.CrystalReport1.ReportFileName = "I:Reportvbreport.rpt"
Me.CrystalReport1.DiscardSavedData = True
CrystalReport1.Destination = crptToPrinter
CrystalReport1.PrintReport

Trying To Print Crystal Report Directly To Printer
Hi,

I am trying to print crystal report directly to network printer without viewing the report through ASP. This was working on NT4 Server, IIS. I installed shared printer on NT 4, register these printers in the registry and then printed directly to these printers through ASP.

Now we have 2000 server. Did the same on 2000 server, but when ASP page is called, Selectprinter as well as Printout method do not return any error code but still report is not printed to the printer. Can you help me with the same?

VB, Crystal Report , Acrobat Reader, Printer
Hello!

I would like print (manualy) acrobat reader document. I use crystal report vb code to generate the document. Everything allright.
But i would like change the printer default of the acrobat reader document generated (This document only)

How can i do?
Thank's
GaŽl

Crystal Reports Report Screen - Printer Not Working
Hi,

I have distributed runtimes for 8.5 onto a machine, because of poor quality images in reports, performed the various upgrades to my development machine and onto the server where i had installed the original runtimes, overwriting everything.

After some potching about because crystal reports refused to appear and then refused to export stuff, i got it all working - except, the printer icon is disabled and the printer-setup icon on a report does not do anything when you click on it (it allows you to click, but nothing appears).

I have run regmon and filemon to try and track any errors, but nothing appears out of the ordinary.

Any ideas which DLL controls connection to the printer etc.. ?

Thanks !

Crystal Report Viewer - Change Printer At Runtime
I need to allow the user to select the printer at runtime. Can I do this using Crystal report viewer? I have seen posts using SElect printer but I want my app to be independant of this installation and wan to allow the user to select a printer from those installed on site.

Does anyone know how to do this please?

Print Directly To A Printer Using Crystal Report Viewer
Dear all,

How can I print a report directly to a printer without showing the report?
e.g. User select a number (ex. CI00001) from Customer Invoice Form. There are 2 active toolbar icon: Print and Preview. When a user click Preview icon button then the Customer Invoice No. CI00001 report will show, and when a user click Print icon button, the Customer Invoice No. CI00001 will directly print to a printer without previewing the report.
I have no problem in Previewing the report.

Please share.

Problem To Access Printer Setup Via Crystal Report
im hvin a problem with crystal report application in vb.sometimes the report needs to be printed using a3 paper.
pls advise how can i access or initiate printer properties via crystal report.
thnks in advance

PRINTING A 132 COLUMN REPORT ON DOT MATRIX PRINTER USING CRYSTAL REPORTS 5
THE CRYSTAL REPORTS VERSION I AM USING DOES NOT ALOOW ME TO PRINT A LARGE SIZE REPORT (ie 132 COLUMN FORMAT) AS IT DOES NOT HAVE THE SETTINGS FOR THIS. HOW DO I GET AROUND THIS POBLEM ? KINDLY HELP

How To Enable Network Printer Selection Button At Crystal Report Viewer
Hi all

How to enable the network printer selection window button at crystal report viewer ?


Thanks for help

Set Default Paper Size For Default Printer ...
So, hope that someone could help me..hix..
If i cant do this i will loose my job, my boss say so. I have to print a webpage with the size of paper is A5 baut the default always is Letter, hix, I could change it by hand but the users may not. So i want to set the default paper size of default printer to A5.
Thanks a lot.

How To Set PDF Writer As Default Writer Proramtically Though VB And To Print CRYSTAL REPORT Through Button.
Hello,

I need some help & some where l lost in the following task. I need this
method for some purpose. I used following code but the printer is not
turning to default when I set the Laser Printer to Acrobat Printer.

Private Sub Command1_Click()
For Each P In Printers
If P.DeviceName = "Acrobat PDFWriter" Then
Set Printer = P
Exit For
End If

Next
CommonDialog1.Flags = cdlPDPrintToFile
CommonDialog1.PrinterDefault = True
CRViewer1.print report
End sub

Before this step, I am previewing the crystal report 8.5

The command1 button is added in the cr viewer. Now when I click this, I
believe it suppose to go to PDF writer but here still default to our
actual printer instead of PDF writer.

Is any one guide me and find out where I lost?

Regards
Best Regards,

Arun Kumar Rodrigues
Mohamed AbdulRahman Al-Bahar
P.O. Box 6038
Sharjah - U.A.E.
Tel.:+971 6 5433 555 - Ext. 343
Direct:+971 6 5141 343
Fax:+971 6 5432 555
E-mail: email@removed

How Can I Change The Default Printer At Runtime To Use It With Printer.print Command?
Hi everyone,
I have a little application which uses printer.print command to do some print jobs, of course there are some other things that I print using Data Reports.
When my application starts, I think it instantiates printer object with the default printer (lx300). Once the application is started, there are some options that use printer.print, but there are options that use printer.print too but I need to print them in another printer (ip1000). I have a common dialog that lets me choose the printer, and when I choose ip1000 every printer.print call goes to lx300. I assume there's no way to "reinstantiate" printer object to print in ip1000.
Also, when I close my application ip1000 becomes my default printer. Does the common dialog can select a printer without changing the Windows default printer like Word, Excel. do?

Thanks a lot for your help

VB6 - Print A Text File To A Remote Printer And My Default Printer
Please how can I get a text file located in my hard drive (C:) to print to my default printer and also print to a Remote Printer?

The remote printer is named "U288".

Any workable code snipet will be appreciated.

Thanks y'all.

Giftx.

How Can I Change The Default Printer At Runtime To Use It With Printer.print Command?
Hi everyone,
I have a little application which uses printer.print command to do some print jobs, of course there are some other things that I print using Data Reports.
When my application starts, I think it instantiates printer object with the default printer (lx300). Once the application is started, there are some options that use printer.print, but there are options that use printer.print too but I need to print them in another printer (ip1000). I have a common dialog that lets me choose the printer, and when I choose ip1000 every printer.print call goes to lx300. I assume there's no way to "reinstantiate" printer object to print in ip1000.
Also, when I close my application ip1000 becomes my default printer. Does the common dialog can select a printer without changing the Windows default printer like Word, Excel. do?

Thanks a lot for your help

Changed Default Printer But Job Goes To Old Default...
I have a print command with the following code:

Code:
Private Sub cmdPrint_Click()
Dim tmpPrinter As Printer
Dim DefaultPrinter As Printer

Set DefaultPrinter = Printer ' Save the default printer

For Each tmpPrinter In Printers
If tmpPrinter.DeviceName = cmbPrinters.Text Then
Set Printer = tmpPrinter
Exit For
End If
Next tmpPrinter

CrystalReport1.ReportFileName = FileIn.Path & "" & FileIn.FileName
CrystalReport1.Destination = crptToPrinter
CrystalReport1.PrintReport

MsgBox "Your report was printed"

Set Printer = DefaultPrinter ' Change back to default printer
End Sub
where the combo box is populated by this code:

Code:
i = 0
For Each InstalledPrinters In Printers
cmbPrinters.AddItem InstalledPrinters.DeviceName
i = i + 1
Next InstalledPrinters
cmbPrinters.ListIndex = 0
I select a printer (not the default printer, but a different one) from the combo list, then click on Print and the job is still going to the original default printer. Stepping through the code, I can see how Printer changes (to the printer I selected) during the execution, but the job keeps going to the old default printer. Also the last line of code in the cmdPrint_Click sub gives me a "Run-time error '13': Type mismatch" error.
What am I missing? Can anyone help please?

Thanks,
poli

How To Show &"Select Printer&" Dialog Before Printing A Crystal Report?
Hi everyone.
I use Crystal Reports 8.5
In my code I always call the: mycrviewer.ViewReport command. When the report shows up if I press print button it only shows me a dialog with the default printer to set number of copies and pages to print.
I would like to show up a dialog which let me select the printer and adjust other printer settings (like paper size, etc.) like DataReport does.
How can I do this?

Thanks for your time and help!

How To Show &"Select Printer&" Dialog Before Printing A Crystal Report?
Hi everyone.
I use Crystal Reports 8.5
In my code I always call the: mycrviewer.ViewReport command. When the report shows up if I press print button it only shows me a dialog with the default printer to set number of copies and pages to print.
I would like to show up a dialog which let me select the printer and adjust other printer settings (like paper size, etc.) like DataReport does.
How can I do this?

Thanks for your time and help!

[crystal Report] Avoid Printer From Ejecting Page After Printing A 3 Line Page
Im taking a printout in crystal report - but there are only 3 lines and after printing it goes to next page - but I dont want it to goto next page.
Instead I want it to continue the rest of the printing - which may be in some other report etc - to continue printing from where it left behind (maybe one or 2 lines break)
But after printing 3 lines it automatically ejects out the paper and goes to next page
How do I avoid this ?
Thanks




Edit by johnminkjan: Topic Title

Anjanesh

Edited by - johnminkjan on 9/7/2004 12:01:29 PM

How To Printer.Print To Non Default Printer

I have a small app that I need to modify.  Basically it sends a report straight to the (default) printer by Printer.Print

Users want to print to their non-default printer, too.  I could change the default printer by Set Printer = another Printer and then get back to the original one, but is there a better way to do it?
Have fun.

---- Andy

Unable To Open The Crystal Report Exported In Crystal Report Format
Hi,
Sub: Unable to open the Crystal report exported in Crystal Report Format

1)    I have used Oracle Native connection, while designing the report.
2)    I have passed the record set to the report at run time.
3)    Exported the report to Crystal Report Format, But I could n’t able to open report, while opening , the report asks for OLEDB information, even though I used Native connection at design time.
4)    In Crystal Report 8.5, connect driver property, but I am using crystal reports XI and in Visual Basic 6.0, Is there any method or property to convert the connection?. As I have to export report to crystal format and emailed to user, so that user can open it.
Any assistance in this regard is highly appreciated

The code is as follows:
Public Sub Aging_REPORT(strSQL As String, sReportName As String, sDestFileName As String, ReportTitle As String)

On Error GoTo Err
Dim CrAppl As CRAXDRT.Application
Dim crrep As CRAXDRT.Report

Dim rsCrystal As ADODB.Recordset
 
    Set CrAppl = New CRAXDRT.Application
    Set crrep = CrAppl.OpenReport(sReportName) 'Opens the report
    
   Set rsCrystal = New ADODB.Recordset
  
   
    rsCrystal.Open strSQL, Conn, adOpenStatic, adLockReadOnly
    rsCrystal.Requery
    
    
     With crrep
     .DiscardSavedData
    .Database.LogOnServer "crdb_oracle.dll", strServerName, "", strUserName, strPassword
     .ReportTitle = ReportTitle
     .Database.SetDataSource rsCrystal, 3 'LINK REPORT TO RECORDSET
     .VerifyOnEveryPrint = True
     End With
 
   With crrep.ExportOptions
    .DestinationType = crEDTDiskFile
    .FormatType = crEFTCrystalReport
    .DiskFileName = sDestFileName
   End With
   
     
   crrep.Export (False)
    Set crrep = Nothing
    Set CrAppl = Nothing
    Exit Sub
Err:
 MsgBox Err.Description

End Sub

Thanks,

How To Pass Format String To Crystal Report From VB And How To Use It In Crystal Report?
Hi,

I am working on VB 6.0 and using crystal report 7 as reporting tool.
In report, some clients are asking 3 decimal places(Eg. 2000.500) while other clients are asking 2 decimal places(Eg. 2000.50) for numeric fields.
I want to pass the amount of decimal places for numeric fields to crystal report from VB.
How should I implement this using VB.
Pls any one can help me?

Thanks in vance,
Soundar

How To Replace Crystal Report Control With Crystal Report Designer
Hi,

I want to replace crystal report control with crystal report designer in vb. report files are ready.
and parameters have passed by crystal report control to the actual repors which are made in segate crystal report.
now i want to keep the re[prt files as it is. but instead of control,
i want to use designer.

plesae help me

thanks
mital

Default Printer
I have a network computer with a printer attached to lpt1 that I use for printing. The problem is, since the computer uses a dynamic ip I have to reconnect to the printer every time the computer restarts, it uses one of three ip addresses ( since there are three computers on the network). I have tried connecting to the printer by the computer's name, but this doesn't work. Can a small app be written to check and see if there is a printer attached to a network computer and if it's there set that printer as the default? I think I need a winsock control to "ping" the computer and if there's a response to set the printer to the default. Can this work, and if so, how can it be done/where can i learn how?

Thanks,
redrum

Set A Default Printer
Is it possible to programmatically change a default printer? How?

this is for VB6

Default Printer
I have two printers that have been setup in my computer. One is local and the other is in the network. My program needs to print in those two printers. How can I change the default printer of my computer? Im using vb6 in Windows 98 OS.

Help! How To Set Default Printer Using VB?
I have 5 printers connected to my machine, and I set Printer(2) as default in system's Control Panel, now I want to print the data report to different printer, so I try to change printer using following VB code:

private sub command1_click()
Set rsPrinter = New Recordset
strSql = "select * from PPRINTERSITE where SITEID = '81';"
rsPrinter.Open strSql, g_dbConn, adOpenKeyset, adLockOptimistic
If Not rsPrinter.EOF Then
For Each prt In Printers
If prt.DeviceName = rsPrinter("PRINTERNAME") Then
MsgBox "Printer is " & prt.DeviceName
Set Printer = prt
Exit For
End If
Next
End If
dataReport1.PrintReport
end sub

though the message from MsgBox told me the Printer already changed to other printer ( such as Printer(0) ), but the dataReport1 still be printed in Printer(2), Can someone help me?

Thanks

Yinghong

Default Printer
Hi all, is there a way to use vb code to set the default printer to print a crystal report w/i vb? Currently there is no way to change the default printer from the crystal report (crviewer)....please help..thanks!

Get Default Printer
Hi,
I want to find an API functions that tells me the name of default printer installed on my computer. 'Printer' object from VB is not enought for what I need.
Thanks
Lucian

Copyright © 2005-08 www.BigResource.com, All rights reserved