473,387 Members | 3,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How do I pass parameters thru Crystal to modify printer behavior?


Hello All,

I have a new challenge. I've created a Crystal Report (version 10) and saved the file. Now from my program I want to print it to an Adobe PDF file.
My question is: How do I pass parameters thru Crystal to modify printer behavior?

For Instance:
1. Pass it a path & filename to save to. eg; "C:\ReportDist\R100102-060902.pdf" (included the date in the filename)
2. Tell the Adobe PDF printer to overwrite an existing file if present.
Other things like 1 & 2 above.

I'm using Adobe Acrobat v7.0 Pro. I do not have their SDK. I only want the the larger reports to go to PDF. The others I will be printing to their
local printer. Any other way to accomplish the same?

Thanks,

Hexman
My code is pretty straight forward.

private sub PrintReport102()
Dim reportPath As String = "C:\ReportDefs\"
Dim reportName As String = "R100102.rpt"

Dim myReportDocument As ReportDocument = New ReportDocument()
myReportDocument.Load(reportPath & reportName)
myReportDocument.SetParameterValue("SelectedDate", "09/02/2006")
myReportDocument.PrintOptions.PrinterName = "Adobe PDF"
myReportDocument.PrintToPrinter(1, True, 1, 999)
end sub
Sep 2 '06 #1
1 1905
I've been used to creating PDF's with Acrobat that I didn't look deep enough into CR. To do what I need to do, just used the export command instead
of "PrintToPrinter". All path and filename properties are available!!

Hexman
On Sat, 02 Sep 2006 01:55:09 -0700, Hexman <He****@binary.comwrote:
>
Hello All,

I have a new challenge. I've created a Crystal Report (version 10) and saved the file. Now from my program I want to print it to an Adobe PDF file.
My question is: How do I pass parameters thru Crystal to modify printer behavior?

For Instance:
1. Pass it a path & filename to save to. eg; "C:\ReportDist\R100102-060902.pdf" (included the date in the filename)
2. Tell the Adobe PDF printer to overwrite an existing file if present.
Other things like 1 & 2 above.

I'm using Adobe Acrobat v7.0 Pro. I do not have their SDK. I only want the the larger reports to go to PDF. The others I will be printing to their
local printer. Any other way to accomplish the same?

Thanks,

Hexman
My code is pretty straight forward.

private sub PrintReport102()
Dim reportPath As String = "C:\ReportDefs\"
Dim reportName As String = "R100102.rpt"

Dim myReportDocument As ReportDocument = New ReportDocument()
myReportDocument.Load(reportPath & reportName)
myReportDocument.SetParameterValue("SelectedDate", "09/02/2006")
myReportDocument.PrintOptions.PrinterName = "Adobe PDF"
myReportDocument.PrintToPrinter(1, True, 1, 999)
end sub
Sep 4 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

110
by: Mr A | last post by:
Hi! I've been thinking about passing parameteras using references instead of pointers in order to emphasize that the parameter must be an object. Exemple: void func(Objec& object); //object...
8
by: Tcs | last post by:
I've been stumped on this for quite a while. I don't know if it's so simple that I just can't see it, or it's really possible. (Obviously, I HOPE it IS possible.) I'm trying to get my queries...
2
by: Robert | last post by:
when using the following function to create a pass through query is there a way to set the query property, "Returns Rows" to no. The default is yes. Since we are planning to create the pass...
5
by: Robert Schuldenfrei | last post by:
Hi Again, Forgive me for posting this again, but old items seem to get little review. I thought I could adjust the viewer properties without any further aid from the NG, but I was wrong. When...
1
by: Karthic | last post by:
When i right click on the .rpt file in the VS 2003, i see a property printer setting. It says "No printer" on the top and there is option to select printer and paper settings etc.. I want to...
3
by: Don Wash | last post by:
Hi There! I've posted a few days back about this issue but no solutions has been found and that's why I'm re-posting this. I'm using built-in CrystalReport that comes with VS.NET 2003 to...
19
by: LP | last post by:
I am using (trying to) CR version XI, cascading parameters feature works it asks user to enter params. But if page is resubmitted. It prompts for params again. I did set...
0
by: Helen | last post by:
I have a simple oledb dataset on one windows form in vb .net 2002 calling one column from oracle 7, results appear in a text box But, only the first results appears. Goal is to show all results...
0
by: PriyaManasarovar | last post by:
Can someone help how to pass parameters to a crystal report using a Crystal report object? I am using a console application & hence crystal report viewer cannot be used. And i need to pass the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.