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




Data Report Printer Selection


How do you set the printer for a data report at design time?

I want to attach code to a button that prints the report to a printer other than the default printer without showing the report.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
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 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

Selection On Data On Crystal Report
I'm new with Crystal Reports in VB. Now I've created a report within Crystal Reports. This works well. The source for the report is the database that also is being used by my VB-application. Now I Call the report from my VB-application and it is being shown, but with all the data from the database of course. How can I do a selection on the data being showed? The user can select a week in the VB-app for example and only the appointments for that week have to be shown in the Crystal Report. How do I do this? Thnx a lot 4 the reply's in advance...

Data Report Group With Record Selection
Hi,

I have a employee report grouped by divison and is working just fine. But how can I select employees based on their name?

So actually I want to have all employes called Peter% grouped by divison.

I'm using VB6 and DE.

Thanks for any help

What's Wrong With My Sql Statement (date Selection) In Data Report ?
Hi,
I have DtPicker1, DtPicker2 and cmd_OK on Form1.
I want to display report based on date selection.
this is code in Form1,


Code:

Private Sub cmd_OK_Click()
Report1.Show
End Sub

Private Sub Form_Load()
DTPicker1.Value = CDate("01/01/2000")
DTPicker2.Value = CDate("12/21/2000")
End Sub

and this is code in Report1,

Code:

Private Sub DataReport_Initialize()
Dim strSQL As String
Dim strTo As String
Dim strFrom As String
Dim oConn As New ADODB.Connection
Dim oRS As New ADODB.Recordset

oConn.CursorLocation = adUseClient
oConn.ConnectionString = DataEnvironment1.Connection1 oConn.Open

With Form1
strTo = .DTPicker1.Value
strFrom = .DTPicker2.Value
End With

Report1.Title = "From: " & strFrom & " To: " & strTo
strSQL = "(SELECT [courier query].* FROM [courier query]
WHERE date BETWEEN #" & strFrom & "# AND #" &
strTo & "# )AS Command4"

oRS.Open strSQL, oConn, adOpenForwardOnly 'line 1 Set Report1.DataSource = oRSEnd Sub

i've set the Connection1..but when i click the button, there was an error,
'Syntax error in union query'.

the error highlights on line 1.

any idea?
thanx..

What's Wrong With My Sql Statement (date Selection) In Data Report ?
Hi,
I have DtPicker1, DtPicker2 and cmd_OK on Form1.
I want to display report based on date selection.
this is code in Form1,

Code:Private Sub cmd_OK_Click()
Report1.Show
End Sub

Private Sub Form_Load()
DTPicker1.Value = CDate("01/01/2000")
DTPicker2.Value = CDate("12/21/2000")
End Sub

this is code in Report1,

Code:Private Sub DataReport_Initialize()
Dim strSQL As String
Dim strTo As String
Dim strFrom As String
Dim oConn As New ADODB.Connection
Dim oRS As New ADODB.Recordset

oConn.CursorLocation = adUseClient
oConn.ConnectionString = DataEnvironment1.Connection1 oConn.Open

With Form1
strTo = .DTPicker1.Value
strFrom = .DTPicker2.Value
End With

Report1.Title = "From: " & strFrom & " To: " & strTo
strSQL = "(SELECT [courier query].* FROM [courier query]
              WHERE date BETWEEN #" & strFrom & "# AND #" &
              strTo & "# )AS Command4"

oRS.Open strSQL, oConn, adOpenForwardOnly 'line 1
Set Report1.DataSource = oRS
End Sub

i've set the Connection1..but when i click the button, there was an error,
'Syntax error in union query'.

the error highlights on line 1.

any idea?
thanx..

Data Anaysis And Report Generation Depending Upon User Selection
I developed a software for a client who recently asked me to add a feature for Data Analysis. He wants that Reports should be generated depending on his record selection criteria. He wants to select fields from tables and the Report should be generated depending upon his selection. I am puzzled as to how to add this feature in VB 6 so that a client can retrieve desired information from Access XP database. The problem is that client has no knowledge of SQL and I have to apply any technique with which even a novice can retrieve any information.
Is there anything to do with DataWarehouse?

