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!

Data Report Parameter passing

Status
Not open for further replies.

netizen

Programmer
Aug 27, 2002
24
0
0
IN
Hi All,
I'm using Data Reports feature of VB6. My Question is that I'm working on this report using an SQL Stored Procedure. So I designed all teh required things that way pulling data using connection object etc.

Now my question is that, how do I pass a normal parameter from VB front-end to this Data report? This is not an SP param but I'm talking about some value being passed from froon-end which needs to be captured in Data Report and shown.

Second, how do i make report print in landscape mode? On the scale I've gone and used up to 11 or 12". It says report size is more or something!

Please give me a solution.

thanks,
Hari
 
The parameters must be defined in the command for the data report using the 'Parameters' tab. You pass values to the report like this:

' Set the Value for Parameter 'Param1'
With deYourDataEnvironment.Commands("comYourDataReport")
.Parameters("Param1").Value = "your value"
.Execute
End With

The VB Data Report uses the default printer so the printer must be set to the proper orientation and paper size beforehand. VB6 Service Pack 5 (downloadable from Microsoft) has the orientation options. If your report is 12" wide then you should have your default printer set to use legal size paper (8.5" x 14") and 'landscape' orientation.

Then use code like this to print:

' Run the report
drYourDataReport.Orientation = rptOrientLandscape
drYourDataReport.Refresh
drYourDataReport.Show vbModal
' Set printer back to default settings
drYourDataReport.Orientation = rptOrientDefault
' Close the Recordset to force a requery when the report is run again
deYourDataEnvironment.rscomYourDataReport.Close
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top