Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to convert a rpt file with multiple procs into pdf file

Status
Not open for further replies.

wfuyanli

Programmer
Jun 24, 2006
11
US
I have an .rpt file using two procs. Each proc needs one or more parameters.
When I open the report from crystal report 11 preview, I just need to type in the value for each parameter.
Now I need to convert this rpt file into pdf file and open it in the Internet Explorer window, can anybody share your code with me?
Thanks a bunch!
 
Hi,
After running it, export it to PDF..
Also, IE will not open PDFs directly, it needs to use the Adobe Reader..






[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
How does this report use 2 stored procedures, is there a subreport, or are you trying to join stored procedures, or?

-k
 
I know how to convert rpt to pdf if the rpt uses one proc and contains a few subreports, and it does open in the adobe reader.
The report I need to convert into pdf format has two procs in the main report without any subreports.
Report_Sample1.rpt contains
proc_nameA which needs parameter x and parameter y,
proc_nameB which needs parameter w and z.
Hope my explanation is clear enough.
Thanks again!
 
Crystal expects a single datasource for a report, not 2 different ones, so I don't understand how the report works, I asked if they were somehow linked or in subreports, you said no to subreports, so are they somehow linked/joined? I don't have Crystal in front of me, but I didn't think that you could JOIN SPs.

I think that you should rethink your design to use a single SP (call the 2 SPs from within one SP, or perhaps use Views and join those.

-k
 
Hi,
No it is not..If the report runs and you can view the data, then it should be exportable to PDF regardless of how the data was obtained-

What happens when you try?

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Turkbear, I think you are right. I am setting up an easy test example.

CurLogin = Curtable.LogOnInfo
CurLogin.ConnectionInfo.ServerName = "Server1"
CurLogin.ConnectionInfo.DatabaseName = "Database1"
CurLogin.ConnectionInfo.Password = "pswd"
CurLogin.ConnectionInfo.UserID = "User1"
Curtable.ApplyLogOnInfo(CurLogin)
CurLogin.TableName = "proc_GetDataforthereport;1"

//how do I use another proc here?

//in my code, this part specify the connection, and
//then provide value for the proc:

Dim crParameterFieldDef1 As ParameterFieldDefinition
crParameterFieldDef1 = crParamFieldDefs.Item("@ProjId")
crParameterValues = crParameterFieldDef1.CurrentValues
crParameterValues.Add(spValue1)
crParameterFieldDef1.ApplyCurrentValues(crParameterValues)



If there are more than one parameters, the logic is to repeat this part.
But I don't know how you can use two procs in the main report. and if that's ok, when given parameter value, how to specify which parameters are for which proc?
 
I didn't realize that you were coding this, soemthing you should state in your posts up front.

Crystal can't use 2 SPs for a report (reliably, I can cheat this, but it's a bad idea). The reason is, how would Crystl know which SP is to be used where, which recordnumber relates to which recordset, etc.

So combine the SPs or use a subreport for one.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top