Data Analysis And Report Generation Depending Upon User Selection
I developed a software for a client who recently asked me to add a feature for Data Analysis. He wants that Reports should be generated depending on his record selection criteria. He wants to select fields from tables and the Report should be generated depending upon his selection. I am puzzled as to how to add this feature in VB 6 so that a client can retrieve desired information from Access XP database. The problem is that client has no knowledge of SQL and I have to apply any technique with which even a novice can retrieve any information.
Is there anything to do with DataWarehouse?


How To Create A Selection Criteria With VB6 Data Environment Report Designer
Does anyone know how to create a selection criteria in the VB6 data environment data report designer?

I want to select all the entry ID's from an access table based on a variable I alerady have populated.

Thanks!

Bob

Error On Selection Formula To Display Data On Crystal Report From SQL Database
I have a problem on selection formula to display data from SQL database on crystal report it produce an error like this:
error A number, currency amount, date, time, date-time or string is expected here



Code:

Dim Ap As New Application
Dim Rep As Report

Private Sub CRV_Click()

End Sub

Private Sub Form_Load()

Dim RepFileName
RepFileName = App.Path & "LeaveForm2.rpt"
Set Rep = Ap.OpenReport(RepFileName)
Rep.RecordSelectionFormula = "{tblLeaveApp.EmpNo}=" & ndEmpNo ->error is here
Rep.DiscardSavedData
CRV.ReportSource = Rep
CRV.ViewReport
CRV.Zoom 100

'frmcrs.Enabled = False
End Sub

Private Sub Form_Unload(Cancel As Integer)
Form6.Show
End Sub






anyone can help me....

How To Know The User Selection Export File Format Based On Microsoft Data Report
Hi all,

i am using microsoft data report in VB 6 , how to i get the user selection file format (open the export file dialog box) he or she wish to export the file for example to EXCEL. or is any window API to detect the file selection from the file dialog box.

after when the user select *.xls for export i wish to do other application processing , therefore is there any other to detect or know the file format selection from the file dialog box ?


Private Sub DataReport_Initialize()

rptDemo.ExportFormats.Add _
   Key:="ExcelReport", _
   FormatType:=rptFmtText, _
   FileFormatString:="Excel (*.xls)", _
   FileFilter:="*.xls"

End Sub

Private Sub DataReport_AsyncProgress(ByVal JobType As MSDataReportLib.AsyncTypeConstants, ByVal Cookie As Long, ByVal PageCompleted As Long, ByVal TotalPages As Long)

Dim iCount As Integer
Dim i As Integer

'iCount = rptDemo.ExportFormats.Count
'
'For i = 1 To iCount
' Debug.Print rptDemo.ExportFormats(i).FileFormatString
'Next

End Sub

 

Set The Printer For A Data Report
Hi

How do you control which printer the data report (from the data report utility) is printed to?

Any help or examples greatly appreciated

Thanx,
Clint

Data Report - Printer Font
I using Ms Data Report to design a report. there are a lots of data in a row. I using Letter Size as report size (8.5 inch width). and theres not enough space to put my data in one row. There are not other font that enable my data to fit into the paper width, except the font with 17cpi or 20cpi. My printer is providing the font Courier 17cpi, But in the data report design, I cant found this font in the font properties.

can anyone guide me how to solve this problem? how can I use font in the data report? any suggestion of other font which is fixed-width and more narrow (17cpi or 20cpi)?

Thank you

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

Data Report Not Using 'Printer' Settings
I am trying to print a data report to somewhere other than my default printer and it just won't work for me. I am using the code below:

Dim NewPrinter as Printer
For Each NewPrinter In Printers
If NewPrinter.DeviceName = "HP DeskJet 840c series" Then
Set Printer = NewPrinter
End If
Next
CoreRep.Orientation = rptOrientLandscape
CoreRep.PrintReport False


'CoreRep' is the name of my report. If I set a watch on the 'Printer' setting and step through my code, the 'Set Printer = NewPrinter' does in fact change the 'Printer' setting to the 840c printer, but when the 'CoreRep.PrintReport False' code runs, the report comes out on my default printer instead!!!

Can anyone shed any light on this?

Printing VB Data Report To Another Printer
Hi, I'm trying to figure out a way to send a VB data report to another printer rather to the default printer.. I use the

dataReportInvoice.PrintReport

which seems to print to the default printer.. The name of the printer is in a string variable..
Thanks
John

