Friday, March 30, 2012
passing parameter from vb 6 to crystal report 8
.Reset
.ReportFileName = App.Path & "\reports\vaccine_flow_ledger.rpt"
.Connect = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=APACCESS"
.DiscardSavedData = True
.ParameterFields(0) = "SDT;" & #1/7/2005#
.ParameterFields(1) = "EDT;" & #1/7/2005#
.Action = 1
End With
Please help me to resolve this problem.Try this
.ParameterFields(0) = "SDT;"# & 1/7/2005 & #"
.ParameterFields(1) = "EDT;"# & #1/7/2005& #"|||I tried that one,but i didn't work.
but
.parameterfields(0) = "sdt;" & "date(2005,1,1);"
works finesql
passing parameter from stored proc to crystal
Ive written a stored proc in my sybase DB which has 2 parameters, one for start date & one for end date. When I execute the proc on the DB I am prompted to enter values for my parameters.
Using an ODBC connection I am able to find my stored proc through crystal, however when I choose my proc, crystal is not prompting me to enter values for the parameters.
In the past Ive used crystal (versions 8 & 9) & when I select the stored proc, it always prompted me to enter values for the parameters.
What am I missing here? Any help would be greatly appreciated.check the sql statement in CR, also, are you using a Command ?,
if not, that may be the way you want to go. Lastly, you could just
add the parameter in CR and have CR prompt you for the date range.|||According to the crystal help, once you choose your stored proc from the list & add it to your report, crystal should prompt you to enter parameter values.
How do I get crystal to prompt me when I add the stored proc to the report?
Wednesday, March 28, 2012
Passing multiple parameters in CR
I am able to generate a report when i am passing single parameter on a specific field in the report.
So can any one help me how to pass multiple parameters.
Thanks in advance
Reddy.I think there are no records that matches your parameterssql
Monday, March 26, 2012
Passing log on info to sub reports
set crSections=session("oRpt").sections
'if i print the error message here it says object does not support this method.
For Each crSection In crSections
crReportObjects = crSection.ReportObjects
'loop through all the report objects to find all the subreports
For Each crReportObject In crReportObjects
If crReportObject.Kind = ReportObjectKind.SubreportObject Then
'you will need to typecast the reportobject to a subreport()
'object once you find it
crSubreportObject = CType(crReportObject, SubreportObject)
'open the subreport object
crSubreportDocument = crSubreportObject.OpenSubreport(crSubreportObject.SubreportName)
'set the database and tables objects to work with the subreport()
crDatabase = crSubreportDocument.Database
crTables = crDatabase.Tables
'loop through all the tables in the subreport and
'set up the connection info and apply it to the tables
For Each crTable In crTables
crTable.SetLogOnInfo "test" , "","test","test"
if crTable.TestConnectivity then
Response.Write "Connecting to sub" ' I am getting this message
end if
Next
End If
Next
Next
please point out what i am doin wrong. Greatly appreciate the help!The culprit is
crSubreportObject = CType(crReportObject, SubreportObject)
i commented this line and it works! :)
Passing Formula as a parameter to SQL Query in AddCommand
I'am new to Crystal reports,
I created a formula based on that i have to fetch column value from database
for that i wrote a very simple query in SQLCOMMAND
as SELECT <TABLE.CPLUMN> FROM <TABLE>
WHERE <TABLE.OTHERCOLUMN>='@.CRYSTAL REPORT FORMULA'
when closing the commandbox i'am getting error "OLE DB ERROR NO DATABSE RECORDS FOUND"
if i pass a some hardcoded vale(data whic exists in database) then the query is not throwing any error..
Thanks
MikeI don't think you can do that. You can create and use parameters in you query but not formulas. Your query looks really simple, so I have some doubts if it was that necessary to create it in your case.
Why don't you use something like that:
if {TABLE.OTHERCOLUMN}>=here print what you have in your '@.CRYSTAL REPORT FORMULA' then {TABLE.OTHERCOLUMN}
This formula does the same.
Friday, March 23, 2012
Passing Data From VB to SSRS using LocalReport
With Crystal reports, it was easy to pass a single piece of data from VB to a report in a formula field. How do you implement this functionality in SSRS 2005 (I am using VS 2005)?
Seems like this should be commonplace, but I can't seem to find any info on it.
I am using a LocalReport, so a URL is not an option.
Thanks.
For anyone else having this problem:
I have figured it out - you have to create a parameter using the Report - Report Properties menu. Then, you link the parameter to a TextBox on the report. Finally, you can pass data from a client using the LocalReport.SetParameters method.
Never did find any documentation on it. Very obscure.
Passing Data From VB to SSRS using LocalReport
With Crystal reports, it was easy to pass a single piece of data from VB to a report in a formula field. How do you implement this functionality in SSRS 2005 (I am using VS 2005)?
Seems like this should be commonplace, but I can't seem to find any info on it.
I am using a LocalReport, so a URL is not an option.
Thanks.
For anyone else having this problem:
I have figured it out - you have to create a parameter using the Report - Report Properties menu. Then, you link the parameter to a TextBox on the report. Finally, you can pass data from a client using the LocalReport.SetParameters method.
Never did find any documentation on it. Very obscure.
Passing data from subreport to main report
I need to convert a Crystal report that contains three subreports. Each of these subreports uses a different stored procedure to obtain data. The main report uses data from these subreports to calculate averages in the footer etc.
How do i get the data contained in these subreports so i can use it in my main report?
Thanks in advance
Pass the data through parameters from the subreport to the main report.
Or maybe you just need to restructure how these reports work. The main report shouldn't be dependent on the subreports. The subreports should be dependent (most likely) on the main report.
|||You cannot reference a sub report from the main report to get totals, etc.
The only way parameters will work is if the user clicks on the subreport and opens the main report, but you are not doing that.
The way I have gotten around this is to calculate the totals/averages in a different dataset, load them into parameters (You cannot put fields into the footer) and put the value of the parameter in a textbox in the footer.
HtH
BobP
sqlTuesday, March 20, 2012
Passing ADO.Net Dataset to Reporting Service
Is the Reporting Service support ADO.NET dataset that pass from application
(like Crystal Report)?
Thanks
NickyIn RS 2000 you would have to write a data processing extension. In RS 2005
you can get a winform and webform control via Visual Studio 2005. You can
use this control either in local or remote mode. Server mode uses reports on
the server and you get the whole Report Manager user interface. If you use
it in local mode you provide the recordset, you also handle all the user
interface for the parameters. I am using this some and it works well but it
is definitely more work than use Reporting Services either directly using
the portal (Report Manager) that ships with the product or using the new
controls in server mode.
The best way I believe to develop with reporting services is to consider RS
to be a service you are using. The service encapsulates and handles
everything you need. You provide the queries. If it is more difficult then
instead of queries use stored procedures. Let Reporting Services handle
things. RS does things in a different way that Crystal but once you get used
to it you should find that RS can be quite fast and powerful for you.
So, the answer is yes you can with the new controls but you should first
evaluate whether you should.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Nicky" <Nicky@.discussions.microsoft.com> wrote in message
news:D72F6395-C241-4014-A330-DAA933FFF3EB@.microsoft.com...
> Hi...
> Is the Reporting Service support ADO.NET dataset that pass from
> application
> (like Crystal Report)?
> Thanks
> Nicky|||Hi Bruce,
Thanks for reply.
My case is like this, I need to pass in a dataset from my application to my
report. and view the report over my application.
The problem is,
1. I need to write my own Xml to built that report by coding? Or, is that
other way I can built up the report like normal, and just pass the dataset to
the to my report?
2. How to open a report from the application without go through the Report
Manager?
3. Do you have any example about this 2 question?
Thanks
Regards,
Nicky|||You do not need to create the report on the fly. Much harder and
unnecessary. Two ways to do this. One, is you create a data processing
extension. This is non-trivial but definitely doable and works for 2000 and
2005. In 2005 the easiest thing you could do is to use the new controls from
Visual Studio in local mode. You hand the control a report and a dataset
(really a table from the dataset) and away it goes. There is more work
involved. For instance, dealing with subreports, any jump to reports etc.
As far as opening the report without going through report manager, you can
use URL integration, you can roll your own using web services or you can use
the new controls from VS 2005.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Nicky" <Nicky@.discussions.microsoft.com> wrote in message
news:3DCCBA4C-DF03-40B1-AF56-045DF85DF88B@.microsoft.com...
> Hi Bruce,
> Thanks for reply.
> My case is like this, I need to pass in a dataset from my application to
> my
> report. and view the report over my application.
> The problem is,
> 1. I need to write my own Xml to built that report by coding? Or, is that
> other way I can built up the report like normal, and just pass the dataset
> to
> the to my report?
> 2. How to open a report from the application without go through the Report
> Manager?
> 3. Do you have any example about this 2 question?
> Thanks
> Regards,
> Nicky
>|||Also, is there a reason that you have to hand the recordset to the report.
Unless you are doing some major business logic to obtain the recordset I
recomment having a query using parameters and then you pass the parameters
to the report (you can do this via the controls (winform and webform) or
using URL integration. RS retrieves and renders the data. Many times people
want to pass the recordset just because that is how they are used to doing
things. It is better to solve the problem using RS the way it is designed if
at all possible. No reason to make matters more complicated. RS is designed
to be tightly integrated with your app, that is not a problem.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Nicky" <Nicky@.discussions.microsoft.com> wrote in message
news:3DCCBA4C-DF03-40B1-AF56-045DF85DF88B@.microsoft.com...
> Hi Bruce,
> Thanks for reply.
> My case is like this, I need to pass in a dataset from my application to
> my
> report. and view the report over my application.
> The problem is,
> 1. I need to write my own Xml to built that report by coding? Or, is that
> other way I can built up the report like normal, and just pass the dataset
> to
> the to my report?
> 2. How to open a report from the application without go through the Report
> Manager?
> 3. Do you have any example about this 2 question?
> Thanks
> Regards,
> Nicky
>|||Hi Bruce
thanks for your recommendation. But, I need to pass in my own dataset
through my application because it include too many business logic.
Anywhere, i have able to find the example:
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B8468707-56EF-4864-AC51-D83FC3273FE5
thanks.
Nicky
Passing a VB string to a Crystal parameter field
I'm having trouble passing a VB string to a Crystal Report parameter field. Following is an excerpt of the code:
----------------
strDocID = InputBox("Please enter the DocID")
If strDocID <> "" Then
With CrystalReport1
.ReportFileName = "C:\Program Files\CSC Imaging\CSCReports\Reports\DocumentHistory.rpt" .Connect = cn.ConnectionString
.WindowState = crptMaximized
strSelection = "{CSC_TRANS.Document_ID} = " & "'" + strDocID + "'"
.ReplaceSelectionFormula strSelection
.Destination = crptToWindow
.Action = 1
----------------
The user enters the DocID, but when the Crystal Report launches, the user has to enter it again.
Following is the entry in the Record Selection Formula:
{CSC_TRANS.Document_ID} = {?DocumentID_PROMPT}
Also, if they select Cancel in the Crystal parameter window, it still tries to run the report. How can I stop the report from running?
Thank you for your assistance!
Andyeither is wrong the formula,and is crystal report,doesn't know the field. or...
work with an report object,and put
Public reportApp As CRAXDRT.Application
Public Report As CRAXDRT.Report
reportApp=createobject("CRAXDRT.Application")
report=reportApp.loadReport("...rpt")
...for not showing parameter prompting
Report.EnableParameterPrompting=false
report is an object of craxdrt.dll i thing at least i have worked with this one.this is for not showing the parameters inputs again.
also,it should be existing in the report(in design) a parameter(Insert/Parameter) and the value for that should have your docID value
something like this.
Dim cpars As CRAXDRT.ParameterFieldDefinitions
Dim cpar As CRAXDRT.ParameterFieldDefinition
Set cpar = cpars(1)
cpar.AddCurrentValue (docID)
docID here is your VB variable
Maybe this will work,or try to verify carefully the selection formula,AND in report it should be existing a parameter that will take in the code that value!
Good luck|||Thank you very much for the reply, jasie24!
Monday, March 12, 2012
Passing a parameter from main report SP to subreport SP
I am using crystal reports 8.5
I have a report which has a subreport. The main report and the subreport are driven by two separate sybase SPs. The main report SP accepts 3 input parameters while the subreport SP accepts one.
One of the 3 input parameters of the main report SP is to be passed to the subreport SP as its input parameter.
So ideally when the report is run, it should ask for only 3 input params.
I tried to link the subreport. But somehow in the link box, I can't see the input parameter of the subreport which is what I want to link to the param of the main report.
Can anybody help ?
Thanks a lot,
AparnaYou can make use of Shared variables.
Assign parameter values to them and use them in subreports. Read it in help file
Passing a dataset to reporting services
I've seen questions similar to this posted, but I'm unable to find a clear answer to what I need to do.
We are currently using Crystal Reports, generating a dataset in our application and passing it to Crystal. Due to the many problems we have with Crystal we are now looking to move to Reporting Services 2005, but I can't find out how to pass it a dataset.
Although we do use SQL Server for data storage, we have many reports with calculations that are way too complicated to use calculated fields, and which change too often to want to store them in the database. One solution might be to store the data temporarily and regenerate it each time it's required, but this doesn't seem very elegant. So please could someone tell me if there is a way to do what I'm after and point me at a page that gives a nice clear explanation.
Thank you
Hi Williams,
Here's a sample that shows you how to pass a Dataset to SRS.
http://msdn2.microsoft.com/en-us/library/aa902651(SQL.80).aspx
Regards,
Amol.
|||Thanks for that. It's surprisingly hard to find this information by searching.Friday, March 9, 2012
passasing date parameters to crystal report using vb
how to pass parameters to crystal report 7 from vb6
pls ant sample code
number3CR.Parameter(0).value="value"|||thanku
i wrote a code
crpt.Connect = "hrstdb"
crpt.ReportFileName = App.Path & "\report3.rpt"
crpt.Formulas(0) = "emp='" & CStr(Trim(Text1.Text)) & "'"
'crpt.Parameter(0).Value = "emp=" & Text1.Text & ";TRUE"
but for parameter it shows the window of parameter and for formula field it shows
sometime and somtimes it does not show
can u detail how to send it again with a sample code
thanks
number3|||'crpt.Parameter(0).Value = "emp=" & Text1.Text & ";TRUE"
Insert a parameter in the report and pass the value for VB to the parameter in the report as :
crpt.parameter(0).Value = ' " & Text1.Text & " '
Saturday, February 25, 2012
Pass a parameter to an url in the default webbrowser
i would like to launch an crystal report file from my vb.net program. This report has 1 parameter field (ID). I would like to give this parameter directly in the URL.
at the moment i use something like this but the parameterwindow still appears.
System.Diagnostics.Process.Start("http://Server/Reports/Report.rpt?ID="&Id)
anyone has a solution?
tnx in advance!
GeertI think there is method to suppress parameterwindow
If there is method like enablepopupmenu then set it to false|||tnx but will supressing the window pass the value? i believe not...
or is there a workaround this problem? like loading the report en then export it?