Hi
I have a .NET application that needs to obtain the details of the parameters for a crystal report.
I have written some code, that opens a report into the crystal viewer and the gets the parameter info and displays it in a msgbox.
However, the viewer prompts for the parameters, before i get a chance to get the information and display it.:(
My question is, does anyone know of a way that i can get the parameter information from a report, without the user being prompted for the parameters ?
Thanks in anticipation[Moved thread]|||YOu need to populate the parameters to the report before viewing it the viewer or printing it to the printer.
here is a sample from VB on how to populate parameters and formulas.
Dim crFormula As CRAXDRT.FormulaFieldDefinition
Dim crParam As CRAXDRT.ParameterFieldDefinition
crReport.DiscardSavedData
For Each crParam In crReport.ParameterFields
Select Case crParam.Name
Case "{?SortType}"
crParam.AddCurrentValue m_strSortType
End Select
Next crParam
For Each crFormula In crReport.FormulaFields
Select Case crFormula.Name
Case "{@.StartDate}"
crFormula.Text = "DATE( 2001, 01, 01)"
Case "{@.EndDate}"
crFormula.Text = "DATE( 2002, 03, 30)"
crFormula.Text = """All Offices"""
Case "{@.DetailOrSummaryFlag}"
crFormula.Text = """" & m_strSummaryDetailFlag & """"
Case "{@.Seperate}"
crFormula.Text = """FALSE"""
Case "{@.SetShowWarning}"
crFormula.Text = """FALSE"""
Case Else
'do nothing
End Select
Next crFormula|||Hi
I have a .NET application that needs to obtain the details of the parameters for a crystal report.
I have written some code, that opens a report into the crystal viewer and the gets the parameter info and displays it in a msgbox.
However, the viewer prompts for the parameters, before i get a chance to get the information and display it.:(
My question is, does anyone know of a way that i can get the parameter information from a report, without the user being prompted for the parameters ?
Thanks in anticipation
Dim APP As New CRAXDRT.Application
Dim REPORT As CRAXDRT.Report
REPORT = APP.OpenReport("C:\SHIPMENT_SCHEDULE\REPORTS\XL.rpt")
REPORT.EnableParameterPrompting = False
(this is the one you should include...disabling the parameter prompting)
Showing posts with label opens. Show all posts
Showing posts with label opens. Show all posts
Tuesday, March 20, 2012
Crystal Reports - Verifying Database
Using VB6. New to Crystal. Our app opens a report and shows it. When
we change the underlying database, every time the report is viewed,
even if no fields that affect the report are changed, report was not
opening at all. im calling report from my VB application with few
parameters.
When im opening the report manually from Report Designer (8.5 Dev
edition) and using the option VERIFY DATABASE, its showing the message
("The database is now up to date"). and report working properly and
update info is ther in reports.
How can I get Crystal to just do it automatically? How can I do it in
code so end users see their reports despite changes in the database?
(i'm using VB 6.0, Ms Access 2000 and Crystal Report 8.5 Dev edition)I've solved this problem throught CR automation, view this sample code:
http://www.visualbasiccode.com/Asp/showsn.asp?theID=3857|||Hi surrender,
I'm using crystal report control to call my report created seperatly in report designer. im calling my report from vb application.
not using anylengthy codes, just created one report in designer and calling from vb....
still im fighting with this problem.....
regards
Sekharsql
we change the underlying database, every time the report is viewed,
even if no fields that affect the report are changed, report was not
opening at all. im calling report from my VB application with few
parameters.
When im opening the report manually from Report Designer (8.5 Dev
edition) and using the option VERIFY DATABASE, its showing the message
("The database is now up to date"). and report working properly and
update info is ther in reports.
How can I get Crystal to just do it automatically? How can I do it in
code so end users see their reports despite changes in the database?
(i'm using VB 6.0, Ms Access 2000 and Crystal Report 8.5 Dev edition)I've solved this problem throught CR automation, view this sample code:
http://www.visualbasiccode.com/Asp/showsn.asp?theID=3857|||Hi surrender,
I'm using crystal report control to call my report created seperatly in report designer. im calling my report from vb application.
not using anylengthy codes, just created one report in designer and calling from vb....
still im fighting with this problem.....
regards
Sekharsql
Crystal Reports - Refresh Problems
Using VB6. New to Crystal. Our app opens a report and shows it. When
we change the underlying database, every time the report is viewed,
even if no fields that affect the report are changed, report was not
opening at all. im calling report from my VB application with few
parameters.
When im opening the report manually from Report Designer (8.5 Dev
edition) and using the option VERIFY DATABASE, its showing the message
("The database is now up to date"). and report working properly and
update info is ther in reports.
How can I get Crystal to just do it automatically? How can I do it in
code so end users see their reports despite changes in the database?
(i'm using VB 6.0, Ms Access 2000 and Crystal Report 8.5 Dev edition)Hi Sekhars
try this out
1. set the database property at form load event.
CrystalReport1.Database(0)="C:\mydb.mdb"
CrystalReport1.ReportFilename="c:\Report.rpt"
2, On the button_Click event
CrystalReport.Action=1
Try this out if it works rate me|||Hi Fundooo,
I'm using crystal report control to call my report created seperatly in report designer. im calling my report from vb application.
in your reply you suggested to use as below
crystalreport1.database(0) = "c:\mydb\test.mdb"
crystalreport1.reportfilename = "C:\myrept\test.rpt"
but im not able get DATABASE method, crystalreport1.database not working with me..... saying "AUTOMATION FAILED/ NOT SUPPORTED" -
still im fighting with this problem.....
regards
Sekhar|||do you know how to declare and instantiate a report object in VB??
eg in general declarations at top of form code area:
Dim objPrintApp As CRAXDRT.Application
Dim objReport As CRAXDRT.Report
and then, in a sub or function:
Set objPrintApp = New CRAXDRT.Application
Set objReport = objPrintApp.OpenReport(strReportSourcePath & strSourceFile)
If you're getting an automation error, you probably haven't done your declare and instantiation properly.
dave|||This is my Code
-------
Rem Reference to Crystal Report Object.
Rem DDReport = Crystal Report Object Name
Rem All required properties are set to DDReport object.
Private sub CmdPrt_Click()
On Error GoTo errhand
DDReport.ReportFileName = "c:\Reports\DDRpt.rpt"
DDReport.PrintReport
DDFavList = False
Unload Me
Exit Sub
errhand:
DDFavList = False
MsgBox Err.Description, vbInformation, "Error"
Exit Sub
end sub
we change the underlying database, every time the report is viewed,
even if no fields that affect the report are changed, report was not
opening at all. im calling report from my VB application with few
parameters.
When im opening the report manually from Report Designer (8.5 Dev
edition) and using the option VERIFY DATABASE, its showing the message
("The database is now up to date"). and report working properly and
update info is ther in reports.
How can I get Crystal to just do it automatically? How can I do it in
code so end users see their reports despite changes in the database?
(i'm using VB 6.0, Ms Access 2000 and Crystal Report 8.5 Dev edition)Hi Sekhars
try this out
1. set the database property at form load event.
CrystalReport1.Database(0)="C:\mydb.mdb"
CrystalReport1.ReportFilename="c:\Report.rpt"
2, On the button_Click event
CrystalReport.Action=1
Try this out if it works rate me|||Hi Fundooo,
I'm using crystal report control to call my report created seperatly in report designer. im calling my report from vb application.
in your reply you suggested to use as below
crystalreport1.database(0) = "c:\mydb\test.mdb"
crystalreport1.reportfilename = "C:\myrept\test.rpt"
but im not able get DATABASE method, crystalreport1.database not working with me..... saying "AUTOMATION FAILED/ NOT SUPPORTED" -
still im fighting with this problem.....
regards
Sekhar|||do you know how to declare and instantiate a report object in VB??
eg in general declarations at top of form code area:
Dim objPrintApp As CRAXDRT.Application
Dim objReport As CRAXDRT.Report
and then, in a sub or function:
Set objPrintApp = New CRAXDRT.Application
Set objReport = objPrintApp.OpenReport(strReportSourcePath & strSourceFile)
If you're getting an automation error, you probably haven't done your declare and instantiation properly.
dave|||This is my Code
-------
Rem Reference to Crystal Report Object.
Rem DDReport = Crystal Report Object Name
Rem All required properties are set to DDReport object.
Private sub CmdPrt_Click()
On Error GoTo errhand
DDReport.ReportFileName = "c:\Reports\DDRpt.rpt"
DDReport.PrintReport
DDFavList = False
Unload Me
Exit Sub
errhand:
DDFavList = False
MsgBox Err.Description, vbInformation, "Error"
Exit Sub
end sub
Sunday, March 11, 2012
Crystal Report Problem
Please guide me..
I have a form which has a button on it. when clicked it opens up a Crystal Report, designed in Crytsal Report 10.0.
The source of the data for the report is an .xsd file, which basically resides in my C:\INETPUB\WWWROOT\<app name>\ directory.
The application runs fine on my machine.
when the whole of the code is deployed to some other machine and executed, the report again looks for the .xsd file in the
C:\INETPUB\WWWROOT\<app name>\ which is different this time, and thus results in an error.
How can this be solved...The data source obviously has to be available to wherever you're trying to run the report from. I'd suggest putting the file in a shared place on the network so that all machines running the report can access it using the same address.
I have a form which has a button on it. when clicked it opens up a Crystal Report, designed in Crytsal Report 10.0.
The source of the data for the report is an .xsd file, which basically resides in my C:\INETPUB\WWWROOT\<app name>\ directory.
The application runs fine on my machine.
when the whole of the code is deployed to some other machine and executed, the report again looks for the .xsd file in the
C:\INETPUB\WWWROOT\<app name>\ which is different this time, and thus results in an error.
How can this be solved...The data source obviously has to be available to wherever you're trying to run the report from. I'd suggest putting the file in a shared place on the network so that all machines running the report can access it using the same address.
Subscribe to:
Posts (Atom)