Data Report - 132 Column Printer
I want to print to a 132 Column printer through DATA REPORT.
I am really puzzled.

Please help me...

Data Report/printer Cache Issue
One of my clients who runs large reports just moved to another machine, and the reports that he runs are bombing on his printer. I looked at the printer cache and the report is showing up as much larger than on other machines (5.5 meg as opposed to 131k on mine). Anyone have any ideas why this is happening? Thanks greatly in advance.

Generic Printer Driver With Data Report
hi pips.. ive installed a generic printer driver (generic / text only driver which is included in the windows OS)with the aim of having a fast printing output in my reports using datareport since it prints in a bidirectional manner.. ive achieved my aim.. (thanks to vbforums!) however my problem is the alingment of my report.. some of the fields are misaligned.. when i try to preview my report (e.g. datareport1.show) it is perfectly aligned but when i print it some are misaligned.. please help.. tnx!

Data Report Designer And Choosing Printer
I have a datareport that I need to print without using the printer dialoge box. I do this simply by

DataReport1.PrintReport

However I need this to goto a pritner that other than the defualt. I have tried the following code.

Dim X As Printer
For Each X In Printers
If X.devicename = "hp laser" Then
Set Printer = X
Exit For
End If
Next

This does change the printer.devicename to HP Laser
However when I run datareport1.printreport it still prints to the windows default printer.

How can I change this?

Any help appreciated.

Thanks

Dan

Printer Settings To Landscape In Data Report
every time I need to change the settings in control panel otherwise the report doesn't come properly . the width setting is in landscape but it doesn't work

How To Set Page Size And Printer In Data Report In VB
hi,


I want to know how I could set the page size and printer in VB appliaction. I am Printing DataReport in Vb and I want to set page size for the reports. Kindly give me details about the solution with example.


Thank you,


Shiva

Active Data Report / Print Directly To The Printer
-Anybody can give me an idea how to use VB6.0 ActiveData Report work or sample using a custom paper size. pls.

-Can I print directly to the printer w/o using 3rd party / Active DataReport like DOS base?

-What font will look like and fast as DOS base print out?

THANKS IN ADVANCE

How To Coding Data Table Report With Printer Object ?
HI,Everybody
    
    I would like to know that how to coding data table with printer object. I need concept or example code.

Thank you very much
POLYGON


 

Printer Dialog - Printer Selection
I have the need to be able to switch printers using the CommonDialog1.ShowPrinter and have it actually switch network printers. A user can make the printer selection change, but the printout often comes from the last printer used and not the current one selected even though the correct printer is displayed in the dialog box.

Anyone besides me having this problem?

Crystal Report Crosstab Report Criteria Selection Using Access 2000
Hi there
I there anyone with an idea on how i can filter crosstab Report done in Crystal Report 8.5.. I'm trying to get data btw two dates for instance 05/01/04 and 05/31/04 but the following code doesn't do that. I'm using access 2000 database. Pls assist.

fMainForm.CrystalReport1.ReportSource = crptReport
fMainForm.CrystalReport1.ReportFileName = "F:OutGrowerReportsGLdelivered.rpt"
fMainForm.CrystalReport1.SelectionFormula = "Wdate" >= " & {CrossTabData.WDate} =" & "'" & CDate(DTPicker2.Value) & " AND Wdate" <= " & {CrossTabData.WDate}=" & "'" & CDate(DTPicker2.Value) & "'"
fMainForm.CrystalReport1.WindowState = crptMaximized
fMainForm.CrystalReport1.PrintReport
fMainForm.CrystalReport1.PageZoom (100)

or is there another better way to do this.

Printer Selection
How can i select a printer, and change the properties of the printer, with VBA in Word?

Vba Printer Selection
hi,
like my subject title already says ive a problem with the printer selection

im working in an office with a small network and different printers which can be used on the single computers

but the document i want to print have to be printed on a special printer
the problem i have is that the printer is installed on a different "position" on each computer
(i.e. on some computers it is the first, on others its the fourth)

so i thought this code can help me but it doesnt now nothing is printed anyway


