Showing posts with label button. Show all posts
Showing posts with label button. Show all posts

Thursday, March 29, 2012

Directly print to Printer

Hi,
I have a VB Application with Crystal Report 8. If I click the print button in VB, I dont want to show the Crystal Report. I want to print the contents of the report directly to the Printer without showing the report. Is there a way to do this?
Thanks in advance
MadhivananFrom memory, so.........please forgive any errors from failed memory......:-))

assumes using CR active x control:

Dim objPrintApp As CRAXDRT.Application
Dim objReport As CRAXDRT.Report

Set objPrintApp = New CRAXDRT.Application
Set objReport = objPrintApp.OpenReport(strReportSourcePath & strSourceFile)
objPrintApp.LogOnServerEx "pdsodbc.dll", "database", "database", "user", "pwd"

' set PromptUser to False, NumberOfCopies to value >=1
' all parameters in brackets are optional.
objReport.Printout [PromptUser], [NumberOfCopies], [Collated], [StartPageNumber], [StopPageNumber]

dave|||Thanks springsoft. I think this is for CR9 but what is the code for CR8?.

Madhivanan

Friday, February 24, 2012

Different header in HTML vs. PDF?

I have a report that is being displayed as a web page, and I've also
got a "Printer-friendly" button to call the same report generates as a
PDF. However, due to the business needs of the application, we need to
add an additional footer with copyright information to the bottom of
each page in the PDF version, but not display it when it's being viewed
as a web page (since it will be viewed in an IFRAME).
I've seen that the Visibility property of a section can be an
expression, so what I'm thinking is that I could use something along
the lines of =Iif(format="PDF", true, false) for the Visibility of the
footer, so it will show up when the passed-in "Format" parameter is
"PDF", but not when it's "HTML4.0". However, I'm not sure how to
access this parameter, or even whether or not I am able to.
Is there a way to access this value? Or will I have to make two
different reports, one with a footer and one without?
Thanks,
David HendersonThe second option is the best one.
Amarnath
"David Henderson" wrote:
> I have a report that is being displayed as a web page, and I've also
> got a "Printer-friendly" button to call the same report generates as a
> PDF. However, due to the business needs of the application, we need to
> add an additional footer with copyright information to the bottom of
> each page in the PDF version, but not display it when it's being viewed
> as a web page (since it will be viewed in an IFRAME).
> I've seen that the Visibility property of a section can be an
> expression, so what I'm thinking is that I could use something along
> the lines of =Iif(format="PDF", true, false) for the Visibility of the
> footer, so it will show up when the passed-in "Format" parameter is
> "PDF", but not when it's "HTML4.0". However, I'm not sure how to
> access this parameter, or even whether or not I am able to.
> Is there a way to access this value? Or will I have to make two
> different reports, one with a footer and one without?
> Thanks,
> David Henderson
>

Sunday, February 19, 2012

Different Database

I have two databases one is active the other is HIstory data. I need a command button or link or some sort of interface to the other database. Can that be done with a trigger or stored procedure?? How would I go about doing that in (has an access interface, sql engine)You would do it the same way you build an interface to the production system. I guess I'm confused about what you are asking.