Passing Dynamic Query From VB To Crystal Reports
I want to know how to pass a SQL query from a VB form to crystal reports so that the same report will change depending on the query given from the vb form. Please help.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Crystal Reports & Dynamic Query (even Tables And Fields Changes In The Query At Run Time)
Hi there!
I need to link the crystal report to a query that is generated dynamically. I will be knowing about which table to be linked and which fields to be retrieved at run time only. Fields are refered using an alias in all the query output to get a common name for all. I cant use a dataset or TFX file solution as mentioned earlier as i am not aware of the tables and fiels till runtime. Else i have to hardcode all the possible combinations in different tft file and link .
i tried with a temporarytable but that too doesnt seems to work.
Can anyone guide me of any simpler methode of doing this?
Bipin
Passing Query From VB To Crystal Reports
=A0
=A0how do i pass a sql query to crystal report and the same reportwill display results based on the query supplied from the vb form. please elp.
thanks
kamal
How To Use Crystal Reports To Make The Dynamic Reports?(I Can't Use The Design Expert To D
How to use Crystal Reports to make the dynamic reports?(I can't use the design expert to design the report,because the data source with different fields is unknown in design time.)
Hello all!
I use the dynamic generating MS Access table as the Data Source of Crystal Report.
How to use the Crystal Reports to display the data of the dynamic generating MS Access table?
Thanks All!
China
Edited by - dehuiworkroom@hotmail.com on 12/17/2003 9:37:59 PM
Dynamic Crystal Reports In VB Using Crystal Viewer Control
hi,
my problem is i m new to crystal reports. I have prepared a application in vb 6.0 which is used for printing bills. When enter all the particulars and press print the crystal viewer is showing only the first bill which was saved. wat i want wen i give the print command the viewer shud show the present bill, so it can be printed.
thanks!!
Reports Using Dynamic Query Results...
I don't feel that I was entirely clear the first time around...here is what I
need to accomplish..
say I have an SQL statement in VB modules:
SQL1 = "Select ID FROM People WHERE ID = ' & userinput.text & ' "
how do I produce the results of this query in result from, as I do not have
Crystal Reports installed on any system that I use. Thanks in advance for
the help.
Dynamic Crystal Reports... How To?
OK, I am designing an application that will allow users to specify what data they want to pull from an Access 2000 database with multiple tables.
My question is this:
Is it possible to design a dynamic report in Crystal Reports 8.5 Developer Edition without the Embeddable API.... which of course costs more money for an extra license? If so, I would love to see some code on this, or some instructions on how to pass that to CR.
Secondly, is it possible to make a snapshot or dynaset off of the user's choices after the user clicks the Submit button and then pass ithe dynaset to Crystal Reports? I am kinda new to Crystal. I have done generic reports in Crystal, but it just drug in all records for a specific table. I am needing this application to be flexible with reports because they need it that way.
I thank you for your time, and desparately need some assistance with this. This is the last hurdle in the project and any help is greatly appreciated. Thanks!
Dynamic ADO And Crystal Reports XI CR
I can't seem to figure out how to dynamically link an ADO recordset to a CR XI report. I have created the report template with a static link to the database and need to create a custom report based off on a combobox in a VB6 application.
I need to either pass an sql statement into the report template or pass an ADO recordset to act as the datasource. Any code to get me going would be appreciated.
Thanks
Do Dynamic Reports With Vb Vs Crystal Reports
I'm interesting to do one dynamic report based on change their information along the time. It depends on the selected items... then If I select more items, the report must show more subreports. Each one of them contain the information of item selected.
Any code idea to begin ? ?... I'm coding with vb and crystal reports.
I appreciate your help.
Have a nice day.
Dynamic Images In Crystal Reports .rpt
Is there anyway you can print images dynamically to a .rpt report created in crystal reports 8.5 developer using visual basic 6.0??? I have a report which is to display an image for each record in the database. My images are j-peg files stored in a folder on a server. I tried to use a Picture object from within Crystal Reports but it seems you can only give it one file name which displays the same picture on every record. Can this be done using a .rpt file and calling it from VB 6.0?? Any help would be greatly appreciated.
Dynamic Groups In Crystal Reports 8.5?
I would like a report to group by "TaxDistrict" if the user selects "Neighborhood", and I would like a second group by "Neighborhood" to exist only if the user selects "TaxDistrict".
Does CR 8.5 support dynamic report grouping?
Thank you!
Dynamic Images With Crystal Reports Using Rpt
Hi there friends. I got the crystal reports 9 professional edition, so i´m sadly now allowed to create Dsr form in my project. I´m trying to show pictures located in a folder who´s location is saved in an access table, and even when i found examples of making this with the dsr and it seems easy, i can´t find a good way to show pictures with the Rpt, using the crviewer control in a vb6 form. I would appreciate any suggestion. Thanks in advance
How Can I Add Dynamic Image To Crystal Reports
I would like to know how can i add Dynamic image to Crystal reports.
I am using Visual Basic 6.0, Crystal Reports 8.5, SqlServer 2000
Depending on what the user selects as image in the application, I have to show that in the report. Image Path is stored in the database.
Would appreciate any reponse.
Thank You
Dynamic Reports With Crystal Report 8.5
How can I produce dynamic reports with crystal report?
I mean I want to make a report with VBCODE, then adding some fields to a report with VBCODE, and sometimes deleting some fields from a report with VBCODE?I need a simple example or code for it.
Thank you
Dynamic Subreports Creation In Crystal Reports
Hi Friends,
Can anybody help me with dynamic subreport creation. i program in CR 8.5 using RDC object model. i know there are objects for retrieving an existing report as a subreport using the importsubreport method but how do i create subreport using RDC from scratch?
Regards
Ashish Kamat
How To Pass Tablenames To Crystal Reports Dynamic
I have a crystal report build for one table. But in my VB6 application, I am building tables with the same structure in different names based on user selection. How can I use the same Crystal report for different table names?
Crystal Report allows you to change the database name (DataFiles(x)), but can't find a property for tablename.
Anybody to help?
Making A Dynamic Report With Crystal Reports 7
I have to implement some reports with crystal reports into a visual basic programm.But the implemented reports should only be templates. The real source of the reports become known during the runtime. So I tried to use Data Definition Files *.ttx and pass a ADO-Recordset into it. But if I look at the printig preview nothing had changed. Here's the sourcecode:
Dim conn as ADODB.Connection
Dim comm as ADODB.Command
Dim ADOrs as ADODB.Recordset
Dim appli as CRPEAuto.Application
Dim rep as CRPEAuto.Report
Dim repDB as CRPEAuto.Database
Dim repTables as CRPEAuto.DatabaseTables
Dim repTable as CRPEAuto.DatabaseTable
private Sub Form_Load()
set conn = new Connection
conn.Open ("Provider=MSDASQL.1;Data Source=nordwind-dsn;")
set comm = new Command
comm.CommandText = "Kunden"
comm.CommandType = adCmdTable
comm.ActiveConnection = conn
set ADOrs = comm.Execute
set appli = CreateObject("Crystal.CRPE.Application")
set rep = appli.OpenReport("d:crysrepueb
wind.rpt")
set repDB = rep.Database
set repTables = repDB.Tables
set repTable = repTables.Item(1)
repTable.SetPrivateData 3, ADOrs
for Each Field In repTable.Fields
Debug.print Field.Name
next
for Each Field In ADOrs.Fields
Debug.print Field.Name
next
rep.Preview
End Sub
And here's the TTX-File:
Kunden-CodeString10
FirmaString40
KontaktpersonString60
PositionString20
StrasseString40
OrtString40
Could anyone help me?
Akademos
P.S. I'm rather new in VB
P.S.S I apologize for my bad english but i'm not used to write real english and not in structed english *g*
Passing From VB6 To Crystal Reports 6
Hello. I am trying to find a way to pass a boolean variable from my VB6 project into Crystal Reports 6 (within VB).
The intention is to use this value in a Suppression Formula. In other words, depending on what the value is, it will either suppress or not suppress the section of the report.
Anybody who can suggest a way for me to either pass or access this value from my VB into Crystal to use in this formula, please do so. Thanks.
Fast Brent
Including Dynamic Chart In Web Page Via Crystal Reports
I'm want to dynamically create a bar chart from Crystal Reports (either 8.5 or 9.0) and save it as an image via an ASP page. Then, I'd like to use that image in the page I'm currently building.
I currently have a COM that is connecting to Crystal to spit-out dynamically created pdf files that I then open via hyperlink.
I'm not using RAS... Nor do I have Enterprise installed on the IIS server.
In short, can I create a unique bar-graph image from a Crystal .rpt file, on demand, from the web?
Anyone who replys within 2 days of me posting this message will recieve 5 EXTRA BROWNIE POINTS!
Thanks,
JT Howard
Passing Parameters To Crystal Reports
Hi guys..hope you can help with this one.
My interface is basically a bunch of checkboxes. The user selects the ones he/she wants to see in a report. Does anyone know, how can I pass the selected items to Crystal Reports?
Passing Formulas To Crystal Reports
I am trying to pass a very simple text message to a Crystal Report using the RDC in version 8.5 and having a terrible problem getting it to work. I have looked at every example I can find that Crystal has published without success.
Heres the specifics:
The report (crxReport) has a blank formula called Explanation.
I want to poulate this when the report is printed with a very simple (2 word) explanation based on a status code of the record in the database. I cant seem to get the right syntax in the vb code to be passed to the report when I use the RDC.
The following code doesn't work:
crxReport.FormulaFields.Item(1).Text = "@Reason = '" & strReason & "'"
Logic tells me I should be entering the field name "somewhere" but I can't figure out where and the above example doesn't work..
The error messages that I get when i try to run do not help.
Can anyone give me a simple example that I can use?
Passing Dates Into Crystal Reports
i have a report that is using start and end dates, the report is fine.
But when i try to pass in the dates from my vb then i get an error.
my code is
Code:
If optReprint.Value = True Then
With crptBmi
.ReportFileName = APPConst.DatabasePath & "BMIReprint.rpt"
.Password = Chr(10) & UncryptPassword(APPConst.DatabasePassword)
.WindowParentHandle = frmMain.hWnd
stParam = "SDate;#" & st & "#;True"
.ParameterFields(1) = stParam
stParam = "EDate;#" & en & "#;True"
.ParameterFields(2) = stParam
.Action = 1
.Reset
End With
End If
The error i get is "an invalid parameter value"
Crystal Reports Parameter Passing
I want to be able to run a crystal report from visual basic 6.0. I made a report, but it reports all data from the access database. I want to be able to pass a parameter to the crystal report from the vb app and then have the report pull the data linked to that parameter from the database and fill in the correct fields on the report. Is this possible or do I have to make all of the fields on the report parameter fields then pass the correct data to it from the vb app?
Passing Parameter To Crystal Reports
I looked on the Crystal reports site and got some sample code for Passing parameters to crystal reports but it doesn't work. VB doesn't like the .GetItemByName. This option doesn't come up if I just type the '.' after crxReport.ParameterFields so I don't think I have it or don't know if you can do it another way.
Thanks for any help
Passing Parameters To Crystal Reports 6
Hi again!
I want to find out how to pass parameters to Crystal Reports from a SQL database through VB 6. I am doing reports for my app and I need to know where to begin.
Sample code would be great if you have it. Thanks in advance for your help.
Passing Arrays In Crystal Reports
i have an array of say customer codes.
i want to pass it to crystal report , so that it shows records of only those customers.
pls hep me as to how to go abt it and what i've to set in crsytal repots ie selection formula etc
thanks
Passing A String Into Crystal Reports - How?
I`m using Crystal Reports 8 - developers edition.
How do i pass a string into the report from Visual Basic (6, sp4). I`m using the RDC, not the old .ocx.
I`ve played around with parameter fields, but i`m not sure this is the right approach.
Typically, the help provided is useless.
Its a simple question, any ideas?
Thanks,
Alex.
Passing An SQL Statement Into Crystal Reports
I am tyring to query data out of my Db and pass it into crystal reports and display it based on what the user searches for. How do you pass a SQL statement into crystal reports through VB. I am using the crystal report component but I cant find a method or property that will update my crystal report. Here is my code.
sSQL = "SELECT * FROM Tracking"
sGroup = "GROUP BY Date HAVING User=" & txtAdd(16).Text
if len(sGroup) > 0 Then sGroup
CrystalReport1. ? (this is where I am stuck)
CrystalReport1.PrintReport
Note: This is my first time using crystal reports and I am not very familiar with its methods and properties. I have been playing around with it but I can't get it to work. I created the report and it displays data based on the user name I inserted but I wanted to update it based on what the user queries out in VB.
Passing Parameter Value To Crystal Reports
I have a stored procedure that accepts 2 input parameters.
I designed a report and specified default values for this from crystal reports and it works well, but now I want users to be able to specify values at run time from VB6 environment but all I get is an empty report, I don't know what the problem is, help.
This is the code I used
rpt.StoredProcParam(0) = Trim(Me.cboReportCode.Value)
rpt.StoredProcParam(1) = Me.cboFromPayPeriod.Value
rpt.Action = 1
Passing A Recordset To Crystal Reports 8.5
Hi there,
Please can someone help.. I have been pulling my hair out over this for about a week now.
I have a project with a report, the user can select a vehicle to view in the report and only records for that vehicle should be displayed, but all the records are being displayed. I have created a recordset and tried passing this to the report but it just wont have it :( Below is a snippet of my code :- (I have hard code the vehicle in for testing purposes)
Dim Report As New CrystalReport2
Dim ConHistory As Connection
Dim RsHistory As ADODB.Recordset
Set ConHistory = New Connection
With ConHistory
.Provider = "microsoft.jet.oledb.3.51"
.ConnectionString = "Data source = " & App.path & "history.mdb"
.Open
End With
Set RsHistory = New ADODB.Recordset
With RsHistory
.Open "SELECT * FROM history WHERE [vehicle name] = " & Chr(34) & "T560 CFM" & Chr(34), ConHistory, adOpenStatic
End With
Report.Database.Tables(1).Location = App.path & "history.mdb"
Report.Database.SetDataSource RsHistory, 3, 1
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Any help or guidance anyone could offer on this subject would be greatly appreciated.
Thanks In Advance
Brian
Passing Formulafields To Crystal Reports 10
hi to all,
im new in CR10 i have a problem on passing string value to the reports from my vb code.. anyone can help me on this problem...... im using crystal reports ver. 10...
thank you...
here's my code;
Private Sub Form_Load()
Dim crystal As New CRAXDRT.Application
Dim report As New CRAXDRT.report
Set report = crystal.OpenReport("D:ClientSQLPMICReportIssuanceReport_2.rpt")
'in this portion i having a problem the error is run-tume error '9' subscript out of range
'ZZTitle1 - this is my formulafields on my report...
report.FormulaFields(0) = "ZZTitle1='Issuance Summary'"
'
With Me.CrystalReportViewer
.ReportSource = report
.ViewReport
.Refresh
End With
End Sub
Passing Information To Crystal Reports 4.6 Within VB6
I am writing a freight expediting program. I have hit a stumbling block and wonder if someone can shed some light on my problem. I am trying to make a dynamic report (i.e. changes based on information from my form). Every example I have come across only show static reports that are not tied back to the forms and don't show how to let the user select its filters. I am trying to create a report based on the information from my request form and packaged detail form. I want the user to select the data from the forms and be able to print out a professional looking request form to pass on to the supplier. How to I pass information from a drop down box to Crystal Reports? Please Help!!!!!
VBA Passing Parameters To Crystal Reports
I have an application in VBA (Excel2000) which opens and exports a report from Crystal Reports (8.5). The Crystal has a Parameter Field which I to update from within the VBA application in Excel. Does any one know how to pass the value of a variable in VBA to the Paremeter field in Crystal
I'd appreciate any help
Thanks and regards
Michael Bond
Parameter Passing+ Crystal Reports
Hi,
I want a command button on my VB form to invoke the report(report1) & prompt the user to enter a parameter value on the basis of which the data will be retrived.
Kindly help............its urgent
Passing Recordset To Crystal Reports
Hey all,
I am trying to pass a ADO recordset to a Crystal Report but since I am fairly new to this, I was wondering if there are some good examples of doing this. I am using Crystal 8.5 and my goal is to generate my sql statement in VB, get the recordset and then pass the recordset to the report.
Everything I have seen so far requires you to make a report (.rpt file) while specifying a datasource. I know I probably have to create a .rpt file but how do I make one that doesn't specify a datasource and all that. Maybe I'm way off here but I'm looking for guidance.
Any good examples of code would be great!
Thanks,
Greg
Passing Paramters To Crystal Reports
hi group
I am facing a problem with Crystal Reports. In my VB application when I passed parameters to the Crystal reports using Crystal Report OCX , a prompt dialog box is diaplyaed before displyaing the values on report. Here is the code I am using.
CrystalReport1.ParameterField(0)="City;Hyderabad;TRUE"
even if use FALSE in place of TRUE the same thing is happenning.
any body please help me to avoid prompt dialog box.
Thanks in Advance
Passing Form Data To Crystal Reports
I have a VB form in which i have a combo box for the Months of a year.I want to pass this combo box value to the Crystal Report wherin i want to query the database using this value and generate a report.
can anyone help me out how to do this and how to pass values to crystal reports.
Passing Mulitple Recordsets From VB To Crystal Reports
(Using VB v6.0 and Crystal Reports v9.0
Hi,
I want to pass multiple recordsets from VB to Crystal Reports. I know how to pass one. In my main report in Crystal Reports I have subreports, this is why I want to do this. Can someone help me please?
Thanks a lot.
Nadisha
Passing Form Data To Crystal Reports
I have a VB form in which i have a combo box for the Months of a year.I want to pass this combo box value to the Crystal Report wherin i want to query the database using this value and generate a report.
can anyone help me out how to do this and how to pass values to crystal reports.
Crystal Reports / Passing Paramater To Subreport
I am attempting to call up a report and imposing parameters (date). I have done this often enough, but the difference here is that the report contains 3 subreports. It is in the subreports where I would need the paramaters to go.
Here is the code I am using to call the report. How could I alter this code to impose parameters on subreports within this report?
VB Code:
Dim Response As String Response = InputBox("Enter Date (m/d/yyyy):", "Enter Date") 'Empty length string is returned when user selects 'Cancel'. If Response = "" Then Exit Sub End If 'Make sure user enters a date. If IsDate(Response) = False Then MsgBox "Please enter a date.", vbOKOnly + vbExclamation, "Invalid User Entry" Exit Sub End If '--------Encapslulated code opens cr report-------- Dim Report As New rptBuySchedule Dim crPDefs As CRAXDRT.ParameterFieldDefinitions Dim crPDef As CRAXDRT.ParameterFieldDefinition Set crPDefs = Report.ParameterFields For Each crPDef In crPDefs With crPDef Select Case .ParameterFieldName Case "SettleDateParm" .AddCurrentValue CDate(Format(Response, "mm/dd/yy")) End Select End With Next Report.EnableParameterPrompting = False frmRptView.CRViewer1.ReportSource = Report frmRptView.Show frmRptView.CRViewer1.ViewReport '-------------------------------------------------
Passing Params To Crystal Reports Control From Vb
Help..on passing params to Crystal reports from VB5
I am using VB5.0 and crystal reports 8.5 .
New to crystal reports.
could someone clarify some basic question please.
1. should I use "Crystal reports" control or "Crystal report viewer"
2. I have a report and I need to pass 3 parameter from my VB screen. How can I do that?
thank you
nath
Passing Datetime Parameter To Crystal Reports
i have a crystal report that uses a stored proc and has a parameter that's defined as DateTime. this is the code i'm using to pass the parameter in:
VB Code:
pReport.ParameterFields(i).AddCurrentValue CDate(strParams(i - 1))
but this seems to pass in an empty value (i know that strParams(i - 1) has the value "01/01/01"). if i use Format instead of CDate, if just returns a type mismatch error.
has anyone else experienced this?
Passing Stored Procedures To Crystal Reports
I need some help passing an ADO recordset to a Crystal Report.
I would eventually just like to send a stored procedure. If someone could show me an example of this, it would be greatly appreciated
Passing VB6 Form Values To Crystal Reports
Dear all,
Please help me in passing VB6 Form values to crystal reports 11.
i have tried the following:
Create a Blank Formula F1 and Place it in the designer in Header Section.
From VB, before showing, pass this Formula :
Crpt.Formulas(0) ="F1='" & text1.Text & "'"
this works well.
Now i have external images path data in VB and i want those images to be shown in crystal reports. new images every time.
i tried linking files in CR, but then the exe size increases even if the images are linked externally.
please help.
Thanks and regards,
sapmaster
Passing Values From Forms To Crystal Reports
Hi,
I would like to know as to how to pass values from
forms to crystal reports after placing the crystal
control in the form. If there are any specific codes,
include them if possible. Is it possible to embed the
query in the form itself instead of designing it in
the crystal report.
Also I would like to print a summary of a single
record from multiple tables and not list out all the
records. Is it possible in crystal reports to do so.
Please reply ASAP.
Thank you in advance.
Regards,
Lakshmi narasimhan
Passing Record Sets To Crystal Reports 4.0
Hey,
This program i've been working on is still being a pain. What i hate most is how the SQL syntax is different for VB and CR.
How would I go about setting a recordset in VB and passing that recordset to CR4.0? Thus making the report generated display only the information in the recordset.
Thanks
Passing A Multiple Value Parameter To Crystal Reports 8
I have designed an invoice as a CR8 Report. It works fine on its own and when I call it in my VB6 app via CrystalReport control.
In my app, I have a grid to list invoices so users can select various invoices and then click on the cmdPrint. I enhanced my report by setting InvoiceNo as a GroupField so that I could pass it multiple InvoiceNos and it runs fine within CR but only accepts single value parameter from VB6.
I tried passing it a comma-delimited string but it wouldn't work, it won't accept an Integer array either.
I've searched this site, Google, and the web but I can't find a VB6-specific example.
Code:Private Sub cmdPrint_Click()
On Error GoTo ErrHandler
Dim TaxInvNos As String
Dim x As Integer
If MSFlex2.TextMatrix(1, 1) <> "" Then
If MsgBox("Do you want to Print the Invoice?(Yes/No)", vbYesNo, gstrMessage) = vbNo Then Exit Sub
For x = 1 To MSFlex2.Rows - 1
If MSFlex2.TextMatrix(x, 13) = "x" Then TaxInvNos = TaxInvNos + MSFlex2.TextMatrix(x, 0) & ","
Next x
If TaxInvNos <> "" Then
TaxInvNos = "(" & mID(TaxInvNos, 1, Len(TaxInvNos) - 1) & ")"
Call procreport(TaxInvNos)
End If
End If
Exit Sub
ErrHandler:
MsgBox Err.number & ":" & Err.Description
End Sub
Private Sub procreport(taxinvno As String)
On Error GoTo ErrHandler
'The commented out lines are the other option I tried for the Long array.
'Dim inv() As Long
'inv = Split(taxinvno, ",")
CrystalReport1.Connect = cnn
CrystalReport1.ReportFileName = App.Path & "
eportsInvoice2.rpt"
CrystalReport1.ParameterFields(0) = "INVNO;" & taxinvno & ";True"
'CrystalReport1.ParameterFields(0) = "INVNO;" & inv() & ";True"
CrystalReport1.Destination = crptToWindow
CrystalReport1.WindowState = crptMaximized
CrystalReport1.WindowShowExportBtn = True
CrystalReport1.WindowShowPrintBtn = True
CrystalReport1.WindowShowPrintSetupBtn = True
CrystalReport1.Action = 1
CrystalReport1.Reset
Exit Sub
ErrHandler:
MsgBox Err.number & " : " & Err.Description
End Sub
I really need help.
GoodGuy
Experience is a bad teacher for its exams precede its lessons.
|