Code:
If Application.ActivePrinter = "\VECTRA07HPLJ2200 auf Ne01:" = True Then
Application.ActivePrinter = "\VECTRA07HPLJ2200 auf Ne01:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, _
Collate:=True
End If
On Error Resume Next
If Application.ActivePrinter = "\VECTRA07HPLJ2200 auf Ne02:" = True Then
Application.ActivePrinter = "\VECTRA07HPLJ2200 auf Ne02:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, _
Collate:=True
End If
On Error Resume Next

...

If Application.ActivePrinter = "\VECTRA07HPLJ2200 auf Ne06:" = True Then
Application.ActivePrinter = "\VECTRA07HPLJ2200 auf Ne06:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, _
Collate:=True
End If
On Error Resume Next
End Sub

can anybody help me what did i make wrong
i thought its a good idea to let the prog look on which place the printer is installed and than let it print but it doesnt work
please help me

Printer Selection
i have a vb 6 program. 2 form to be printed. let say i have 2 printer drivers; Samsung 321 at LPT1 and Canon 654 at LPT2. what i want is, when i click print button, i want form1 printed at samsung printer and form2 printed at canon printer.

can anyone please help me??

Printer Selection
Problem: For some reason, the copy of VB6.0 they gave me at work doesn't have the MSDN stuffs, so no help file for me.

Question: What all do I need to do to select a printer other than the default?

Is it just: Set Printer = PrintName?
Need I set a port or what? It keeps erroring out on me....
Tyler

Printer Selection
If i have multiple networked printers available to print from my PC how could i write the code that allows me to choose which printer i want to print off my document at run time in a vb project?

Is there a printer dialog box that could be used? something similar to the save dialog box?

Any suggestions

Many Thx in advance

Printer Selection
Dear All,

How to select a printer in run time in VB & crystal report.

most of the people select a printer in control panel -> printers only.


But it is very dificult for the user side. some company have lot of printers. they have dot matrix , ink jet and laser jet. so that user didn't go every time in contol panel it is a dificult for them. how times they are going to control panel - printer settings.

I tried CommonDialog also.

Thanks & regards.

IRAM

Printer Selection
I am trying to print to 2 printers under program control. Ideally the user would select the each printer (one for pages, one for labels) using commondialog(s) and the program would remember where to direct subsequent output. I can select a printer using commondialog and can retrieve printer.devicename and printer.drivername (and printer hDC) but I have not yet worked out if and how these can be used to direct output later on. Any ideas anyone?

 

Help On Printer Selection Needed
In my program I generate reports by code and print these by using the commondialog to select a printer to print to.
Works perfectly, only having a problem that it sets the selected printer to default. Don't want that...
By setting .PrinterDefault = False this shouldnt happen but it now only prints to the default printer and not to the selected one.
The mention in the help files that I now should use the .hDC propperty
Anyone any ideas because I can't get it to work

Printer Tray Selection
I've got an application in VB6 that uses the report designer for several dozen reports. I've been able to get them to go to specific printers, but I need certain reports to go to specific trays on those printers (either based on the tray number, or the paper size, doesn't really matter). These would all be preset in the application (with values stored in a DB). So the setup would be similar to this:

Report,Printer #,Tray
A,1,0
B,1, 2
C,6,3
etc...

As I said, I've got the report and printer part working, I just need to be able to automatically select the printer tray.

Using the print dialog box to pop up is not an option, as there are some reports that print 20+ times in a row (each for different divisions) and we can't have the person sitting around waiting for 20 dialog boxes.

I've looked EVERYWHERE but can't find anything on setting the printer trays. Any ideas...???

PrintDlg Printer Selection
Hi all.

I had a problem with the commondialog.showprinter stalling for a while.
The printDlg stops the delay but now, no matter what printer I chose, it prints to the default printer. Does the printDlg need to tell the printer what was selected in the dialog? This is the code as I have it.


VB Code:
With MDI.ActiveForm    Dim printDlg As PrinterDlg    Set printDlg = New PrinterDlg    'Change the focus so that no text or number box has the text highlighted.    .Picture1.SetFocus    ' Set the starting information for the dialog box based on the current    ' printer settings.    printDlg.PrinterName = Printer.DeviceName    printDlg.DriverName = Printer.DriverName    printDlg.Port = Printer.Port        ' Set the default PaperBin so that a valid value is returned even    ' in the Cancel case.    printDlg.PaperBin = Printer.PaperBin    If Not printDlg.ShowPrinter(.hWnd) Then        Debug.Print "Cancel Selected"        Exit Sub    End IfPrinter.Print "TEST"Printer.EndDocEnd with

Printer Selection Problem
Hi,

I have a program which prints to a zebra label printer (mostly) however within the same program is a document which prints to an A4 printer.

My problem is this, when i start the program, which ever printer i choose first is the only printer the program will print to regardless of which ever printer i choose next.

e.g. I open the program, do a search for a part number and print a label to the label printer, next i go to a different form within the same program and print a page to my A4 printer but the page comes out to the label printer.

I should mention, im using a standard printer dialog to choose the printer and also ive tried setting the printer choice at the default and also taken that setting out.

Any help would be much appreciated...

Data Report - Paper Width Is Larger Than Printer Width
I am using the data report for my app which is running in several machines. I am getting an error "Paper width is larger than printer width" in only one machine. What may be the problem ?

Thanks.

Display Printer Selection Dialog Box
Hi Everybody

Another problem!

In the code below all I am trying to do is do some page settings (you may ignore the details) for printing this speadsheet on A3 paper. I am trying to include an error handling section at the end whereby if the current printer cannot print on A3 sheets, then it should display an error message followed by displaying an appropriate dialog box where the user can select a printer that can print on A3 sheet if one is available for the user to pick. If not then the print preview should end displaying appropriate message.


Code:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
'On Error GoTo Display_Error_Message
Dim startRow As Long, wrkgRow As Long, finalRow As Long
startRow = 12: wrkgRow = startRow: finalRow = 560
Application.ScreenUpdating = False
Do While wrkgRow <= finalRow
If Right(Cells(wrkgRow, 1).Value, 2) = "()" Then
Rows(wrkgRow).EntireRow.Hidden = True
End If
wrkgRow = wrkgRow + 1
Loop
Application.ScreenUpdating = True
With ActiveSheet.PageSetup
.PrintArea = "$A$9:$GL$560": .PrintTitleRows = "$1:$8": .PrintTitleColumns = "$A:$A"
.LeftHeader = "": .CenterHeader = "": .RightHeader = ""
.LeftFooter = "": .CenterFooter = "": .RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.590551181102362)
.RightMargin = Application.InchesToPoints(0.590551181102362)
.TopMargin = Application.InchesToPoints(0.590551181102362)
.BottomMargin = Application.InchesToPoints(0.590551181102362)
.HeaderMargin = Application.InchesToPoints(0.393700787401575)
.FooterMargin = Application.InchesToPoints(0.393700787401575)
.CenterHorizontally = True: .CenterVertically = True
.Orientation = xlLandscape: .PaperSize = xlPaperA3
.FitToPagesWide = 6: .FitToPagesTall = 4
End With
Set ActiveSheet.HPageBreaks(1).Location = Range("A147")
Set ActiveSheet.HPageBreaks(2).Location = Range("A285")
Set ActiveSheet.HPageBreaks(3).Location = Range("A423")
Set ActiveSheet.VPageBreaks(1).Location = Range("AI9")
Set ActiveSheet.VPageBreaks(2).Location = Range("BO9")
Set ActiveSheet.VPageBreaks(3).Location = Range("CU9")
Set ActiveSheet.VPageBreaks(4).Location = Range("EA9")
Set ActiveSheet.VPageBreaks(5).Location = Range("FG9")
Exit Sub

Display_Error_Message:
Exit Sub
Dim msg1 As String, msg2 As String, finalMsg As String
msg1 = "Please ensure that your selected printer can print on A3 sheets"
msg2 = "To manually alter print settings, please turn of the Excel events proceeding further."
finalMsg = msg1 & Chr(10) & msg2
MsgBox prompt:=finalMsg, Buttons:=vbInformation + vbOKOnly, Title:="Printer Error"
Cancel = True
End Sub


This seems to work ok except that I am not able to display a dialog box where the user can select a printer capable of printing on A3 sheets (as we can by going to File -> Page SetUp ->).

Any suggestions as to how can I display the appropriate dialog box for the user to select the printer?


Best regards


Deepak Agarwal

Printer Selection Doesn't Work
I have a project like this:

Sub Main shows frmTest which has a User Control on it. The UserControl has a method 'SelectPrinter' to create and load a form frmSelectPrinter where you can select a printer from a drop down list.

I added a button with code
MsgBox "Printer = " + Printer.DeviceName
to frmTest, the main form. It ever shows the printer I've set.

Doesn't matter what printer is displayed then, the printout ever comes off the windows default printer.

I use Win98se with VB6 SP5.

How do I get VB printing off my custom printer? Any help is highly appreciated. TIA

Print Dialog && Printer Selection
Using VB6


Can the print dialog return a value for the printer selected?

Unless the PrinterDefault is set to true it seems to
ignore the selected printer and the printer object
just sends output to the default printer.

I don't want to have to make the selected printer the
system default.

I know I could set up a combo box with a list of printers
in it but I would prefer to use the print dialog if
possible.

Thanks in advance,

SeanR

Printer Selection With Crystal CRVIEWER
Hi !

i have a vb form with a crystal 9 report embedded into it using crviewer

form opens, report runs, and everything is hunky dorey !

except when i come to print it i am only offered my default printer ?

how can i change this so that i get a list of all my available printers ?

please help as this is doing my head in !!!

Thanks

Andy

Printer Selection And Sheet Orientation
Hi,
I have an application for invoice developed in vc++ 6.0 thath use Crystal Report 5.0 for printing.
I have the following questions:

1) I need to print (window and printer) the invoices on printer1 and inventory on printer2, printer1 and printer2 may be network printers. How can I direct the print to the right printer from my program ? Crystal Report use the default printer, but how can I select the printer for invoice and for inventory ?

2) I have reports that are portrait and other that are landscape, if I change the orientation from my program, if the sheet is A4 all is ok but if the priter is for example ibm graphics wide with the US Std Fanfold (large sheet) if I change the orientation to landscape the report is ruoted of 90 degree !!!

Thanks

Rita

Printer Selection Using Crystal Reports Crviewer
Is there any way to ask the user which printer to print to using the crviewer component? I get the report loaded up just fine, but upon clicking the print button...



it doesn't ask which printer to print to, just automatically selects the default.

Any suggestions?



Edited by - eps on 8/23/2004 11:16:49 AM

Report Name Selection/snapshot
hello all..
im workin on a vb project incorporating access as the database and im creating reports in access and save them as a snapshot .snp and calling then in vb to display, im able to get that to work to show all the info in the report that i want and it refreshes when new data is inserted in the database, but im tryin to only show a certain amount of info on the report .. for exsample: i hav a datacombo insert in my vb form and it has the names of people and when i select one of the names in it i want the report to ONLY show everything about that person i hav in my report, but it shows all, does someone know how to do this ? help me on the code ... what the correct sintac is???
thanks///

Reference Listbox Selection From A Report
I have populated a listbox with Client Names

The user can highlight a choice and click print

On Click event:

Private Sub Command2_Click()
DoCmd.OpenReport "rptTitlepage", acViewPreview
End Sub

One of the fields I want the report to display is the bound column of the selection the user makes on the form.

I know how to refer to a value in a text box but can you do this w the value selected in a listbox?

Any help would be much appreciated!

Crystal Report Record Selection
Hi there,

I am using VB6.0. My version of Crystal Report is 8.5. I have developed a label print report in CR first which had some prompt variable for user selection(Area). The report working fine stand alone in CR.
I had excluded the prompt before taking it in VB. Added the SQL selectin to limit the record selection. But it's bypassing the condition and selecting all the record. I can see the value of gsDivision is available.

Any help regarding this will be highly appreciated.

SQL Syntext in form :

rs.Open "SELECT * FROM tblLabel WHERE Division = " & "'" & gsDivision & "'", "ASLBLDEV"
Report.Database.SetDataSource rs


Regards.

Jay

CR REport - Group Selection Formula
I would like to create a group selection formula...
Can anyone give me a sample code formula to what goes into a Group selection formula, the CR help tells you the steps to create one but do not give you an actual sample of the formula.

Crystal Report Selection Formula
Hi,
how can i use left, right and mid ect. function in crystal report selection formula. for example:

CR.SelectionFormula = "mid({Custumer.CustCode},1,3)" ....

we can use mid funtion in VB and Substr function in SQL query, what in Selection formula?

thanks

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